]> git.mxchange.org Git - flightgear.git/commitdiff
Make FGVoicePlayer.hxx not require sample_openal.hxx
authorJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 19:23:13 +0000 (20:23 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 19:23:13 +0000 (20:23 +0100)
src/Sound/voiceplayer.cxx
src/Sound/voiceplayer.hxx

index 365be7a9519e166f7ab9b46146bdf079279fa0b7..de178b70e7fdf04e8c1a13444fc7598ea99fe07e 100644 (file)
@@ -61,6 +61,30 @@ using std::vector;
 
 #define test_bits(_bits, _test) (((_bits) & (_test)) != 0)
 
+/////////////////////////////////////////////////////////////////////////
+// FGVoicePlayer::Voice::SampleElement ///////////////////////////
+/////////////////////////////////////////////////////////////////////////
+
+void FGVoicePlayer::Voice::SampleElement::play (float volume)
+{
+  if (_sample && (volume > 0.05)) { set_volume(volume); _sample->play_once(); }
+}
+
+void FGVoicePlayer::Voice::SampleElement::stop ()
+{
+  if (_sample) _sample->stop();
+}
+
+bool FGVoicePlayer::Voice::SampleElement::is_playing ()
+{
+  return _sample ? _sample->is_playing() : false;
+}
+
+void FGVoicePlayer::Voice::SampleElement::set_volume (float volume)
+{
+  if (_sample) _sample->set_volume(volume * _volume);
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 // FGVoicePlayer //////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
index 92ed2502f177d1c7a3af349f2187babd06b9471c..be5e7765b00f73aeab8f0cde0991e4819aa2e5ed 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,13 @@ public:
         float               _volume;
 
     public:
-        inline SampleElement (SGSharedPtr<SGSoundSample> sample, float volume = 1.0)
+        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); }
+        virtual void play (float volume);
+        virtual void stop ();
+        virtual bool is_playing ();
+        virtual void set_volume (float volume);
     };
 
     /////////////////////////////////////////////////////////////////////////