]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/voiceplayer.hxx
Revive master sound enable switch.
[flightgear.git] / src / Sound / voiceplayer.hxx
index 92ed2502f177d1c7a3af349f2187babd06b9471c..90e3cbac9b04bb3a39e3ce9224f1904cfae8558f 100644 (file)
@@ -30,9 +30,9 @@
 
 #include <simgear/props/props.hxx>
 #include <simgear/props/tiedpropertylist.hxx>
-#include <simgear/sound/sample_openal.hxx>
 
 class SGSampleGroup;
+class SGSoundSample;
 
 #include <Main/globals.hxx>
 
@@ -149,13 +149,12 @@ public:
         float               _volume;
 
     public:
-        inline SampleElement (SGSharedPtr<SGSoundSample> sample, float volume = 1.0)
-          : _sample(sample), _volume(volume) { silence = false; }
-
-        virtual inline void play (float volume) { if (_sample && (volume > 0.05)) { set_volume(volume); _sample->play_once(); } }
-        virtual inline void stop () { if (_sample) _sample->stop(); }
-        virtual inline bool is_playing () { return _sample ? _sample->is_playing() : false; }
-        virtual inline void set_volume (float volume) { if (_sample) _sample->set_volume(volume * _volume); }
+        SampleElement (SGSharedPtr<SGSoundSample> sample, float volume = 1.0);
+      
+        virtual void play (float volume);
+        virtual void stop ();
+        virtual bool is_playing ();
+        virtual void set_volume (float volume);
     };
 
     /////////////////////////////////////////////////////////////////////////
@@ -311,7 +310,7 @@ protected:
   SGSoundSample *get_sample (const char *name);
 
   inline void append (Voice *voice, Voice::Element *element) { voice->append(element); }
-  inline void append (Voice *voice, const char *sample_name) { voice->append(new Voice::SampleElement(get_sample(sample_name))); }
+  void append (Voice *voice, const char *sample_name);
   inline void append (Voice *voice, double silence) { voice->append(new Voice::SilenceElement(silence)); }
 
   inline void make_voice (Voice **voice) { *voice = new Voice(this); _voices.push_back(*voice); }