2010-07-03 13:04:00 +00:00
|
|
|
#ifndef GAME_SOUND_SOUNDMANAGER_H
|
|
|
|
#define GAME_SOUND_SOUNDMANAGER_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
2010-07-03 15:59:30 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2010-08-12 14:13:54 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Root;
|
|
|
|
class Camera;
|
|
|
|
}
|
|
|
|
|
2010-07-03 13:04:00 +00:00
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class SoundManager
|
|
|
|
{
|
2010-08-12 14:13:54 +00:00
|
|
|
// Hide implementation details - engine.cpp is compiling
|
|
|
|
// enough as it is.
|
|
|
|
struct SoundImpl;
|
|
|
|
SoundImpl *mData;
|
2010-07-03 13:04:00 +00:00
|
|
|
|
|
|
|
public:
|
2010-08-12 14:13:54 +00:00
|
|
|
SoundManager(Ogre::Root*, Ogre::Camera*);
|
|
|
|
~SoundManager();
|
2010-07-03 13:04:00 +00:00
|
|
|
|
2010-08-12 15:58:29 +00:00
|
|
|
void say (MWWorld::Ptr reference, const std::string& filename);
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Make an actor say some text.
|
|
|
|
/// \param filename name of a sound file in "Sound/Vo/" in the data directory.
|
|
|
|
|
2010-08-12 14:29:22 +00:00
|
|
|
bool sayDone (MWWorld::Ptr reference) const;
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Is actor not speaking?
|
|
|
|
|
2010-08-12 14:29:22 +00:00
|
|
|
void streamMusic (const std::string& filename);
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Play a soundifle
|
|
|
|
/// \param filename name of a sound file in "Music/" in the data directory.
|
|
|
|
|
2010-08-12 14:29:22 +00:00
|
|
|
void playSound (const std::string& soundId, float volume, float pitch);
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Play a sound, independently of 3D-position
|
|
|
|
|
2010-07-03 15:59:30 +00:00
|
|
|
void playSound3D (MWWorld::Ptr reference, const std::string& soundId,
|
2010-08-12 14:29:22 +00:00
|
|
|
float volume, float pitch, bool loop);
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Play a sound from an object
|
|
|
|
|
2010-08-12 14:29:22 +00:00
|
|
|
void stopSound3D (MWWorld::Ptr reference, const std::string& soundId);
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Stop the given object from playing the given sound.
|
|
|
|
|
2010-08-12 14:29:22 +00:00
|
|
|
bool getSoundPlaying (MWWorld::Ptr reference, const std::string& soundId) const;
|
2010-07-03 13:04:00 +00:00
|
|
|
///< Is the given sound currently playing on the given object?
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|