]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/voice.hxx
Interim windows build fix
[flightgear.git] / src / Sound / voice.hxx
index 39dae579ac1cac98f792c2416e92729923468f86..eabd00a40da43d41dd9bc1d98c41c3265013873a 100644 (file)
@@ -44,7 +44,6 @@
 #  include <simgear/threads/SGQueue.hxx>
 #else
 #  include <queue>
-   using std::queue;
 #endif // ENABLE_THREADS
 
 using std::vector;
@@ -56,22 +55,24 @@ public:
        FGVoiceMgr();
        ~FGVoiceMgr();
        void init(void);
+       void shutdown();
        void update(double dt);
 
-private:
-       class FGVoice;
 
+  class FGVoice;
+protected:
+  friend class FGFestivalVoice;
 #if defined(ENABLE_THREADS)
        class FGVoiceThread;
        FGVoiceThread *_thread;
 #endif
 
-       string _host;
-       string _port;
+  std::string _host;
+  std::string _port;
        bool _enabled;
        SGPropertyNode_ptr _pausedNode;
        bool _paused;
-       vector<FGVoice *> _voices;
+  std::vector<FGVoice *> _voices;
 };
 
 
@@ -87,53 +88,33 @@ private:
        void wait_for_jobs() { OpenThreads::ScopedLock<OpenThreads::Mutex> g(_mutex); _jobs.wait(&_mutex); }
        OpenThreads::Condition _jobs;
        OpenThreads::Mutex _mutex;
+protected:
        FGVoiceMgr *_mgr;
 };
 #endif
 
 
-
-class FGVoiceMgr::FGVoice {
+class FGVoiceMgr::FGVoice : public SGPropertyChangeListener {
 public:
-       FGVoice(FGVoiceMgr *, const SGPropertyNode_ptr);
-       ~FGVoice();
-       bool speak();
-       void update();
-       void setVolume(double);
-       void setPitch(double);
-       void setSpeed(double);
-       void pushMessage(string);
+  FGVoice(FGVoiceMgr * mgr ) : _mgr(mgr) {}
+  virtual ~FGVoice() {}
+  virtual void speak( const std::string & msg ) = 0;
+  virtual void update() = 0;
+  void pushMessage( const std::string & m);
+  bool speak();
 
-private:
-       class FGVoiceListener;
-       SGSocket *_sock;
-       double _volume;
-       double _pitch;
-       double _speed;
-       SGPropertyNode_ptr _volumeNode;
-       SGPropertyNode_ptr _pitchNode;
-       SGPropertyNode_ptr _speedNode;
-       bool _festival;
-       FGVoiceMgr *_mgr;
+protected:
+  void valueChanged(SGPropertyNode *node);
 
-#if defined(ENABLE_THREADS)
-       SGLockedQueue<string> _msg;
+  FGVoiceMgr *_mgr;
+
+  #if defined(ENABLE_THREADS)
+  SGLockedQueue<std::string> _msg;
 #else
-       queue<string> _msg;
+  std::queue<std::string> _msg;
 #endif
 
-};
 
-
-
-class FGVoiceMgr::FGVoice::FGVoiceListener : public SGPropertyChangeListener {
-public:
-       FGVoiceListener(FGVoice *voice) : _voice(voice) {}
-       void valueChanged(SGPropertyNode *node);
-
-private:
-       FGVoice *_voice;
 };
 
-
 #endif // _VOICE_HXX