diff --git a/SGSXLApp.cpp b/SGSXLApp.cpp index 92c666f..5729bd5 100644 --- a/SGSXLApp.cpp +++ b/SGSXLApp.cpp @@ -96,10 +96,14 @@ bool CSGSXLApp::createThread() std::string CallSign, address; config.getGateway(CallSign, address); - CallSign.resize(7, ' '); CallSign.push_back('G'); + bool audioEnabled; + TEXT_LANG audioLang; + config.getAudio(audioEnabled, audioLang); + m_thread->setLanguage(audioEnabled, audioLang); + printf("Gateway callsign set to %s, local address set to %s\n", CallSign.c_str(), address.c_str()); CIRCDDB_Array clients; diff --git a/SGSXLThread.cpp b/SGSXLThread.cpp index 4d84197..3a74bcf 100644 --- a/SGSXLThread.cpp +++ b/SGSXLThread.cpp @@ -44,6 +44,7 @@ m_countDExtra(countDExtra), m_countDCS(countDCS), m_killed(false), m_stopped(true), +m_audioEnabled(false), m_callsign(), m_address(), m_g2Handler(NULL), @@ -178,6 +179,7 @@ void CSGSXLThread::run() m_remote->close(); delete m_remote; } + } void CSGSXLThread::kill() @@ -210,6 +212,12 @@ void CSGSXLThread::setIRC(CIRCDDB* irc) m_irc = irc; } +void CSGSXLThread::setLanguage(bool audioEnabled, TEXT_LANG lang) +{ + m_audioEnabled = audioEnabled; + CAudioUnit::setLanguage(lang); +} + void CSGSXLThread::setRemote(bool enabled, const std::string& password, unsigned int port) { if (enabled) { diff --git a/SGSXLThread.h b/SGSXLThread.h index 3c51c39..0aabdb6 100644 --- a/SGSXLThread.h +++ b/SGSXLThread.h @@ -44,6 +44,8 @@ public: virtual void setRemote(bool enabled, const std::string& password, unsigned int port); virtual void setIRC(CIRCDDB* irc); + virtual void setLanguage(bool audioEnabled, TEXT_LANG lang); + virtual void run(); virtual void kill(); @@ -52,6 +54,7 @@ private: unsigned int m_countDCS; bool m_killed; bool m_stopped; + bool m_audioEnabled; std::string m_callsign; std::string m_address;