
This class calls init on its instantiation and cleanup on shutdown.
Public Types | |
| typedef std::pair< SoundEffectRef, int > | EffectInfo |
Public Member Functions | |
| void | cleanup () |
| void | clear () |
| clears the cache | |
| MusicStreamRef | createMusicStream (const std::string &filename) |
| SoundEffectRef | createSoundEffect (const std::string &filename) |
| Sto | get (const Key &k) |
retrieves the object identified by k | |
| int | getChannels () const |
returns the number of channels, 1 for mono, 2 for stereo | |
| unsigned int | getCount () const |
| G3D::uint16 | getFormat () const |
| returns the audio format | |
| int | getRate () const |
| returns the audio rate in samples per second | |
| bool | init () |
| bool | isCached (const Key &k) const |
checks if the object identified by k is cached | |
| void | pauseChannel (int channel) |
| pauses playback of the given channel | |
| void | pauseMusic () |
| pauses music playback | |
| EffectInfo | playEffect (const std::string &filename, int channel=-1) |
| plays a sound effect | |
| MusicStreamRef | playMusic (const std::string &filename, int repeats=-1) |
| plays a music file | |
| void | remove (const Key &k) |
| removes an object from the cache | |
| void | resumeChannel (int channel) |
| resumes playback of the given channel | |
| void | resumeMusic () |
| resumes music playback | |
| void | setEffectVolume (int channel, float vol) |
| sets the volume of the given channel to the given ratio | |
| void | setMusicVolume (float vol) |
| sets the music volume | |
| SoundManager () | |
| void | stopChannel (int channel) |
| stops playback of the given channel | |
| void | stopEffect (int channel) |
| void | stopMusic () |
| stops music playback | |
| ~SoundManager () | |
Protected Member Functions | |
| virtual Sto | create (const Key &)=0 |
| SoundEffectRef | create (const std::string &) |
| virtual void | dispose (Sto &)=0 |
| void | dispose (SoundEffectRef &) |
| virtual std::string | toString (const Key &) const =0 |
| converts the given key to an identifier string | |
| std::string | toString (const std::string &) const |
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
clears the cache All cached resources are destroyed. Note that calling this function will invalidate any pointer to a cached resource that may be held elsewhere. |
|
||||||||||
|
Implemented in ONE::util::ResourceManager< T, Key, Handle< T > >. |
|
|
|
|
|
|
|
|
|
|
||||||||||
|
Implemented in ONE::util::ResourceManager< T, Key, T * >, and ONE::util::ResourceManager< T, Key, Handle< T > >. |
|
|
|
|
||||||||||
|
retrieves the object identified by
If
|
|
|
returns the number of channels,
|
|
|||||||||
|
|
|
|
returns the audio format
|
|
|
returns the audio rate in samples per second
|
|
|
|
|
||||||||||
|
checks if the object identified by
The resource will not be loaded if
|
|
|
pauses playback of the given channel
|
|
|
pauses music playback
|
|
||||||||||||
|
plays a sound effect Several effects may be played concurrently.
|
|
||||||||||||
|
plays a music file The old music will be stopped if a new file is requested while music is already playing.
|
|
||||||||||
|
removes an object from the cache
The removed object is destroyed. Note that this will invalidate any pointer to the resource that may be held elsewhere. If
|
|
|
resumes playback of the given channel
|
|
|
resumes music playback
|
|
||||||||||||
|
sets the volume of the given channel to the given ratio
|
|
|
sets the music volume
|
|
|
stops playback of the given channel
|
|
|
|
|
|
stops music playback
|
|
||||||||||
|
converts the given key to an identifier string The return value is stored in the resource map and must serve as a unique identifier for the key. |
|
|
|
1.4.3