X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSound%2Fvoice.hxx;h=4bde11d1e931507ec43705dd60c2c3ee1d9ac052;hb=7132947d167d15b7a5ff8ae196207aeadb538232;hp=ae899476e31b6e92b6a0e03e8136833b0d0e37b4;hpb=1f6e343a7bbe3af57f81cde3c4eabc50186530d3;p=flightgear.git diff --git a/src/Sound/voice.hxx b/src/Sound/voice.hxx index ae899476e..4bde11d1e 100644 --- a/src/Sound/voice.hxx +++ b/src/Sound/voice.hxx @@ -37,14 +37,16 @@ #include
#if defined(ENABLE_THREADS) -# include +# include +# include +# include +# include # include #else # include - 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 _voices; + std::vector _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 g(_mutex); _jobs.wait(_mutex); } - SGPthreadCond _jobs; - SGMutex _mutex; + void wait_for_jobs() { OpenThreads::ScopedLock g(_mutex); _jobs.wait(&_mutex); } + OpenThreads::Condition _jobs; + OpenThreads::Mutex _mutex; FGVoiceMgr *_mgr; }; #endif @@ -99,12 +101,11 @@ public: void setVolume(double); void setPitch(double); void setSpeed(double); - void pushMessage(string); + void pushMessage(std::string); private: class FGVoiceListener; SGSocket *_sock; - bool _connected; double _volume; double _pitch; double _speed; @@ -115,9 +116,9 @@ private: FGVoiceMgr *_mgr; #if defined(ENABLE_THREADS) - SGLockedQueue _msg; + SGLockedQueue _msg; #else - queue _msg; + std::queue _msg; #endif };