Disable X-Plane's built-in voice ATIS when XSwiftBus is active.

This commit is contained in:
Mat Sutcliffe
2019-06-16 14:50:34 +01:00
parent 24d45b7f85
commit 81352d8f07
2 changed files with 8 additions and 0 deletions

View File

@@ -66,10 +66,15 @@ namespace XSwiftBus
// Delay the start of XSwiftBus. // Delay the start of XSwiftBus.
// http://www.xsquawkbox.net/xpsdk/mediawiki/DeferredInitialization // http://www.xsquawkbox.net/xpsdk/mediawiki/DeferredInitialization
XPLMRegisterFlightLoopCallback(startServerDeferred, -1, this); XPLMRegisterFlightLoopCallback(startServerDeferred, -1, this);
m_atisSaved = m_atisEnabled.get();
m_atisEnabled.set(0);
} }
CPlugin::~CPlugin() CPlugin::~CPlugin()
{ {
m_atisEnabled.set(m_atisSaved);
XPLMUnregisterFlightLoopCallback(flightLoopCallback, this); XPLMUnregisterFlightLoopCallback(flightLoopCallback, this);
m_dbusConnection->close(); m_dbusConnection->close();
m_shouldStop = true; m_shouldStop = true;

View File

@@ -72,6 +72,9 @@ namespace XSwiftBus
CMenu m_planeViewSubMenu; CMenu m_planeViewSubMenu;
CMenuItem planeViewOwnAircraftMenuItem; CMenuItem planeViewOwnAircraftMenuItem;
DataRef<xplane::data::sim::atc::atis_enabled> m_atisEnabled;
decltype(m_atisEnabled.get()) m_atisSaved = 0;
std::thread m_dbusThread; std::thread m_dbusThread;
bool m_isRunning = false; bool m_isRunning = false;
bool m_shouldStop = false; bool m_shouldStop = false;