![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <SFXDevice.h>
Public Types | |
enum class | AudioAPI : U8 { FMOD , OpenAL , SDL , COUNT } |
![]() | |
using | MusicPlaylist = std::pair< U32, vector< Handle< AudioDescriptor > > > |
using | MusicPlaylists = hashMap< U32, MusicPlaylist > |
Public Member Functions | |
SFXDevice (PlatformContext &context) | |
~SFXDevice () override | |
ErrorCode | initAudioAPI () override |
void | closeAudioAPI () override |
void | setAudioState (const AudioState &state) noexcept |
AudioState & | getActiveAudioState () noexcept |
void | idle () |
void | playSound (Handle< AudioDescriptor > sound) override |
void | playMusic (Handle< AudioDescriptor > music) override |
void | pauseMusic () override |
void | stopMusic () override |
void | stopAllSounds () override |
void | setMusicVolume (I8 value) override |
void | setSoundVolume (I8 value) override |
void | addMusic (U32 playlistEntry, Handle< AudioDescriptor > music) |
bool | playMusic (U32 playlistEntry) |
bool | playMusic (const MusicPlaylist &playlist) |
void | dumpPlaylists () |
PROPERTY_RW (AudioAPI, apiID, AudioAPI::COUNT) | |
![]() | |
AudioAPIWrapper (const Str< 64 > &name, PlatformContext &context) | |
![]() | |
PlatformContextComponent (PlatformContext &context) noexcept | |
virtual | ~PlatformContextComponent ()=default |
PlatformContext & | context () noexcept |
const PlatformContext & | context () const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
![]() | |
FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder) | |
Either give it a name. | |
virtual | ~FrameListener () override |
bool | operator< (FrameListener &that) const noexcept |
![]() | |
GUIDWrapper () noexcept | |
GUIDWrapper (const GUIDWrapper &old) noexcept | |
GUIDWrapper (GUIDWrapper &&old) noexcept | |
virtual | ~GUIDWrapper ()=default |
FORCE_INLINE I64 | getGUID () const noexcept |
GUIDWrapper & | operator= (const GUIDWrapper &old)=delete |
GUIDWrapper & | operator= (GUIDWrapper &&other)=delete |
Protected Member Functions | |
void | musicFinished () noexcept override |
bool | frameStarted (const FrameEvent &evt) override |
![]() | |
virtual bool | frameStarted (const FrameEvent &evt) override |
virtual bool | frameEnded (const FrameEvent &evt) noexcept override |
frameEnded is called after the buffers have been swapped | |
virtual ErrorCode | initAudioAPI ()=0 |
virtual void | closeAudioAPI ()=0 |
virtual void | playSound (Handle< AudioDescriptor > sound)=0 |
virtual void | playMusic (Handle< AudioDescriptor > music)=0 |
virtual void | pauseMusic ()=0 |
virtual void | stopMusic ()=0 |
virtual void | stopAllSounds ()=0 |
virtual void | setMusicVolume (I8 value)=0 |
virtual void | setSoundVolume (I8 value)=0 |
virtual void | musicFinished ()=0 |
![]() | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
![]() | |
void | setCallOrder (const U32 order) noexcept |
virtual bool | frameStarted (const FrameEvent &evt) |
virtual bool | framePreRender (const FrameEvent &evt) |
framePreRenderStarted is called when we need to start processing the visual aspect of a scene | |
virtual bool | frameSceneRenderStarted (const FrameEvent &evt) |
frameSceneRenderStarted is called right before rendering the scene for the current player starts | |
virtual bool | frameSceneRenderEnded (const FrameEvent &evt) |
frameSceneRenderEnded is called immediately after scene rendering for the current player has ended but before any blitting operations | |
virtual bool | frameRenderingQueued (const FrameEvent &evt) |
virtual bool | framePostRender (const FrameEvent &evt) |
virtual bool | frameEnded (const FrameEvent &evt) |
frameEnded is called after the buffers have been swapped | |
PROPERTY_R_IW (bool, enabled, false) | |
PROPERTY_RW (Str< 64 >, name) | |
Protected Attributes | |
AudioState | _state |
MusicPlaylists | _musicPlaylists |
MusicPlaylist | _currentPlaylist |
![]() | |
PlatformContext & | _context |
![]() | |
const I64 | _guid |
Private Attributes | |
AudioAPIWrapper_uptr | _api |
std::atomic_bool | _playNextInPlaylist |
Friends | |
void | musicFinishedHook () noexcept |
Additional Inherited Members | |
![]() | |
static I64 | generateGUID () noexcept |
Definition at line 41 of file SFXDevice.h.
|
strong |
Enumerator | |
---|---|
FMOD | |
OpenAL | |
SDL | |
COUNT |
Definition at line 43 of file SFXDevice.h.
|
explicit |
Definition at line 13 of file SFXDevice.cpp.
|
override |
Definition at line 21 of file SFXDevice.cpp.
void Divide::SFXDevice::addMusic | ( | U32 | playlistEntry, |
Handle< AudioDescriptor > | music | ||
) |
Definition at line 90 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 51 of file SFXDevice.cpp.
void Divide::SFXDevice::dumpPlaylists | ( | ) |
Definition at line 157 of file SFXDevice.cpp.
|
overrideprotectedvirtual |
Adapter patern instead of pure interface for the same reason as the Ogre boys pointed out: Implement what you need without filling classes with dummy functions frameStarted is calld at the beggining of a new frame before processing the logic aspect of a scene
Reimplemented from Divide::AudioAPIWrapper.
Definition at line 65 of file SFXDevice.cpp.
|
inlinenoexcept |
Definition at line 58 of file SFXDevice.h.
void Divide::SFXDevice::idle | ( | ) |
Definition at line 61 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 26 of file SFXDevice.cpp.
|
overrideprotectedvirtualnoexcept |
Implements Divide::AudioAPIWrapper.
Definition at line 153 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 123 of file SFXDevice.cpp.
bool Divide::SFXDevice::playMusic | ( | const MusicPlaylist & | playlist | ) |
Definition at line 105 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 117 of file SFXDevice.cpp.
bool Divide::SFXDevice::playMusic | ( | U32 | playlistEntry | ) |
Definition at line 96 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 82 of file SFXDevice.cpp.
Divide::SFXDevice::PROPERTY_RW | ( | AudioAPI | , |
apiID | , | ||
AudioAPI::COUNT | |||
) |
|
inlinenoexcept |
Definition at line 57 of file SFXDevice.h.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 141 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 147 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 135 of file SFXDevice.cpp.
|
overridevirtual |
Implements Divide::AudioAPIWrapper.
Definition at line 129 of file SFXDevice.cpp.
|
friend |
Definition at line 19 of file SDLWrapper.cpp.
|
private |
Definition at line 91 of file SFXDevice.h.
|
protected |
Definition at line 88 of file SFXDevice.h.
|
protected |
Definition at line 87 of file SFXDevice.h.
|
private |
Definition at line 92 of file SFXDevice.h.
|
protected |
Definition at line 85 of file SFXDevice.h.