CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
AudioSystem.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "API/Forward.hpp"
11
12#include "AudioListener.hpp"
13#include "AudioSource.hpp"
14
16
18
19namespace CeresEngine {
20
22 class CE_SCRIPT_EXPORT() AudioSystem final : public System<AudioSystem, EntityObjectSet<AudioListener, AudioSource>, ComponentSet<>, EntityActionSet<Play>> {
23 private:
26
29
30 public:
35 explicit AudioSystem(const AudioAPI& renderer);
36
37 AudioSystem(const AudioSystem&) = delete;
38 AudioSystem& operator=(const AudioSystem&) = delete;
39
40 public:
42 void update(double time) override;
43
44 private:
46 void didAdd(const AudioListener& entity) noexcept final;
47
49 void didRemove(const AudioListener& entity) noexcept final;
50
52 void didAdd(const AudioSource& entity) noexcept final;
53
55 void didRemove(const AudioSource& entity) noexcept final;
56
57 public: // Actions
59 void act(Entity& entity, const Play& action) final;
60 };
61
62} // namespace CeresEngine
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition AudioAPI.hpp:18
A system that implements audio playback.
Definition AudioSystem.hpp:22
AudioAPIDevicePtr device
The audio renderer system to be used when producing 3D audio.
Definition AudioSystem.hpp:25
AudioAPIListenerPtr listener
The renderer default audio listener.
Definition AudioSystem.hpp:28
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
The base entity class.
Definition Entity.hpp:41
A type-safe entity type.
Definition Entity.hpp:538
A system is a special kind of service that is managed internally by the SystemManager.
Definition System.hpp:168
Definition Application.hpp:19
An entity action that can be dispatched to a AudioSource to start playing a new audio buffer.
Definition AudioSource.hpp:110