mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Ref T609, fixed signal/slot connection of cross context hookup
* audio can be local or remote special case * so we have to hookup on core or remote side depending on that
This commit is contained in:
committed by
Mat Sutcliffe
parent
105db27fa8
commit
d9948af103
@@ -259,14 +259,14 @@ namespace BlackCore
|
|||||||
c = connect(this->getCContextOwnAircraft(), &CContextOwnAircraft::ps_changedModel,
|
c = connect(this->getCContextOwnAircraft(), &CContextOwnAircraft::ps_changedModel,
|
||||||
this->getCContextSimulator(), &CContextSimulator::xCtxChangedOwnAircraftModel);
|
this->getCContextSimulator(), &CContextSimulator::xCtxChangedOwnAircraftModel);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
// special case for the audio related connection (which mutes audio for a changed cockpit)
|
||||||
// hook up with audio
|
// hook up with audio if audio context is local
|
||||||
if (this->getIContextAudio())
|
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(), &CContextAudio::xCtxChangedAircraftCockpit, Qt::QueuedConnection);
|
||||||
Q_ASSERT(c);
|
Q_ASSERT(c);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// times
|
// times
|
||||||
@@ -452,6 +452,11 @@ namespace BlackCore
|
|||||||
return static_cast<CContextAudio *>(m_contextAudio);
|
return static_cast<CContextAudio *>(m_contextAudio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CCoreFacade::hasLocalAudio() const
|
||||||
|
{
|
||||||
|
return m_contextAudio && m_contextAudio->isUsingImplementingObject();
|
||||||
|
}
|
||||||
|
|
||||||
const CContextAudio *CCoreFacade::getCContextAudio() const
|
const CContextAudio *CCoreFacade::getCContextAudio() const
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(m_contextAudio && m_contextAudio->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object");
|
Q_ASSERT_X(m_contextAudio && m_contextAudio->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object");
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace BlackCore
|
|||||||
CCoreFacade(const CCoreFacadeConfig &config, QObject *parent = nullptr);
|
CCoreFacade(const CCoreFacadeConfig &config, QObject *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CCoreFacade() { this->gracefulShutdown(); }
|
virtual ~CCoreFacade() override { this->gracefulShutdown(); }
|
||||||
|
|
||||||
//! DBus server (if applicable)
|
//! DBus server (if applicable)
|
||||||
const BlackMisc::CDBusServer *getDBusServer() const { return this->m_dbusServer; }
|
const BlackMisc::CDBusServer *getDBusServer() const { return this->m_dbusServer; }
|
||||||
@@ -123,6 +123,9 @@ namespace BlackCore
|
|||||||
//! \remarks only applicable for local object
|
//! \remarks only applicable for local object
|
||||||
Context::CContextAudio *getCContextAudio();
|
Context::CContextAudio *getCContextAudio();
|
||||||
|
|
||||||
|
//! Local audio context, means audio really runs here
|
||||||
|
bool hasLocalAudio() const;
|
||||||
|
|
||||||
//! Context for audio
|
//! Context for audio
|
||||||
//! \remarks only applicable for local object
|
//! \remarks only applicable for local object
|
||||||
const Context::CContextAudio *getCContextAudio() const;
|
const Context::CContextAudio *getCContextAudio() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user