mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T739, workaround to hide "local signals" from Dbus registration
Directly using CAfvClient signals - a scenario we actually want to avoid
This commit is contained in:
@@ -114,10 +114,10 @@ namespace BlackCore
|
||||
Q_ASSERT_X(m_voiceClient->owner() == this, Q_FUNC_INFO, "Wrong owner");
|
||||
Q_ASSERT_X(!CThreadUtils::isApplicationThread(m_voiceClient->thread()), Q_FUNC_INFO, "Must NOT be in main thread");
|
||||
|
||||
connect(m_voiceClient, &CAfvClient::outputVolumePeakVU, this, &CContextAudioBase::outputVolumePeakVU, Qt::QueuedConnection);
|
||||
connect(m_voiceClient, &CAfvClient::inputVolumePeakVU, this, &CContextAudioBase::inputVolumePeakVU, Qt::QueuedConnection);
|
||||
connect(m_voiceClient, &CAfvClient::receivingCallsignsChanged, this, &CContextAudioBase::receivingCallsignsChanged, Qt::QueuedConnection);
|
||||
connect(m_voiceClient, &CAfvClient::updatedFromOwnAircraftCockpit, this, &CContextAudioBase::updatedFromOwnAircraftCockpit, Qt::QueuedConnection);
|
||||
// connect(m_voiceClient, &CAfvClient::outputVolumePeakVU, this, &CContextAudioBase::outputVolumePeakVU, Qt::QueuedConnection);
|
||||
// connect(m_voiceClient, &CAfvClient::inputVolumePeakVU, this, &CContextAudioBase::inputVolumePeakVU, Qt::QueuedConnection);
|
||||
// connect(m_voiceClient, &CAfvClient::receivingCallsignsChanged, this, &CContextAudioBase::receivingCallsignsChanged, Qt::QueuedConnection);
|
||||
// connect(m_voiceClient, &CAfvClient::updatedFromOwnAircraftCockpit, this, &CContextAudioBase::updatedFromOwnAircraftCockpit, Qt::QueuedConnection);
|
||||
connect(m_voiceClient, &CAfvClient::startedAudio, this, &CContextAudioBase::startedAudio, Qt::QueuedConnection);
|
||||
connect(m_voiceClient, &CAfvClient::ptt, this, &CContextAudioBase::ptt, Qt::QueuedConnection);
|
||||
|
||||
|
||||
@@ -178,6 +178,9 @@ namespace BlackCore
|
||||
//! Is COM unit transmitting?
|
||||
bool isTransmittingComUnit(BlackMisc::Aviation::CComSystem::ComUnit comUnit) const;
|
||||
|
||||
//! \todo WORKAROUND to hide the "local signals"
|
||||
Afv::Clients::CAfvClient *afvClient() const { return m_voiceClient; }
|
||||
|
||||
// -------- parts which can run in core and GUI, referring to local voice client ------------
|
||||
|
||||
public slots:
|
||||
@@ -213,6 +216,8 @@ namespace BlackCore
|
||||
//! PTT in voice client received
|
||||
void ptt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
|
||||
|
||||
/** Workaround those must be invisible for DBus
|
||||
|
||||
//! VU levels @{
|
||||
void inputVolumePeakVU(double value);
|
||||
void outputVolumePeakVU(double value);
|
||||
@@ -224,6 +229,8 @@ namespace BlackCore
|
||||
//! Client updated from own aicraft data
|
||||
void updatedFromOwnAircraftCockpit();
|
||||
|
||||
**/
|
||||
|
||||
// ------------ local signals -------
|
||||
|
||||
private:
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "blackgui/components/audiodevicevolumesetupcomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackcore/afv/clients/afvclient.h"
|
||||
#include "blackcore/context/contextaudioimpl.h"
|
||||
|
||||
#include "blackmisc/audio/audiodeviceinfo.h"
|
||||
@@ -26,6 +27,7 @@
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Afv::Audio;
|
||||
using namespace BlackCore::Afv::Clients;
|
||||
using namespace BlackCore::Context;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -112,16 +114,18 @@ namespace BlackGui
|
||||
c = connect(sGui->getCContextAudioBase(), &CContextAudioBase::startedAudio, this, &CAudioDeviceVolumeSetupComponent::onAudioStarted, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
c = connect(sGui->getCContextAudioBase(), &CContextAudioBase::outputVolumePeakVU, this, &CAudioDeviceVolumeSetupComponent::onOutputVU, Qt::QueuedConnection);
|
||||
//! \todo Workaround to avoid context signals
|
||||
|
||||
c = connect(sGui->getCContextAudioBase()->afvClient(), &CAfvClient::outputVolumePeakVU, this, &CAudioDeviceVolumeSetupComponent::onOutputVU, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
c = connect(sGui->getCContextAudioBase(), &CContextAudioBase::inputVolumePeakVU, this, &CAudioDeviceVolumeSetupComponent::onInputVU, Qt::QueuedConnection);
|
||||
c = connect(sGui->getCContextAudioBase()->afvClient(), &CAfvClient::inputVolumePeakVU, this, &CAudioDeviceVolumeSetupComponent::onInputVU, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
c = connect(sGui->getCContextAudioBase(), &CContextAudioBase::receivingCallsignsChanged, this, &CAudioDeviceVolumeSetupComponent::onReceivingCallsignsChanged, Qt::QueuedConnection);
|
||||
c = connect(sGui->getCContextAudioBase()->afvClient(), &CAfvClient::receivingCallsignsChanged, this, &CAudioDeviceVolumeSetupComponent::onReceivingCallsignsChanged, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
c = connect(sGui->getCContextAudioBase(), &CContextAudioBase::updatedFromOwnAircraftCockpit, this, &CAudioDeviceVolumeSetupComponent::onUpdatedClientWithCockpitData, Qt::QueuedConnection);
|
||||
c = connect(sGui->getCContextAudioBase()->afvClient(), &CAfvClient::updatedFromOwnAircraftCockpit, this, &CAudioDeviceVolumeSetupComponent::onUpdatedClientWithCockpitData, Qt::QueuedConnection);
|
||||
Q_ASSERT(c);
|
||||
|
||||
this->onUpdatedClientWithCockpitData();
|
||||
|
||||
Reference in New Issue
Block a user