mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 21:45:35 +00:00
Merge pull request #2941 from elsid/lookup_stop_sound
Lookup sound when need to stop
This commit is contained in:
commit
3d7f8a573a
3 changed files with 1 additions and 18 deletions
|
@ -163,9 +163,6 @@ namespace MWBase
|
|||
virtual void stopSound(const MWWorld::CellStore *cell) = 0;
|
||||
///< Stop all sounds for the given cell.
|
||||
|
||||
virtual void stopSound(const std::string& soundId) = 0;
|
||||
///< Stop a non-3d looping sound
|
||||
|
||||
virtual void fadeOutSound3D(const MWWorld::ConstPtr &reference, const std::string& soundId, float duration) = 0;
|
||||
///< Fade out given sound (that is already playing) of given object
|
||||
///< @param reference Reference to object, whose sound is faded out
|
||||
|
|
|
@ -767,23 +767,12 @@ namespace MWSound
|
|||
}
|
||||
}
|
||||
|
||||
void SoundManager::stopSound(const std::string& soundId)
|
||||
{
|
||||
if(!mOutput->isInitialized())
|
||||
return;
|
||||
|
||||
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
|
||||
if (!sfx) return;
|
||||
|
||||
stopSound(sfx, MWWorld::ConstPtr());
|
||||
}
|
||||
|
||||
void SoundManager::stopSound3D(const MWWorld::ConstPtr &ptr, const std::string& soundId)
|
||||
{
|
||||
if(!mOutput->isInitialized())
|
||||
return;
|
||||
|
||||
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
|
||||
Sound_Buffer *sfx = lookupSound(Misc::StringUtils::lowerCase(soundId));
|
||||
if (!sfx) return;
|
||||
|
||||
stopSound(sfx, ptr);
|
||||
|
|
|
@ -237,9 +237,6 @@ namespace MWSound
|
|||
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::ConstPtr &reference, const std::string& soundId, float duration);
|
||||
///< Fade out given sound (that is already playing) of given object
|
||||
///< @param reference Reference to object, whose sound is faded out
|
||||
|
|
Loading…
Reference in a new issue