OpenMW
|
#include <soundmanagerimp.hpp>
Public Member Functions | |
SoundManager (bool useSound) | |
virtual | ~SoundManager () |
virtual void | processChangedSettings (const Settings::CategorySettingVector &settings) |
virtual void | stopMusic () |
Stops music if it's playing. | |
virtual void | streamMusic (const std::string &filename) |
virtual void | startRandomTitle () |
Starts a random track from the current playlist. | |
virtual bool | isMusicPlaying () |
Returns true if music is playing. | |
virtual void | playPlaylist (const std::string &playlist) |
virtual void | say (const MWWorld::Ptr &reference, const std::string &filename) |
virtual void | say (const std::string &filename) |
virtual bool | sayDone (const MWWorld::Ptr &reference=MWWorld::Ptr()) const |
Is actor not speaking? | |
virtual void | stopSay (const MWWorld::Ptr &reference=MWWorld::Ptr()) |
Stop an actor speaking. | |
virtual MWBase::SoundPtr | playTrack (const DecoderPtr &decoder, PlayType type) |
Play a 2D audio track, using a custom decoder. | |
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::Ptr &reference, const std::string &soundId, float volume, float pitch, PlayType type=Play_TypeSfx, PlayMode mode=Play_Normal, float offset=0) |
virtual void | stopSound3D (const MWWorld::Ptr &reference, const std::string &soundId) |
Stop the given object from playing the given sound,. | |
virtual void | stopSound3D (const MWWorld::Ptr &reference) |
Stop the given object from playing all sounds. | |
virtual void | stopSound (const MWWorld::CellStore *cell) |
Stop all sounds for the given cell. | |
virtual void | stopSound (const std::string &soundId) |
Stop a non-3d looping sound. | |
virtual void | fadeOutSound3D (const MWWorld::Ptr &reference, const std::string &soundId, float duration) |
virtual bool | getSoundPlaying (const MWWorld::Ptr &reference, const std::string &soundId) const |
Is the given sound currently playing on the given object? | |
virtual void | pauseSounds (int types=Play_TypeMask) |
Pauses all currently playing sounds, including music. | |
virtual void | resumeSounds (int types=Play_TypeMask) |
Resumes all previously paused sounds. | |
virtual void | update (float duration) |
virtual void | setListenerPosDir (const Ogre::Vector3 &pos, const Ogre::Vector3 &dir, const Ogre::Vector3 &up) |
Protected Member Functions | |
DecoderPtr | getDecoder () |
Private Types | |
typedef std::pair < MWWorld::Ptr, std::string > | PtrIDPair |
typedef std::map < MWBase::SoundPtr, PtrIDPair > | SoundMap |
Private Member Functions | |
std::string | lookup (const std::string &soundId, float &volume, float &min, float &max) |
void | streamMusicFull (const std::string &filename) |
bool | isPlaying (const MWWorld::Ptr &ptr, const std::string &id) const |
void | updateSounds (float duration) |
void | updateRegionSound (float duration) |
float | volumeFromType (PlayType type) const |
SoundManager (const SoundManager &rhs) | |
SoundManager & | operator= (const SoundManager &rhs) |
Private Attributes | |
Ogre::ResourceGroupManager & | mResourceMgr |
std::auto_ptr< Sound_Output > | mOutput |
float | mMasterVolume |
float | mSFXVolume |
float | mMusicVolume |
float | mVoiceVolume |
float | mFootstepsVolume |
boost::shared_ptr< Sound > | mMusic |
std::string | mCurrentPlaylist |
SoundMap | mActiveSounds |
MWBase::SoundPtr | mUnderwaterSound |
Ogre::Vector3 | mListenerPos |
Ogre::Vector3 | mListenerDir |
Ogre::Vector3 | mListenerUp |
int | mPausedSoundTypes |
Friends | |
class | OpenAL_Output |
typedef std::pair<MWWorld::Ptr,std::string> MWSound::SoundManager::PtrIDPair [private] |
typedef std::map<MWBase::SoundPtr,PtrIDPair> MWSound::SoundManager::SoundMap [private] |
MWSound::SoundManager::SoundManager | ( | const SoundManager & | rhs | ) | [private] |
MWSound::SoundManager::SoundManager | ( | bool | useSound | ) |
MWSound::SoundManager::~SoundManager | ( | ) | [virtual] |
Reimplemented from MWBase::SoundManager.
void MWSound::SoundManager::fadeOutSound3D | ( | const MWWorld::Ptr & | reference, |
const std::string & | soundId, | ||
float | duration | ||
) | [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.
DecoderPtr MWSound::SoundManager::getDecoder | ( | ) | [protected] |
bool MWSound::SoundManager::getSoundPlaying | ( | const MWWorld::Ptr & | reference, |
const std::string & | soundId | ||
) | const [virtual] |
Is the given sound currently playing on the given object?
Implements MWBase::SoundManager.
bool MWSound::SoundManager::isMusicPlaying | ( | ) | [virtual] |
Returns true if music is playing.
Implements MWBase::SoundManager.
bool MWSound::SoundManager::isPlaying | ( | const MWWorld::Ptr & | ptr, |
const std::string & | id | ||
) | const [private] |
std::string MWSound::SoundManager::lookup | ( | const std::string & | soundId, |
float & | volume, | ||
float & | min, | ||
float & | max | ||
) | [private] |
SoundManager& MWSound::SoundManager::operator= | ( | const SoundManager & | rhs | ) | [private] |
void MWSound::SoundManager::pauseSounds | ( | int | types = Play_TypeMask | ) | [virtual] |
Pauses all currently playing sounds, including music.
Implements MWBase::SoundManager.
void MWSound::SoundManager::playPlaylist | ( | const std::string & | playlist | ) | [virtual] |
Start playing music from the selected folder
name | of the folder that contains the playlist |
Implements MWBase::SoundManager.
MWBase::SoundPtr MWSound::SoundManager::playSound | ( | const std::string & | soundId, |
float | volume, | ||
float | pitch, | ||
PlayType | type = Play_TypeSfx , |
||
PlayMode | mode = Play_Normal , |
||
float | offset = 0 |
||
) | [virtual] |
Play a sound, independently of 3D-position
offset | value from [0,1], when to start playback. 0 is beginning, 1 is end. |
Implements MWBase::SoundManager.
MWBase::SoundPtr MWSound::SoundManager::playSound3D | ( | const MWWorld::Ptr & | reference, |
const std::string & | soundId, | ||
float | volume, | ||
float | pitch, | ||
PlayType | type = Play_TypeSfx , |
||
PlayMode | mode = Play_Normal , |
||
float | offset = 0 |
||
) | [virtual] |
Play a sound from an object
offset | value from [0,1], when to start playback. 0 is beginning, 1 is end. |
Implements MWBase::SoundManager.
MWBase::SoundPtr MWSound::SoundManager::playTrack | ( | const DecoderPtr & | decoder, |
PlayType | type | ||
) | [virtual] |
Play a 2D audio track, using a custom decoder.
Implements MWBase::SoundManager.
void MWSound::SoundManager::processChangedSettings | ( | const Settings::CategorySettingVector & | settings | ) | [virtual] |
Implements MWBase::SoundManager.
void MWSound::SoundManager::resumeSounds | ( | int | types = Play_TypeMask | ) | [virtual] |
Resumes all previously paused sounds.
Implements MWBase::SoundManager.
void MWSound::SoundManager::say | ( | const MWWorld::Ptr & | reference, |
const std::string & | filename | ||
) | [virtual] |
Make an actor say some text.
filename | name of a sound file in "Sound/" in the data directory. |
Implements MWBase::SoundManager.
void MWSound::SoundManager::say | ( | const std::string & | filename | ) | [virtual] |
Say some text, without an actor ref
filename | name of a sound file in "Sound/" in the data directory. |
Implements MWBase::SoundManager.
bool MWSound::SoundManager::sayDone | ( | const MWWorld::Ptr & | reference = MWWorld::Ptr() | ) | const [virtual] |
Is actor not speaking?
Implements MWBase::SoundManager.
void MWSound::SoundManager::setListenerPosDir | ( | const Ogre::Vector3 & | pos, |
const Ogre::Vector3 & | dir, | ||
const Ogre::Vector3 & | up | ||
) | [virtual] |
Implements MWBase::SoundManager.
void MWSound::SoundManager::startRandomTitle | ( | ) | [virtual] |
Starts a random track from the current playlist.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopMusic | ( | ) | [virtual] |
Stops music if it's playing.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopSay | ( | const MWWorld::Ptr & | reference = MWWorld::Ptr() | ) | [virtual] |
Stop an actor speaking.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopSound | ( | const MWWorld::CellStore * | cell | ) | [virtual] |
Stop all sounds for the given cell.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopSound | ( | const std::string & | soundId | ) | [virtual] |
Stop a non-3d looping sound.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopSound3D | ( | const MWWorld::Ptr & | reference, |
const std::string & | soundId | ||
) | [virtual] |
Stop the given object from playing the given sound,.
Implements MWBase::SoundManager.
void MWSound::SoundManager::stopSound3D | ( | const MWWorld::Ptr & | reference | ) | [virtual] |
Stop the given object from playing all sounds.
Implements MWBase::SoundManager.
void MWSound::SoundManager::streamMusic | ( | const std::string & | filename | ) | [virtual] |
Play a soundifle
filename | name of a sound file in "Music/" in the data directory. |
Implements MWBase::SoundManager.
void MWSound::SoundManager::streamMusicFull | ( | const std::string & | filename | ) | [private] |
void MWSound::SoundManager::update | ( | float | duration | ) | [virtual] |
Implements MWBase::SoundManager.
void MWSound::SoundManager::updateRegionSound | ( | float | duration | ) | [private] |
void MWSound::SoundManager::updateSounds | ( | float | duration | ) | [private] |
float MWSound::SoundManager::volumeFromType | ( | PlayType | type | ) | const [private] |
friend class OpenAL_Output [friend] |
SoundMap MWSound::SoundManager::mActiveSounds [private] |
std::string MWSound::SoundManager::mCurrentPlaylist [private] |
float MWSound::SoundManager::mFootstepsVolume [private] |
Ogre::Vector3 MWSound::SoundManager::mListenerDir [private] |
Ogre::Vector3 MWSound::SoundManager::mListenerPos [private] |
Ogre::Vector3 MWSound::SoundManager::mListenerUp [private] |
float MWSound::SoundManager::mMasterVolume [private] |
boost::shared_ptr<Sound> MWSound::SoundManager::mMusic [private] |
float MWSound::SoundManager::mMusicVolume [private] |
std::auto_ptr<Sound_Output> MWSound::SoundManager::mOutput [private] |
int MWSound::SoundManager::mPausedSoundTypes [private] |
Ogre::ResourceGroupManager& MWSound::SoundManager::mResourceMgr [private] |
float MWSound::SoundManager::mSFXVolume [private] |
float MWSound::SoundManager::mVoiceVolume [private] |