From 0a8d0fed402aa6c7e6c9421bc3c291f7a864e1d2 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 14 Aug 2010 09:26:00 +0200 Subject: [PATCH] added cell-wide stopSound function --- apps/openmw/mwsound/soundmanager.cpp | 9 +++++++-- apps/openmw/mwsound/soundmanager.hpp | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index 28b4ef6cad..b6f88daa14 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -104,7 +104,7 @@ namespace MWSound // Play the sound and tell it to stream, if possible. mData->mgr->play(filename)->setStreaming(true); } - + void SoundManager::playSound (const std::string& soundId, float volume, float pitch) { } @@ -120,9 +120,14 @@ namespace MWSound { } + void stopSound (MWWorld::Ptr::CellStore *cell) + { + // Note to Nico: You can get the cell of a Ptr via the getCell function. Just iterate over all + // sounds and remove those with matching cell. + } + bool SoundManager::getSoundPlaying (MWWorld::Ptr reference, const std::string& soundId) const { return false; } } - diff --git a/apps/openmw/mwsound/soundmanager.hpp b/apps/openmw/mwsound/soundmanager.hpp index 2cefbd24fa..9ea86fea87 100644 --- a/apps/openmw/mwsound/soundmanager.hpp +++ b/apps/openmw/mwsound/soundmanager.hpp @@ -47,6 +47,9 @@ namespace MWSound ///< Stop the given object from playing the given sound, If no soundId is given, /// all sounds for this reference will stop. + void stopSound (MWWorld::Ptr::CellStore *cell); + ///< Stop all sounds for the given cell. + bool getSoundPlaying (MWWorld::Ptr reference, const std::string& soundId) const; ///< Is the given sound currently playing on the given object? };