27#include <simgear/compiler.h>
28#include <simgear/props/props.hxx>
29#include <simgear/io/sg_socket.hxx>
30#include <simgear/structure/subsystem_mgr.hxx>
34#if defined(ENABLE_THREADS)
35# include <OpenThreads/Thread>
36# include <OpenThreads/Mutex>
37# include <OpenThreads/ScopedLock>
38# include <OpenThreads/Condition>
39# include <simgear/threads/SGQueue.hxx>
54 void update(
double dt)
override;
64#if defined(ENABLE_THREADS)
66 FGVoiceThread *_thread;
79#if defined(ENABLE_THREADS)
80class FGVoiceMgr::FGVoiceThread :
public OpenThreads::Thread
85 void wake_up() { _jobs.signal(); }
88 void wait_for_jobs() { OpenThreads::ScopedLock<OpenThreads::Mutex>
g(_mutex); _jobs.wait(&_mutex); }
89 OpenThreads::Condition _jobs;
90 OpenThreads::Mutex _mutex;
103 virtual void speak(
const std::string & msg ) = 0;
113#if defined(ENABLE_THREADS)
114 SGLockedQueue<std::string>
_msg;
std::queue< std::string > _msg
virtual void update(double dt)=0
void pushMessage(const std::string &m)
virtual void speak(const std::string &msg)=0
void valueChanged(SGPropertyNode *node)
THREAD ///.
static const char * staticSubsystemClassId()
friend class FGFestivalVoice
void update(double dt) override
std::vector< FGVoice * > _voices
SGPropertyNode_ptr _pausedNode