mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
Use const references where appropriate
This commit is contained in:
parent
8361192b64
commit
8a073c113e
3 changed files with 23 additions and 25 deletions
|
@ -84,7 +84,7 @@ namespace MWBase
|
||||||
///< Start playing music from the selected folder
|
///< Start playing music from the selected folder
|
||||||
/// \param name of the folder that contains the playlist
|
/// \param name of the folder that contains the playlist
|
||||||
|
|
||||||
virtual void say(MWWorld::Ptr reference, const std::string& filename) = 0;
|
virtual void say(const MWWorld::Ptr &reference, const std::string& filename) = 0;
|
||||||
///< Make an actor say some text.
|
///< Make an actor say some text.
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
|
||||||
|
@ -92,10 +92,10 @@ namespace MWBase
|
||||||
///< Say some text, without an actor ref
|
///< Say some text, without an actor ref
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
|
||||||
virtual bool sayDone(MWWorld::Ptr reference=MWWorld::Ptr()) const = 0;
|
virtual bool sayDone(const MWWorld::Ptr &reference=MWWorld::Ptr()) const = 0;
|
||||||
///< Is actor not speaking?
|
///< Is actor not speaking?
|
||||||
|
|
||||||
virtual void stopSay(MWWorld::Ptr reference=MWWorld::Ptr()) = 0;
|
virtual void stopSay(const MWWorld::Ptr &reference=MWWorld::Ptr()) = 0;
|
||||||
///< Stop an actor speaking
|
///< Stop an actor speaking
|
||||||
|
|
||||||
virtual SoundPtr playTrack(const MWSound::DecoderPtr& decoder, PlayType type) = 0;
|
virtual SoundPtr playTrack(const MWSound::DecoderPtr& decoder, PlayType type) = 0;
|
||||||
|
@ -105,14 +105,14 @@ namespace MWBase
|
||||||
PlayMode mode=Play_Normal) = 0;
|
PlayMode mode=Play_Normal) = 0;
|
||||||
///< Play a sound, independently of 3D-position
|
///< Play a sound, independently of 3D-position
|
||||||
|
|
||||||
virtual SoundPtr playSound3D(MWWorld::Ptr reference, const std::string& soundId,
|
virtual SoundPtr playSound3D(const MWWorld::Ptr &reference, const std::string& soundId,
|
||||||
float volume, float pitch, PlayMode mode=Play_Normal) = 0;
|
float volume, float pitch, PlayMode mode=Play_Normal) = 0;
|
||||||
///< Play a sound from an object
|
///< Play a sound from an object
|
||||||
|
|
||||||
virtual void stopSound3D(MWWorld::Ptr reference, const std::string& soundId) = 0;
|
virtual void stopSound3D(const MWWorld::Ptr &reference, const std::string& soundId) = 0;
|
||||||
///< Stop the given object from playing the given sound,
|
///< Stop the given object from playing the given sound,
|
||||||
|
|
||||||
virtual void stopSound3D(MWWorld::Ptr reference) = 0;
|
virtual void stopSound3D(const MWWorld::Ptr &reference) = 0;
|
||||||
///< Stop the given object from playing all sounds.
|
///< Stop the given object from playing all sounds.
|
||||||
|
|
||||||
virtual void stopSound(const MWWorld::CellStore *cell) = 0;
|
virtual void stopSound(const MWWorld::CellStore *cell) = 0;
|
||||||
|
@ -121,7 +121,7 @@ namespace MWBase
|
||||||
virtual void stopSound(const std::string& soundId) = 0;
|
virtual void stopSound(const std::string& soundId) = 0;
|
||||||
///< Stop a non-3d looping sound
|
///< Stop a non-3d looping sound
|
||||||
|
|
||||||
virtual bool getSoundPlaying(MWWorld::Ptr reference, const std::string& soundId) const = 0;
|
virtual bool getSoundPlaying(const MWWorld::Ptr &reference, const std::string& soundId) const = 0;
|
||||||
///< Is the given sound currently playing on the given object?
|
///< Is the given sound currently playing on the given object?
|
||||||
|
|
||||||
virtual void pauseSounds(int types=Play_TypeMask) = 0;
|
virtual void pauseSounds(int types=Play_TypeMask) = 0;
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace MWSound
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundManager::isPlaying(MWWorld::Ptr ptr, const std::string &id) const
|
bool SoundManager::isPlaying(const MWWorld::Ptr &ptr, const std::string &id) const
|
||||||
{
|
{
|
||||||
SoundMap::const_iterator snditer = mActiveSounds.begin();
|
SoundMap::const_iterator snditer = mActiveSounds.begin();
|
||||||
while(snditer != mActiveSounds.end())
|
while(snditer != mActiveSounds.end())
|
||||||
|
@ -229,7 +229,7 @@ namespace MWSound
|
||||||
startRandomTitle();
|
startRandomTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::say(MWWorld::Ptr ptr, const std::string& filename)
|
void SoundManager::say(const MWWorld::Ptr &ptr, const std::string& filename)
|
||||||
{
|
{
|
||||||
if(!mOutput->isInitialized())
|
if(!mOutput->isInitialized())
|
||||||
return;
|
return;
|
||||||
|
@ -269,12 +269,12 @@ namespace MWSound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundManager::sayDone(MWWorld::Ptr ptr) const
|
bool SoundManager::sayDone(const MWWorld::Ptr &ptr) const
|
||||||
{
|
{
|
||||||
return !isPlaying(ptr, "_say_sound");
|
return !isPlaying(ptr, "_say_sound");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::stopSay(MWWorld::Ptr ptr)
|
void SoundManager::stopSay(const MWWorld::Ptr &ptr)
|
||||||
{
|
{
|
||||||
SoundMap::iterator snditer = mActiveSounds.begin();
|
SoundMap::iterator snditer = mActiveSounds.begin();
|
||||||
while(snditer != mActiveSounds.end())
|
while(snditer != mActiveSounds.end())
|
||||||
|
@ -328,7 +328,7 @@ namespace MWSound
|
||||||
return sound;
|
return sound;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWBase::SoundPtr SoundManager::playSound3D(MWWorld::Ptr ptr, const std::string& soundId,
|
MWBase::SoundPtr SoundManager::playSound3D(const MWWorld::Ptr &ptr, const std::string& soundId,
|
||||||
float volume, float pitch, PlayMode mode)
|
float volume, float pitch, PlayMode mode)
|
||||||
{
|
{
|
||||||
MWBase::SoundPtr sound;
|
MWBase::SoundPtr sound;
|
||||||
|
@ -356,7 +356,7 @@ namespace MWSound
|
||||||
return sound;
|
return sound;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::stopSound3D(MWWorld::Ptr ptr, const std::string& soundId)
|
void SoundManager::stopSound3D(const MWWorld::Ptr &ptr, const std::string& soundId)
|
||||||
{
|
{
|
||||||
SoundMap::iterator snditer = mActiveSounds.begin();
|
SoundMap::iterator snditer = mActiveSounds.begin();
|
||||||
while(snditer != mActiveSounds.end())
|
while(snditer != mActiveSounds.end())
|
||||||
|
@ -371,7 +371,7 @@ namespace MWSound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::stopSound3D(MWWorld::Ptr ptr)
|
void SoundManager::stopSound3D(const MWWorld::Ptr &ptr)
|
||||||
{
|
{
|
||||||
SoundMap::iterator snditer = mActiveSounds.begin();
|
SoundMap::iterator snditer = mActiveSounds.begin();
|
||||||
while(snditer != mActiveSounds.end())
|
while(snditer != mActiveSounds.end())
|
||||||
|
@ -418,7 +418,7 @@ namespace MWSound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundManager::getSoundPlaying(MWWorld::Ptr ptr, const std::string& soundId) const
|
bool SoundManager::getSoundPlaying(const MWWorld::Ptr &ptr, const std::string& soundId) const
|
||||||
{
|
{
|
||||||
return isPlaying(ptr, soundId);
|
return isPlaying(ptr, soundId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
|
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MWSound
|
namespace MWSound
|
||||||
{
|
{
|
||||||
class Sound_Output;
|
class Sound_Output;
|
||||||
|
@ -57,7 +55,7 @@ namespace MWSound
|
||||||
std::string lookup(const std::string &soundId,
|
std::string lookup(const std::string &soundId,
|
||||||
float &volume, float &min, float &max);
|
float &volume, float &min, float &max);
|
||||||
void streamMusicFull(const std::string& filename);
|
void streamMusicFull(const std::string& filename);
|
||||||
bool isPlaying(MWWorld::Ptr ptr, const std::string &id) const;
|
bool isPlaying(const MWWorld::Ptr &ptr, const std::string &id) const;
|
||||||
void updateSounds(float duration);
|
void updateSounds(float duration);
|
||||||
void updateRegionSound(float duration);
|
void updateRegionSound(float duration);
|
||||||
|
|
||||||
|
@ -93,7 +91,7 @@ namespace MWSound
|
||||||
///< Start playing music from the selected folder
|
///< Start playing music from the selected folder
|
||||||
/// \param name of the folder that contains the playlist
|
/// \param name of the folder that contains the playlist
|
||||||
|
|
||||||
virtual void say(MWWorld::Ptr reference, const std::string& filename);
|
virtual void say(const MWWorld::Ptr &reference, const std::string& filename);
|
||||||
///< Make an actor say some text.
|
///< Make an actor say some text.
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
|
||||||
|
@ -101,10 +99,10 @@ namespace MWSound
|
||||||
///< Say some text, without an actor ref
|
///< Say some text, without an actor ref
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
|
||||||
virtual bool sayDone(MWWorld::Ptr reference=MWWorld::Ptr()) const;
|
virtual bool sayDone(const MWWorld::Ptr &reference=MWWorld::Ptr()) const;
|
||||||
///< Is actor not speaking?
|
///< Is actor not speaking?
|
||||||
|
|
||||||
virtual void stopSay(MWWorld::Ptr reference=MWWorld::Ptr());
|
virtual void stopSay(const MWWorld::Ptr &reference=MWWorld::Ptr());
|
||||||
///< Stop an actor speaking
|
///< Stop an actor speaking
|
||||||
|
|
||||||
virtual MWBase::SoundPtr playTrack(const DecoderPtr& decoder, PlayType type);
|
virtual MWBase::SoundPtr playTrack(const DecoderPtr& decoder, PlayType type);
|
||||||
|
@ -113,14 +111,14 @@ namespace MWSound
|
||||||
virtual MWBase::SoundPtr playSound(const std::string& soundId, float volume, float pitch, PlayMode mode=Play_Normal);
|
virtual MWBase::SoundPtr playSound(const std::string& soundId, float volume, float pitch, PlayMode mode=Play_Normal);
|
||||||
///< Play a sound, independently of 3D-position
|
///< Play a sound, independently of 3D-position
|
||||||
|
|
||||||
virtual MWBase::SoundPtr playSound3D(MWWorld::Ptr reference, const std::string& soundId,
|
virtual MWBase::SoundPtr playSound3D(const MWWorld::Ptr &reference, const std::string& soundId,
|
||||||
float volume, float pitch, PlayMode mode=Play_Normal);
|
float volume, float pitch, PlayMode mode=Play_Normal);
|
||||||
///< Play a sound from an object
|
///< Play a sound from an object
|
||||||
|
|
||||||
virtual void stopSound3D(MWWorld::Ptr reference, const std::string& soundId);
|
virtual void stopSound3D(const MWWorld::Ptr &reference, const std::string& soundId);
|
||||||
///< Stop the given object from playing the given sound,
|
///< Stop the given object from playing the given sound,
|
||||||
|
|
||||||
virtual void stopSound3D(MWWorld::Ptr reference);
|
virtual void stopSound3D(const MWWorld::Ptr &reference);
|
||||||
///< Stop the given object from playing all sounds.
|
///< Stop the given object from playing all sounds.
|
||||||
|
|
||||||
virtual void stopSound(const MWWorld::CellStore *cell);
|
virtual void stopSound(const MWWorld::CellStore *cell);
|
||||||
|
@ -129,7 +127,7 @@ namespace MWSound
|
||||||
virtual void stopSound(const std::string& soundId);
|
virtual void stopSound(const std::string& soundId);
|
||||||
///< Stop a non-3d looping sound
|
///< Stop a non-3d looping sound
|
||||||
|
|
||||||
virtual bool getSoundPlaying(MWWorld::Ptr reference, const std::string& soundId) const;
|
virtual bool getSoundPlaying(const MWWorld::Ptr &reference, const std::string& soundId) const;
|
||||||
///< Is the given sound currently playing on the given object?
|
///< Is the given sound currently playing on the given object?
|
||||||
|
|
||||||
virtual void pauseSounds(int types=Play_TypeMask);
|
virtual void pauseSounds(int types=Play_TypeMask);
|
||||||
|
|
Loading…
Reference in a new issue