OpenMW
|
#include <soundmanagerimp.hpp>
Public Member Functions | |
SoundManager (const VFS::Manager *vfs, const std::map< std::string, std::string > &fallbackMap, bool useSound) | |
virtual | ~SoundManager () |
virtual void | processChangedSettings (const Settings::CategorySettingVector &settings) |
virtual void | stopMusic () |
Stops music if it's playing. More... | |
virtual void | streamMusic (const std::string &filename) |
virtual void | startRandomTitle () |
Starts a random track from the current playlist. More... | |
virtual bool | isMusicPlaying () |
Returns true if music is playing. More... | |
virtual void | playPlaylist (const std::string &playlist) |
virtual void | say (const MWWorld::ConstPtr &reference, const std::string &filename) |
virtual void | say (const std::string &filename) |
virtual bool | sayDone (const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) const |
Is actor not speaking? More... | |
virtual void | stopSay (const MWWorld::ConstPtr &reference=MWWorld::ConstPtr()) |
Stop an actor speaking. More... | |
virtual float | getSaySoundLoudness (const MWWorld::ConstPtr &reference) const |
virtual MWBase::SoundStreamPtr | playTrack (const DecoderPtr &decoder, PlayType type) |
Play a 2D audio track, using a custom decoder. More... | |
virtual void | stopTrack (MWBase::SoundStreamPtr stream) |
Stop the given audio track from playing. More... | |
virtual double | getTrackTimeDelay (MWBase::SoundStreamPtr stream) |
virtual MWBase::SoundPtr | playSound (const std::string &soundId, float volume, float pitch, PlayType type=Play_TypeSfx, PlayMode mode=Play_Normal, float offset=0) |
virtual MWBase::SoundPtr | playSound3D (const MWWorld::ConstPtr &reference, const std::string &soundId, float volume, float pitch, PlayType type=Play_TypeSfx, PlayMode mode=Play_Normal, float offset=0) |
virtual MWBase::SoundPtr | playSound3D (const osg::Vec3f &initialPos, const std::string &soundId, float volume, float pitch, PlayType type, PlayMode mode, float offset=0) |
virtual void | stopSound (MWBase::SoundPtr sound) |
virtual void | stopSound3D (const MWWorld::ConstPtr &reference, const std::string &soundId) |
Stop the given object from playing the given sound,. More... | |
virtual void | stopSound3D (const MWWorld::ConstPtr &reference) |
Stop the given object from playing all sounds. More... | |
virtual void | stopSound (const MWWorld::CellStore *cell) |
Stop all sounds for the given cell. More... | |
virtual void | stopSound (const std::string &soundId) |
Stop a non-3d looping sound. More... | |
virtual void | fadeOutSound3D (const MWWorld::ConstPtr &reference, const std::string &soundId, float duration) |
virtual bool | getSoundPlaying (const MWWorld::ConstPtr &reference, const std::string &soundId) const |
Is the given sound currently playing on the given object? More... | |
virtual void | pauseSounds (int types=Play_TypeMask) |
Pauses all currently playing sounds, including music. More... | |
virtual void | resumeSounds (int types=Play_TypeMask) |
Resumes all previously paused sounds. More... | |
virtual void | update (float duration) |
virtual void | setListenerPosDir (const osg::Vec3f &pos, const osg::Vec3f &dir, const osg::Vec3f &up, bool underwater) |
virtual void | updatePtr (const MWWorld::ConstPtr &old, const MWWorld::ConstPtr &updated) |
virtual void | clear () |
Public Member Functions inherited from MWBase::SoundManager | |
SoundManager () | |
virtual void | processChangedSettings (const std::set< std::pair< std::string, std::string > > &settings)=0 |
Protected Member Functions | |
DecoderPtr | getDecoder () |
Private Types | |
typedef std::auto_ptr < std::deque< Sound_Buffer > > | SoundBufferList |
typedef std::map< std::string, Sound_Buffer * > | NameBufferMap |
typedef std::deque < Sound_Buffer * > | SoundList |
typedef std::pair < MWBase::SoundPtr, Sound_Buffer * > | SoundBufferRefPair |
typedef std::vector < SoundBufferRefPair > | SoundBufferRefPairList |
typedef std::map < MWWorld::ConstPtr, SoundBufferRefPairList > | SoundMap |
typedef std::map < MWWorld::ConstPtr, MWBase::SoundStreamPtr > | SaySoundMap |
typedef std::vector < MWBase::SoundStreamPtr > | TrackList |
Private Member Functions | |
Sound_Buffer * | insertSound (const std::string &soundId, const ESM::Sound *sound) |
Sound_Buffer * | lookupSound (const std::string &soundId) const |
Sound_Buffer * | loadSound (const std::string &soundId) |
DecoderPtr | loadVoice (const std::string &voicefile) |
MWBase::SoundStreamPtr | playVoice (DecoderPtr decoder, const osg::Vec3f &pos, bool playlocal) |
void | streamMusicFull (const std::string &filename) |
void | updateSounds (float duration) |
void | updateRegionSound (float duration) |
void | updateWaterSound (float duration) |
float | volumeFromType (PlayType type) const |
SoundManager (const SoundManager &rhs) | |
SoundManager & | operator= (const SoundManager &rhs) |
Private Attributes | |
const VFS::Manager * | mVFS |
Fallback::Map | mFallback |
std::auto_ptr< Sound_Output > | mOutput |
std::map< std::string, std::vector< std::string > > | mMusicFiles |
std::string | mLastPlayedMusic |
float | mMasterVolume |
float | mSFXVolume |
float | mMusicVolume |
float | mVoiceVolume |
float | mFootstepsVolume |
int | mNearWaterRadius |
int | mNearWaterPoints |
float | mNearWaterIndoorTolerance |
float | mNearWaterOutdoorTolerance |
std::string | mNearWaterIndoorID |
std::string | mNearWaterOutdoorID |
SoundBufferList | mSoundBuffers |
size_t | mBufferCacheMin |
size_t | mBufferCacheMax |
size_t | mBufferCacheSize |
NameBufferMap | mBufferNameMap |
SoundList | mUnusedBuffers |
SoundMap | mActiveSounds |
SaySoundMap | mActiveSaySounds |
TrackList | mActiveTracks |
MWBase::SoundStreamPtr | mMusic |
std::string | mCurrentPlaylist |
bool | mListenerUnderwater |
osg::Vec3f | mListenerPos |
osg::Vec3f | mListenerDir |
osg::Vec3f | mListenerUp |
int | mPausedSoundTypes |
MWBase::SoundPtr | mUnderwaterSound |
MWBase::SoundPtr | mNearWaterSound |
Friends | |
class | OpenAL_Output |
Additional Inherited Members | |
Public Types inherited from MWBase::SoundManager | |
enum | PlayMode { Play_Normal = 0, Play_Loop = 1<<0, Play_NoEnv = 1<<1, Play_RemoveAtDistance = 1<<2, Play_NoPlayerLocal = 1<<3, Play_LoopNoEnv = Play_Loop | Play_NoEnv, Play_LoopRemoveAtDistance = Play_Loop | Play_RemoveAtDistance } |
enum | PlayType { Play_TypeSfx = 1<<4, Play_TypeVoice = 1<<5, Play_TypeFoot = 1<<6, Play_TypeMusic = 1<<7, Play_TypeMovie = 1<<8, Play_TypeMask = Play_TypeSfx|Play_TypeVoice|Play_TypeFoot|Play_TypeMusic|Play_TypeMovie } |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
MWSound::SoundManager::SoundManager | ( | const VFS::Manager * | vfs, |
const std::map< std::string, std::string > & | fallbackMap, | ||
bool | useSound | ||
) |
|
virtual |
|
virtual |
|
virtual |
Fade out given sound (that is already playing) of given object
reference | Reference to object, whose sound is faded out |
soundId | ID of the sound to fade out. |
duration | Time until volume reaches 0. |
Implements MWBase::SoundManager.
|
protected |
|
virtual |
Check the currently playing say sound for this actor and get an average loudness value (scale [0,1]) at the current time position. If the actor is not saying anything, returns 0.
Implements MWBase::SoundManager.
|
virtual |
Is the given sound currently playing on the given object?
Implements MWBase::SoundManager.
|
virtual |
Retives the time delay, in seconds, of the audio track (must be a sound returned by playTrack). Only intended to be called by the track decoder's read method.
Implements MWBase::SoundManager.
|
private |
|
virtual |
Returns true if music is playing.
Implements MWBase::SoundManager.
|
private |
|
private |
|
private |
|
private |
|
virtual |
Pauses all currently playing sounds, including music.
Implements MWBase::SoundManager.
|
virtual |
Start playing music from the selected folder
name | of the folder that contains the playlist |
Implements MWBase::SoundManager.
|
virtual |
Play a sound, independently of 3D-position
offset | Number of seconds into the sound to start playback. |
Implements MWBase::SoundManager.
|
virtual |
Play a 3D sound attached to an MWWorld::Ptr. Will be updated automatically with the Ptr's position, unless Play_NoTrack is specified.
offset | Number of seconds into the sound to start playback. |
Implements MWBase::SoundManager.
|
virtual |
Play a 3D sound at initialPos. If the sound should be moving, it must be updated using Sound::setPosition.
offset | Number of seconds into the sound to start playback. |
Implements MWBase::SoundManager.
|
virtual |
Play a 2D audio track, using a custom decoder.
Implements MWBase::SoundManager.
|
private |
|
virtual |
|
virtual |
Resumes all previously paused sounds.
Implements MWBase::SoundManager.
|
virtual |
Make an actor say some text.
filename | name of a sound file in "Sound/" in the data directory. |
Implements MWBase::SoundManager.
|
virtual |
Say some text, without an actor ref
filename | name of a sound file in "Sound/" in the data directory. |
Implements MWBase::SoundManager.
|
virtual |
Is actor not speaking?
Implements MWBase::SoundManager.
|
virtual |
Implements MWBase::SoundManager.
|
virtual |
Starts a random track from the current playlist.
Implements MWBase::SoundManager.
|
virtual |
Stops music if it's playing.
Implements MWBase::SoundManager.
|
virtual |
Stop an actor speaking.
Implements MWBase::SoundManager.
|
virtual |
|
virtual |
Stop all sounds for the given cell.
Implements MWBase::SoundManager.
|
virtual |
Stop a non-3d looping sound.
Implements MWBase::SoundManager.
|
virtual |
Stop the given object from playing the given sound,.
Implements MWBase::SoundManager.
|
virtual |
Stop the given object from playing all sounds.
Implements MWBase::SoundManager.
|
virtual |
Stop the given audio track from playing.
Implements MWBase::SoundManager.
|
virtual |
Play a soundifle
filename | name of a sound file in "Music/" in the data directory. |
Implements MWBase::SoundManager.
|
private |
|
virtual |
|
virtual |
Implements MWBase::SoundManager.
|
private |
|
private |
|
private |
|
private |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |