33 #include <condition_variable>
48 std::vector<std::vector<std::shared_ptr<ISound>>> m_scenes;
63 std::shared_ptr<IHandle> m_currentHandle;
68 std::shared_ptr<IHandle> m_transitionHandle;
73 std::shared_ptr<IDevice> m_device;
78 std::atomic_bool m_transitioning;
83 std::atomic_bool m_stopThread;
88 std::atomic_int m_soundTarget;
98 std::thread m_fadeThread;
227 static void transitionCallback(
void* player);
228 static void sceneCallback(
void* player);
230 void crossfadeThread();
232 void fadeOutThread();
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
Defines the IHandle interface as well as possible states of the handle.
Status
Status of a playback handle.
Definition: IHandle.h:31
This class allows to play music depending on a current "scene", scene changes are managed by the clas...
Definition: DynamicMusic.h:43
bool seek(float position)
Seeks in the current played back sound.
float getFadeTime()
Gets the length of the crossfade transition (default 1 second).
Status getStatus()
Returns the status of the current played back sound.
float getVolume()
Retrieves the volume of the scenes.
DynamicMusic(std::shared_ptr< IDevice > device)
Creates a new dynamic music manager with the default silent scene (id: 0).
bool pause()
Pauses the current played back sound.
int getScene()
Retrieves the scene currently selected.
bool addTransition(int init, int end, std::shared_ptr< ISound > sound)
Adds a new transition between scenes.
bool changeScene(int id)
Changes to another scene.
void setFadeTime(float seconds)
Sets the length of the crossfade transition (default 1 second).
bool stop()
Stops any played back or paused sound and sets the dynamic music player to default silent state (scen...
int addScene(std::shared_ptr< ISound > sound)
Adds a new scene to the manager.
bool resume()
Resumes a paused sound.
float getPosition()
Retrieves the current playback position of a sound.
bool setVolume(float volume)
Sets the volume for the scenes.