Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-02-25 22:24:25 +0000
committerStijn Buys <ingar@osirion.org>2010-02-25 22:24:25 +0000
commit11a5ebe38a83383970425baf53d4595ae56efe70 (patch)
tree99c59f3cd07c829122c2673563a8e32388aefdd5 /src/client/soundext.h
parent90fbc4c5caf5afd54920894319448b74967399ba (diff)
looped sound support for fx_sound model tags
Diffstat (limited to 'src/client/soundext.h')
-rw-r--r--src/client/soundext.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/client/soundext.h b/src/client/soundext.h
index b0fc17a..9991b69 100644
--- a/src/client/soundext.h
+++ b/src/client/soundext.h
@@ -10,6 +10,9 @@
#include "core/extension.h"
#include "core/cvar.h"
+#include <list>
+#include <string>
+
namespace client
{
@@ -17,6 +20,47 @@ extern core::Cvar *snd_engines;
extern core::Cvar *snd_doppler;
extern core::Cvar *snd_volume;
+/// a sound playing
+class Sound {
+public:
+ Sound();
+ Sound(const std::string & name);
+
+ inline size_t buffer() const {
+ return sound_buffer;
+ }
+
+ inline size_t source() const {
+ return sound_source;
+ }
+
+ inline math::Vector3f const & location() {
+ return sound_location;
+ }
+
+ inline math::Vector3f & get_location() {
+ return sound_location;
+ }
+
+ inline void set_location(const math::Vector3f & location) {
+ sound_location.assign(location);
+ }
+
+ inline void set_source(size_t source) {
+ sound_source = source;
+ }
+
+ inline void set_buffer(size_t buffer) {
+ sound_buffer = buffer;
+ }
+
+private:
+ size_t sound_buffer;
+ size_t sound_source;
+
+ math::Vector3f sound_location;
+};
+
/// the sound extension of an entity
class SoundExt : public core::Extension
{
@@ -26,7 +70,9 @@ public:
virtual void frame(float elapsed);
+ typedef std::list<client::Sound *> Sounds;
private:
+
void clear();
/// index of the audio buffer containing the thruster sound loop
@@ -46,6 +92,8 @@ private:
size_t state_engineeventbuffer;
/// index of the audio source used to play engine sound events
size_t state_engineeventsource;
+
+ Sounds state_soundlist;
};
/// render listener sound