diff --git a/src/blackcore/corefacade.cpp b/src/blackcore/corefacade.cpp index 2ebfe89fd..f61420288 100644 --- a/src/blackcore/corefacade.cpp +++ b/src/blackcore/corefacade.cpp @@ -265,7 +265,7 @@ namespace BlackCore // hook up with audio if audio context is local if (this->hasLocalAudio() && m_contextOwnAircraft) { - c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit, this->getCContextAudio(), &CContextAudio::xCtxChangedAircraftCockpit, Qt::QueuedConnection); + c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit, this->getCContextAudio(), &IContextAudio::xCtxChangedAircraftCockpit, Qt::QueuedConnection); Q_ASSERT(c); } @@ -288,7 +288,7 @@ namespace BlackCore { Q_ASSERT(m_contextApplication); c = connect(m_contextNetwork, &IContextNetwork::connectionStatusChanged, - this->getCContextAudio(), &CContextAudio::xCtxNetworkConnectionStatusChanged, Qt::QueuedConnection); + this->getCContextAudio(), &IContextAudio::xCtxNetworkConnectionStatusChanged, Qt::QueuedConnection); Q_ASSERT(c); times.insert("Post setup, connects audio", time.restart()); } @@ -352,11 +352,10 @@ namespace BlackCore if (this->getIContextAudio()) { + // there is no empty audio context since AFV disconnect(this->getIContextAudio()); this->getIContextAudio()->deleteLater(); - // replace by dummy object avoiding nullptr issues during shutdown phase - QDBusConnection defaultConnection("default"); - m_contextAudio = IContextAudio::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); + m_contextAudio = nullptr; } if (this->getIContextOwnAircraft()) diff --git a/src/blackcore/corefacadeconfig.cpp b/src/blackcore/corefacadeconfig.cpp index 928738d7a..0c5b724ab 100644 --- a/src/blackcore/corefacadeconfig.cpp +++ b/src/blackcore/corefacadeconfig.cpp @@ -53,13 +53,6 @@ namespace BlackCore return cfg; } - CCoreFacadeConfig CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress) - { - CCoreFacadeConfig cfg(CCoreFacadeConfig::LocalInDBusServer, dbusBootstrapAddress); - cfg.m_audio = CCoreFacadeConfig::NotUsed; - return cfg; - } - CCoreFacadeConfig CCoreFacadeConfig::local(const QString &dbusBootstrapAddress) { const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Local, dbusBootstrapAddress)); @@ -67,12 +60,6 @@ namespace BlackCore } CCoreFacadeConfig CCoreFacadeConfig::remote(const QString &dbusBootstrapAddress) - { - const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Remote, dbusBootstrapAddress)); - return cfg; - } - - CCoreFacadeConfig CCoreFacadeConfig::remoteLocalAudio(const QString &dbusBootstrapAddress) { CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Remote, dbusBootstrapAddress)); cfg.m_audio = CCoreFacadeConfig::LocalInDBusServer; @@ -81,7 +68,8 @@ namespace BlackCore CCoreFacadeConfig CCoreFacadeConfig::allEmpty() { - const CCoreFacadeConfig cfg = CCoreFacadeConfig(); + CCoreFacadeConfig cfg = CCoreFacadeConfig(); + cfg.m_audio = CCoreFacadeConfig::Local; return cfg; } } // namespace diff --git a/src/blackcore/corefacadeconfig.h b/src/blackcore/corefacadeconfig.h index 81bcf95c6..29e9d7255 100644 --- a/src/blackcore/corefacadeconfig.h +++ b/src/blackcore/corefacadeconfig.h @@ -97,18 +97,12 @@ namespace BlackCore //! Predefined for Core static CCoreFacadeConfig forCoreAllLocalInDBus(const QString &dbusBootstrapAddress = ""); - //! Predefined for Core - static CCoreFacadeConfig forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress = ""); - //! Predefined, completely local (e.g. for unit tests) static CCoreFacadeConfig local(const QString &dbusBootstrapAddress = ""); - //! Predefined, completely remote (e.g. for GUI with core) + //! Predefined, completely remote static CCoreFacadeConfig remote(const QString &dbusBootstrapAddress = ""); - //! Predefined, remote with local audio (e.g. Aduio in GUI) - static CCoreFacadeConfig remoteLocalAudio(const QString &dbusBootstrapAddress = ""); - //! Predefined, all empty configs (normally used when the real config can only be determined later) static CCoreFacadeConfig allEmpty(); }; diff --git a/src/blackcore/coremodeenums.h b/src/blackcore/coremodeenums.h index 83094c342..1b2d37eb4 100644 --- a/src/blackcore/coremodeenums.h +++ b/src/blackcore/coremodeenums.h @@ -23,8 +23,7 @@ namespace BlackCore enum CoreMode { CoreInGuiProcess, - CoreExternalCoreAudio, - CoreExternalAudioGui + CoreExternal }; //! String to core mode @@ -32,14 +31,11 @@ namespace BlackCore { QString cm(m.toLower().trimmed()); if (cm.isEmpty()) { return CoreInGuiProcess; } - if (m == coreModeToString(CoreExternalCoreAudio)) { return CoreExternalCoreAudio; } if (m == coreModeToString(CoreInGuiProcess)) { return CoreInGuiProcess; } - if (m == coreModeToString(CoreExternalAudioGui)) { return CoreExternalAudioGui; } + if (m == coreModeToString(CoreExternal)) { return CoreExternal; } // some alternative names - if (cm.contains("audiolocal")) { return CoreExternalAudioGui; } - if (cm.contains("localaudio")) { return CoreExternalAudioGui; } - if (cm.contains("external")) { return CoreExternalCoreAudio; } + if (cm.contains("external")) { return CoreExternal; } if (cm.contains("gui")) { return CoreInGuiProcess; } return CoreInGuiProcess; } @@ -50,8 +46,7 @@ namespace BlackCore switch (mode) { case CoreInGuiProcess: return QStringLiteral("coreinguiprocess"); - case CoreExternalCoreAudio: return QStringLiteral("coreexternal"); - case CoreExternalAudioGui: return QStringLiteral("coreexternalaudiogui"); + case CoreExternal: return QStringLiteral("coreexternal"); } return {}; }