OpenMW
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
MWSound::SoundManager Class Reference

#include <soundmanagerimp.hpp>

List of all members.

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)
SoundManageroperator= (const SoundManager &rhs)

Private Attributes

Ogre::ResourceGroupManager & mResourceMgr
std::auto_ptr< Sound_OutputmOutput
float mMasterVolume
float mSFXVolume
float mMusicVolume
float mVoiceVolume
float mFootstepsVolume
boost::shared_ptr< SoundmMusic
std::string mCurrentPlaylist
SoundMap mActiveSounds
MWBase::SoundPtr mUnderwaterSound
Ogre::Vector3 mListenerPos
Ogre::Vector3 mListenerDir
Ogre::Vector3 mListenerUp
int mPausedSoundTypes

Friends

class OpenAL_Output

Member Typedef Documentation

typedef std::pair<MWWorld::Ptr,std::string> MWSound::SoundManager::PtrIDPair [private]

Constructor & Destructor Documentation

Reimplemented from MWBase::SoundManager.


Member Function Documentation

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

Parameters:
referenceReference to object, whose sound is faded out
soundIdID of the sound to fade out.
durationTime until volume reaches 0.

Implements MWBase::SoundManager.

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.

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

Parameters:
nameof 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

Parameters:
offsetvalue 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

Parameters:
offsetvalue 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.

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.

Parameters:
filenamename 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

Parameters:
filenamename 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.

Starts a random track from the current playlist.

Implements MWBase::SoundManager.

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

Parameters:
filenamename 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]

Friends And Related Function Documentation

friend class OpenAL_Output [friend]

Member Data Documentation

Ogre::Vector3 MWSound::SoundManager::mListenerDir [private]
Ogre::Vector3 MWSound::SoundManager::mListenerPos [private]
Ogre::Vector3 MWSound::SoundManager::mListenerUp [private]
boost::shared_ptr<Sound> MWSound::SoundManager::mMusic [private]
std::auto_ptr<Sound_Output> MWSound::SoundManager::mOutput [private]
Ogre::ResourceGroupManager& MWSound::SoundManager::mResourceMgr [private]

The documentation for this class was generated from the following files: