]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/voice.hxx
httpd: update mongoose and websockets
[flightgear.git] / src / Sound / voice.hxx
index b059df179bfae43242289f9a8a321ba1d5adc65a..4bde11d1e931507ec43705dd60c2c3ee1d9ac052 100644 (file)
 #include <Main/fg_props.hxx>
 
 #if defined(ENABLE_THREADS)
-#  include <simgear/threads/SGThread.hxx>
+#  include <OpenThreads/Thread>
+#  include <OpenThreads/Mutex>
+#  include <OpenThreads/ScopedLock>
+#  include <OpenThreads/Condition>
 #  include <simgear/threads/SGQueue.hxx>
 #else
 #  include <queue>
-   SG_USING_STD(queue);
 #endif // ENABLE_THREADS
 
-SG_USING_STD(vector);
+using std::vector;
 
 
 
@@ -63,27 +65,27 @@ private:
        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;
 };
 
 
 
 #if defined(ENABLE_THREADS)
-class FGVoiceMgr::FGVoiceThread : public SGThread {
+class FGVoiceMgr::FGVoiceThread : public OpenThreads::Thread {
 public:
        FGVoiceThread(FGVoiceMgr *mgr) : _mgr(mgr) {}
        void run();
        void wake_up() { _jobs.signal(); }
 
 private:
-       void wait_for_jobs() { SGGuard<SGMutex> g(_mutex); _jobs.wait(_mutex); }
-       SGPthreadCond _jobs;
-       SGMutex _mutex;
+       void wait_for_jobs() { OpenThreads::ScopedLock<OpenThreads::Mutex> g(_mutex); _jobs.wait(&_mutex); }
+       OpenThreads::Condition _jobs;
+       OpenThreads::Mutex _mutex;
        FGVoiceMgr *_mgr;
 };
 #endif
@@ -99,7 +101,7 @@ public:
        void setVolume(double);
        void setPitch(double);
        void setSpeed(double);
-       void pushMessage(string);
+       void pushMessage(std::string);
 
 private:
        class FGVoiceListener;
@@ -114,9 +116,9 @@ private:
        FGVoiceMgr *_mgr;
 
 #if defined(ENABLE_THREADS)
-       SGLockedQueue<string> _msg;
+       SGLockedQueue<std::string> _msg;
 #else
-       queue<string> _msg;
+  std::queue<std::string> _msg;
 #endif
 
 };