1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwsound/soundmanager.hpp

68 lines
2.1 KiB
C++
Raw Normal View History

#ifndef GAME_SOUND_SOUNDMANAGER_H
#define GAME_SOUND_SOUNDMANAGER_H
#include <string>
#include <map>
#include "../mwworld/ptr.hpp"
namespace Ogre
{
class Root;
class Camera;
}
namespace ESMS
{
struct ESMStore;
}
namespace MWSound
{
class SoundManager
{
// Hide implementation details - engine.cpp is compiling
// enough as it is.
struct SoundImpl;
SoundImpl *mData;
2010-08-14 05:54:51 +00:00
public:
SoundManager(Ogre::Root*, Ogre::Camera*, const ESMS::ESMStore &store,
2010-08-18 09:16:15 +00:00
const std::string &soundDir, bool useSound);
~SoundManager();
2010-08-14 05:54:51 +00:00
2010-08-12 15:58:29 +00:00
void say (MWWorld::Ptr reference, const std::string& filename);
///< Make an actor say some text.
/// \param filename name of a sound file in "Sound/Vo/" in the data directory.
2010-08-14 05:54:51 +00:00
bool sayDone (MWWorld::Ptr reference) const;
///< Is actor not speaking?
void streamMusic (const std::string& filename);
///< Play a soundifle
/// \param filename name of a sound file in "Music/" in the data directory.
2010-08-14 05:54:51 +00:00
void playSound (const std::string& soundId, float volume, float pitch);
///< Play a sound, independently of 3D-position
2010-08-14 05:54:51 +00:00
void playSound3D (MWWorld::Ptr reference, const std::string& soundId,
float volume, float pitch, bool loop);
///< Play a sound from an object
2010-08-14 05:54:51 +00:00
void stopSound3D (MWWorld::Ptr reference, const std::string& soundId = "");
///< Stop the given object from playing the given sound, If no soundId is given,
/// all sounds for this reference will stop.
2010-08-14 07:26:00 +00:00
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?
void updateObject(MWWorld::Ptr reference);
///< Update the position of all sounds connected to the given object.
};
}
#endif