mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 15:15:39 +08:00
Ref T739, make member of CAfvClient a "pointer"
* we can use forward declaration for m_voiceClient * make IContextAudio -> BlackMisc::CIdentifiable * removed delayedInitMicrophone, RR will move it to another place
This commit is contained in:
committed by
Mat Sutcliffe
parent
3bf4eda702
commit
ff33b59683
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "contextaudio.h"
|
#include "contextaudio.h"
|
||||||
|
|
||||||
|
#include "blackcore/afv/clients/afvclient.h"
|
||||||
#include "blackcore/context/contextaudio.h"
|
#include "blackcore/context/contextaudio.h"
|
||||||
#include "blackcore/context/contextnetwork.h" // for user login
|
#include "blackcore/context/contextnetwork.h" // for user login
|
||||||
#include "blackcore/context/contextownaircraft.h" // for COM integration
|
#include "blackcore/context/contextownaircraft.h" // for COM integration
|
||||||
@@ -33,42 +34,33 @@ namespace BlackCore
|
|||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
IContextAudio::IContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
|
IContextAudio::IContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
|
||||||
IContext(mode, runtime), m_voiceClient(CVoiceSetup().getAfvVoiceServerUrl(), this)
|
IContext(mode, runtime),
|
||||||
|
CIdentifiable(this),
|
||||||
|
m_voiceClient(new CAfvClient(CVoiceSetup().getAfvVoiceServerUrl(), this))
|
||||||
{
|
{
|
||||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||||
m_voiceClient.updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||||
|
|
||||||
Q_ASSERT_X(CThreadUtils::isApplicationThread(m_voiceClient.thread()), Q_FUNC_INFO, "Should be in main thread");
|
Q_ASSERT_X(CThreadUtils::isApplicationThread(m_voiceClient->thread()), Q_FUNC_INFO, "Should be in main thread");
|
||||||
m_voiceClient.start();
|
m_voiceClient->start();
|
||||||
Q_ASSERT_X(m_voiceClient.owner() == this, Q_FUNC_INFO, "Wrong owner");
|
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");
|
Q_ASSERT_X(!CThreadUtils::isApplicationThread(m_voiceClient->thread()), Q_FUNC_INFO, "Must NOT be in main thread");
|
||||||
|
|
||||||
const CSettings as = m_audioSettings.getThreadLocal();
|
const CSettings as = m_audioSettings.getThreadLocal();
|
||||||
this->setVoiceOutputVolume(as.getOutVolume());
|
this->setVoiceOutputVolume(as.getOutVolume());
|
||||||
m_selcalPlayer = new CSelcalPlayer(CAudioDeviceInfo::getDefaultOutputDevice(), this);
|
m_selcalPlayer = new CSelcalPlayer(CAudioDeviceInfo::getDefaultOutputDevice(), this);
|
||||||
|
|
||||||
connect(&m_voiceClient, &CAfvClient::ptt, this, &IContextAudio::ptt, Qt::QueuedConnection);
|
connect(m_voiceClient.data(), &CAfvClient::ptt, this, &IContextAudio::ptt, Qt::QueuedConnection);
|
||||||
|
|
||||||
this->changeDeviceSettings();
|
this->changeDeviceSettings();
|
||||||
QPointer<IContextAudio> myself(this);
|
QPointer<IContextAudio> myself(this);
|
||||||
QTimer::singleShot(5000, this, [ = ]
|
QTimer::singleShot(5000, this, [ = ]
|
||||||
{
|
{
|
||||||
if (!myself) { return; }
|
if (!myself || !sApp || sApp->isShuttingDown()) { return; }
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
|
||||||
myself->onChangedAudioSettings();
|
myself->onChangedAudioSettings();
|
||||||
myself->delayedInitMicrophone();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextAudio::delayedInitMicrophone()
|
|
||||||
{
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// m_voiceInputDevice = m_voice->createInputDevice();
|
|
||||||
// m_voice->connectVoice(m_voiceInputDevice.get(), m_audioMixer.get(), IAudioMixer::InputMicrophone);
|
|
||||||
CLogMessage(this).info(u"MacOS delayed input device init");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &IContextAudio::InterfaceName()
|
const QString &IContextAudio::InterfaceName()
|
||||||
{
|
{
|
||||||
static const QString s(BLACKCORE_CONTEXTAUDIO_INTERFACENAME);
|
static const QString s(BLACKCORE_CONTEXTAUDIO_INTERFACENAME);
|
||||||
@@ -107,9 +99,12 @@ namespace BlackCore
|
|||||||
|
|
||||||
void IContextAudio::gracefulShutdown()
|
void IContextAudio::gracefulShutdown()
|
||||||
{
|
{
|
||||||
m_voiceClient.stopAudio();
|
if (m_voiceClient)
|
||||||
m_voiceClient.quitAndWait();
|
{
|
||||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(&m_voiceClient), Q_FUNC_INFO, "Needs to be back in current thread");
|
m_voiceClient->stopAudio();
|
||||||
|
m_voiceClient->quitAndWait();
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(m_voiceClient.data()), Q_FUNC_INFO, "Needs to be back in current thread");
|
||||||
|
}
|
||||||
QObject::disconnect(this);
|
QObject::disconnect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,11 +158,13 @@ namespace BlackCore
|
|||||||
|
|
||||||
CAudioDeviceInfoList IContextAudio::getCurrentAudioDevices() const
|
CAudioDeviceInfoList IContextAudio::getCurrentAudioDevices() const
|
||||||
{
|
{
|
||||||
|
if (!m_voiceClient) { return {}; }
|
||||||
|
|
||||||
// either the devices really used, or settings
|
// either the devices really used, or settings
|
||||||
CAudioDeviceInfo inputDevice = m_voiceClient.getInputDevice();
|
CAudioDeviceInfo inputDevice = m_voiceClient->getInputDevice();
|
||||||
if (!inputDevice.isValid()) { inputDevice = CAudioDeviceInfo::getDefaultInputDevice(); }
|
if (!inputDevice.isValid()) { inputDevice = CAudioDeviceInfo::getDefaultInputDevice(); }
|
||||||
|
|
||||||
CAudioDeviceInfo outputDevice = m_voiceClient.getOutputDevice();
|
CAudioDeviceInfo outputDevice = m_voiceClient->getOutputDevice();
|
||||||
if (!outputDevice.isValid()) { outputDevice = CAudioDeviceInfo::getDefaultOutputDevice(); }
|
if (!outputDevice.isValid()) { outputDevice = CAudioDeviceInfo::getDefaultOutputDevice(); }
|
||||||
|
|
||||||
CAudioDeviceInfoList devices;
|
CAudioDeviceInfoList devices;
|
||||||
@@ -178,13 +175,13 @@ namespace BlackCore
|
|||||||
|
|
||||||
void IContextAudio::setCurrentAudioDevices(const CAudioDeviceInfo &inputDevice, const CAudioDeviceInfo &outputDevice)
|
void IContextAudio::setCurrentAudioDevices(const CAudioDeviceInfo &inputDevice, const CAudioDeviceInfo &outputDevice)
|
||||||
{
|
{
|
||||||
|
if (!m_voiceClient) { return; }
|
||||||
if (!inputDevice.getName().isEmpty()) { m_inputDeviceSetting.setAndSave(inputDevice.getName()); }
|
if (!inputDevice.getName().isEmpty()) { m_inputDeviceSetting.setAndSave(inputDevice.getName()); }
|
||||||
if (!outputDevice.getName().isEmpty()) { m_outputDeviceSetting.setAndSave(outputDevice.getName()); }
|
if (!outputDevice.getName().isEmpty()) { m_outputDeviceSetting.setAndSave(outputDevice.getName()); }
|
||||||
const bool changed = m_voiceClient.restartWithNewDevices(inputDevice, outputDevice);
|
const bool changed = m_voiceClient->restartWithNewDevices(inputDevice, outputDevice);
|
||||||
|
|
||||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||||
m_voiceClient.updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
emit this->changedSelectedAudioDevices(this->getCurrentAudioDevices());
|
emit this->changedSelectedAudioDevices(this->getCurrentAudioDevices());
|
||||||
@@ -193,14 +190,16 @@ namespace BlackCore
|
|||||||
|
|
||||||
void IContextAudio::setVoiceOutputVolume(int volume)
|
void IContextAudio::setVoiceOutputVolume(int volume)
|
||||||
{
|
{
|
||||||
|
if (!m_voiceClient) { return; }
|
||||||
|
|
||||||
const bool wasMuted = this->isMuted();
|
const bool wasMuted = this->isMuted();
|
||||||
volume = CSettings::fixOutVolume(volume);
|
volume = CSettings::fixOutVolume(volume);
|
||||||
|
|
||||||
const int currentVolume = m_voiceClient.getNormalizedOutputVolume();
|
const int currentVolume = m_voiceClient->getNormalizedOutputVolume();
|
||||||
const bool changedVoiceOutput = (currentVolume != volume);
|
const bool changedVoiceOutput = (currentVolume != volume);
|
||||||
if (changedVoiceOutput)
|
if (changedVoiceOutput)
|
||||||
{
|
{
|
||||||
m_voiceClient.setNormalizedOutputVolume(volume);
|
m_voiceClient->setNormalizedOutputVolume(volume);
|
||||||
m_outVolumeBeforeMute = currentVolume;
|
m_outVolumeBeforeMute = currentVolume;
|
||||||
|
|
||||||
emit this->changedAudioVolume(volume);
|
emit this->changedAudioVolume(volume);
|
||||||
@@ -221,15 +220,17 @@ namespace BlackCore
|
|||||||
|
|
||||||
int IContextAudio::getVoiceOutputVolume() const
|
int IContextAudio::getVoiceOutputVolume() const
|
||||||
{
|
{
|
||||||
return m_voiceClient.getNormalizedOutputVolume();
|
if (!m_voiceClient) { return 0; }
|
||||||
|
return m_voiceClient->getNormalizedOutputVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextAudio::setMute(bool muted)
|
void IContextAudio::setMute(bool muted)
|
||||||
{
|
{
|
||||||
|
if (!m_voiceClient) { return; }
|
||||||
if (this->isMuted() == muted) { return; } // avoid roundtrips / unnecessary signals
|
if (this->isMuted() == muted) { return; } // avoid roundtrips / unnecessary signals
|
||||||
|
|
||||||
if (m_voiceClient.isMuted() == muted) { return; }
|
if (m_voiceClient->isMuted() == muted) { return; }
|
||||||
m_voiceClient.setMuted(muted);
|
m_voiceClient->setMuted(muted);
|
||||||
|
|
||||||
// signal
|
// signal
|
||||||
emit this->changedMute(muted);
|
emit this->changedMute(muted);
|
||||||
@@ -237,7 +238,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
bool IContextAudio::isMuted() const
|
bool IContextAudio::isMuted() const
|
||||||
{
|
{
|
||||||
return m_voiceClient.isMuted();
|
if (!m_voiceClient) { return false; }
|
||||||
|
return m_voiceClient->isMuted();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextAudio::playSelcalTone(const CSelcal &selcal)
|
void IContextAudio::playSelcalTone(const CSelcal &selcal)
|
||||||
@@ -284,12 +286,14 @@ namespace BlackCore
|
|||||||
|
|
||||||
void IContextAudio::enableAudioLoopback(bool enable)
|
void IContextAudio::enableAudioLoopback(bool enable)
|
||||||
{
|
{
|
||||||
m_voiceClient.setLoopBack(enable);
|
if (!m_voiceClient) { return; }
|
||||||
|
m_voiceClient->setLoopBack(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IContextAudio::isAudioLoopbackEnabled() const
|
bool IContextAudio::isAudioLoopbackEnabled() const
|
||||||
{
|
{
|
||||||
return m_voiceClient.isLoopback();
|
if (!m_voiceClient) { return false; }
|
||||||
|
return m_voiceClient->isLoopback();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextAudio::setVoiceSetup(const CVoiceSetup &setup)
|
void IContextAudio::setVoiceSetup(const CVoiceSetup &setup)
|
||||||
@@ -305,7 +309,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
void IContextAudio::setVoiceTransmission(bool enable, PTTCOM com)
|
void IContextAudio::setVoiceTransmission(bool enable, PTTCOM com)
|
||||||
{
|
{
|
||||||
m_voiceClient.setPttForCom(enable, com);
|
if (!m_voiceClient) { return; }
|
||||||
|
m_voiceClient->setPttForCom(enable, com);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextAudio::setVoiceTransmissionCom1(bool enabled)
|
void IContextAudio::setVoiceTransmissionCom1(bool enabled)
|
||||||
@@ -371,7 +376,7 @@ namespace BlackCore
|
|||||||
this->setVoiceOutputVolume(v);
|
this->setVoiceOutputVolume(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
CComSystem IContextAudio::getOwnComSystem(CComSystem::ComUnit unit) const
|
CComSystem IContextAudio::xCtxGetOwnComSystem(CComSystem::ComUnit unit) const
|
||||||
{
|
{
|
||||||
if (!this->getIContextOwnAircraft())
|
if (!this->getIContextOwnAircraft())
|
||||||
{
|
{
|
||||||
@@ -388,7 +393,7 @@ namespace BlackCore
|
|||||||
return this->getIContextOwnAircraft()->getOwnComSystem(unit);
|
return this->getIContextOwnAircraft()->getOwnComSystem(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IContextAudio::isComIntegratedWithSimulator() const
|
bool IContextAudio::xCtxIsComIntegratedWithSimulator() const
|
||||||
{
|
{
|
||||||
if (!this->getIContextSimulator()) { return false; }
|
if (!this->getIContextSimulator()) { return false; }
|
||||||
return this->getIContextSimulator()->getSimulatorSettings().isComIntegrated();
|
return this->getIContextSimulator()->getSimulatorSettings().isComIntegrated();
|
||||||
@@ -399,9 +404,9 @@ namespace BlackCore
|
|||||||
Q_UNUSED(aircraft)
|
Q_UNUSED(aircraft)
|
||||||
Q_UNUSED(originator)
|
Q_UNUSED(originator)
|
||||||
|
|
||||||
/**
|
/** NOT NEEDED as CAfvClient is directly "tracking changes"
|
||||||
if (CIdentifiable::isMyIdentifier(originator)) { return; }
|
if (CIdentifiable::isMyIdentifier(originator)) { return; }
|
||||||
const bool integrated = this->isComIntegratedWithSimulator();
|
const bool integrated = this->xCtxisComIntegratedWithSimulator();
|
||||||
if (integrated)
|
if (integrated)
|
||||||
{
|
{
|
||||||
// set as in cockpit
|
// set as in cockpit
|
||||||
@@ -415,12 +420,15 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
Q_UNUSED(from)
|
Q_UNUSED(from)
|
||||||
BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
|
BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
|
||||||
|
if (!m_voiceClient) { return; }
|
||||||
|
|
||||||
if (to.isConnected() && this->getIContextNetwork())
|
if (to.isConnected() && this->getIContextNetwork())
|
||||||
{
|
{
|
||||||
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
const CVoiceSetup vs = m_voiceSettings.getThreadLocal();
|
||||||
m_voiceClient.updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl());
|
||||||
|
|
||||||
const CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser();
|
const CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser();
|
||||||
|
|
||||||
const QString inputDeviceName = m_inputDeviceSetting.get();
|
const QString inputDeviceName = m_inputDeviceSetting.get();
|
||||||
CAudioDeviceInfo input = CAudioDeviceInfo::getDefaultInputDevice();
|
CAudioDeviceInfo input = CAudioDeviceInfo::getDefaultInputDevice();
|
||||||
if (!inputDeviceName.isEmpty())
|
if (!inputDeviceName.isEmpty())
|
||||||
@@ -436,13 +444,13 @@ namespace BlackCore
|
|||||||
const CAudioDeviceInfoList outputDevs = this->getAudioOutputDevices();
|
const CAudioDeviceInfoList outputDevs = this->getAudioOutputDevices();
|
||||||
output = outputDevs.findByName(outputDeviceName);
|
output = outputDevs.findByName(outputDeviceName);
|
||||||
}
|
}
|
||||||
m_voiceClient.connectTo(connectedUser.getId(), connectedUser.getPassword(), connectedUser.getCallsign().asString());
|
m_voiceClient->connectTo(connectedUser.getId(), connectedUser.getPassword(), connectedUser.getCallsign().asString());
|
||||||
m_voiceClient.startAudio(input, output, {0, 1});
|
m_voiceClient->startAudio(input, output, {0, 1});
|
||||||
}
|
}
|
||||||
else if (to.isDisconnected())
|
else if (to.isDisconnected())
|
||||||
{
|
{
|
||||||
m_voiceClient.stopAudio();
|
m_voiceClient->stopAudio();
|
||||||
m_voiceClient.disconnectFrom();
|
m_voiceClient->disconnectFrom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#ifndef BLACKCORE_CONTEXT_CONTEXTAUDIO_H
|
#ifndef BLACKCORE_CONTEXT_CONTEXTAUDIO_H
|
||||||
#define BLACKCORE_CONTEXT_CONTEXTAUDIO_H
|
#define BLACKCORE_CONTEXT_CONTEXTAUDIO_H
|
||||||
|
|
||||||
#include "blackcore/afv/clients/afvclient.h"
|
|
||||||
#include "blackcore/audio/audiosettings.h"
|
#include "blackcore/audio/audiosettings.h"
|
||||||
#include "blackcore/context/context.h"
|
#include "blackcore/context/context.h"
|
||||||
#include "blackcore/actionbind.h"
|
#include "blackcore/actionbind.h"
|
||||||
@@ -21,10 +20,10 @@
|
|||||||
#include "blacksound/selcalplayer.h"
|
#include "blacksound/selcalplayer.h"
|
||||||
#include "blacksound/notificationplayer.h"
|
#include "blacksound/notificationplayer.h"
|
||||||
#include "blackmisc/macos/microphoneaccess.h"
|
#include "blackmisc/macos/microphoneaccess.h"
|
||||||
|
#include "blackmisc/audio/settings/voicesettings.h"
|
||||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||||
#include "blackmisc/audio/notificationsounds.h"
|
#include "blackmisc/audio/notificationsounds.h"
|
||||||
#include "blackmisc/audio/audiosettings.h"
|
#include "blackmisc/audio/audiosettings.h"
|
||||||
#include "blackmisc/audio/settings/voicesettings.h"
|
|
||||||
#include "blackmisc/audio/ptt.h"
|
#include "blackmisc/audio/ptt.h"
|
||||||
#include "blackmisc/aviation/callsignset.h"
|
#include "blackmisc/aviation/callsignset.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
@@ -32,6 +31,7 @@
|
|||||||
#include "blackmisc/network/connectionstatus.h"
|
#include "blackmisc/network/connectionstatus.h"
|
||||||
#include "blackmisc/network/userlist.h"
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "blackmisc/input/actionhotkeydefs.h"
|
#include "blackmisc/input/actionhotkeydefs.h"
|
||||||
|
#include "blackmisc/identifiable.h"
|
||||||
#include "blackmisc/identifier.h"
|
#include "blackmisc/identifier.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -56,10 +56,13 @@ namespace BlackMisc { class CDBusServer; }
|
|||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
namespace Afv { namespace Clients { class CAfvClient; }}
|
||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
//! Audio context interface
|
//! Audio context interface
|
||||||
class BLACKCORE_EXPORT IContextAudio : public IContext
|
class BLACKCORE_EXPORT IContextAudio :
|
||||||
|
public IContext,
|
||||||
|
public BlackMisc::CIdentifiable
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
||||||
@@ -92,7 +95,7 @@ namespace BlackCore
|
|||||||
// -------- parts which can run in core and GUI, referring to local voice client ------------
|
// -------- parts which can run in core and GUI, referring to local voice client ------------
|
||||||
|
|
||||||
//! Reference to voice client
|
//! Reference to voice client
|
||||||
BlackCore::Afv::Clients::CAfvClient &voiceClient() { return m_voiceClient; }
|
BlackCore::Afv::Clients::CAfvClient *voiceClient() { return m_voiceClient.data(); }
|
||||||
|
|
||||||
//! Audio devices
|
//! Audio devices
|
||||||
//! @{
|
//! @{
|
||||||
@@ -205,8 +208,8 @@ namespace BlackCore
|
|||||||
//! Get current COM unit from cockpit
|
//! Get current COM unit from cockpit
|
||||||
//! \remark cross context
|
//! \remark cross context
|
||||||
//! @{
|
//! @{
|
||||||
BlackMisc::Aviation::CComSystem getOwnComSystem(BlackMisc::Aviation::CComSystem::ComUnit unit) const;
|
BlackMisc::Aviation::CComSystem xCtxGetOwnComSystem(BlackMisc::Aviation::CComSystem::ComUnit unit) const;
|
||||||
bool isComIntegratedWithSimulator() const;
|
bool xCtxIsComIntegratedWithSimulator() const;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! Changed cockpit
|
//! Changed cockpit
|
||||||
@@ -226,24 +229,18 @@ namespace BlackCore
|
|||||||
static constexpr int MinUnmuteVolume = 20; //!< minimum volume when unmuted
|
static constexpr int MinUnmuteVolume = 20; //!< minimum volume when unmuted
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this, &IContextAudio::onChangedAudioSettings };
|
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this, &IContextAudio::onChangedAudioSettings };
|
||||||
BlackMisc::CSetting<BlackMisc::Audio::Settings::TVoiceSetup> m_voiceSettings { this, &IContextAudio::onChangedVoiceSettings };
|
BlackMisc::CSetting<BlackMisc::Audio::Settings::TVoiceSetup> m_voiceSettings { this, &IContextAudio::onChangedVoiceSettings };
|
||||||
|
|
||||||
BlackMisc::CSetting<Audio::TInputDevice> m_inputDeviceSetting { this, &IContextAudio::changeDeviceSettings };
|
BlackMisc::CSetting<Audio::TInputDevice> m_inputDeviceSetting { this, &IContextAudio::changeDeviceSettings };
|
||||||
BlackMisc::CSetting<Audio::TOutputDevice> m_outputDeviceSetting { this, &IContextAudio::changeDeviceSettings };
|
BlackMisc::CSetting<Audio::TOutputDevice> m_outputDeviceSetting { this, &IContextAudio::changeDeviceSettings };
|
||||||
|
|
||||||
// AFV
|
// AFV
|
||||||
Afv::Clients::CAfvClient m_voiceClient;
|
QScopedPointer<Afv::Clients::CAfvClient> m_voiceClient;
|
||||||
|
|
||||||
// Players
|
// Players
|
||||||
BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr;
|
BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr;
|
||||||
BlackSound::CNotificationPlayer m_notificationPlayer;
|
BlackSound::CNotificationPlayer m_notificationPlayer;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
BlackMisc::CMacOSMicrophoneAccess m_micAccess;
|
|
||||||
#endif
|
|
||||||
//! Init microphone
|
|
||||||
void delayedInitMicrophone();
|
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ namespace BlackCore
|
|||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
CContextAudio::CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
|
CContextAudio::CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
|
||||||
IContextAudio(mode, runtime),
|
IContextAudio(mode, runtime)
|
||||||
CIdentifiable(this)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
CContextAudio *CContextAudio::registerWithDBus(CDBusServer *server)
|
CContextAudio *CContextAudio::registerWithDBus(CDBusServer *server)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "blackcore/corefacadeconfig.h"
|
#include "blackcore/corefacadeconfig.h"
|
||||||
#include "blackcore/blackcoreexport.h"
|
#include "blackcore/blackcoreexport.h"
|
||||||
#include "blackmisc/network/userlist.h"
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "blackmisc/identifiable.h"
|
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -34,8 +33,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
//! Audio context implementation
|
//! Audio context implementation
|
||||||
class BLACKCORE_EXPORT CContextAudio :
|
class BLACKCORE_EXPORT CContextAudio :
|
||||||
public IContextAudio,
|
public IContextAudio
|
||||||
public BlackMisc::CIdentifiable
|
|
||||||
{
|
{
|
||||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME)
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "afvmapdialog.h"
|
#include "afvmapdialog.h"
|
||||||
#include "ui_afvmapdialog.h"
|
#include "ui_afvmapdialog.h"
|
||||||
//#include <QQmlContext>
|
// #include <QQmlContext>
|
||||||
//#include <QQmlEngine>
|
// #include <QQmlEngine>
|
||||||
|
|
||||||
using namespace BlackCore::Afv::Model;
|
using namespace BlackCore::Afv::Model;
|
||||||
using namespace BlackCore::Afv::Clients;
|
using namespace BlackCore::Afv::Clients;
|
||||||
@@ -27,28 +27,31 @@ namespace BlackGui
|
|||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::CAfvMapDialog)
|
ui(new Ui::CAfvMapDialog)
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
m_afvMapReader = new CAfvMapReader(this);
|
m_afvMapReader = new CAfvMapReader(this);
|
||||||
m_afvMapReader->updateFromMap();
|
m_afvMapReader->updateFromMap();
|
||||||
|
|
||||||
// if (sGui && !sGui->isShuttingDown() && sGui->getIContextAudio())
|
CAfvClient *afvClient = nullptr;
|
||||||
// {
|
if (sGui && !sGui->isShuttingDown() && sGui->getIContextAudio())
|
||||||
// if (sGui->getIContextAudio()->isUsingImplementingObject())
|
{
|
||||||
// {
|
if (sGui->getIContextAudio()->isUsingImplementingObject())
|
||||||
// m_afvClient = &sGui->getCoreFacade()->getCContextAudio()->voiceClient();
|
{
|
||||||
// }
|
afvClient = sGui->getCoreFacade()->getCContextAudio()->voiceClient();
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
// QQmlContext *ctxt = ui->qw_AfvMap->rootContext();
|
QQmlContext *ctxt = ui->qw_AfvMap->rootContext();
|
||||||
// ctxt->setContextProperty("afvMapReader", m_afvMapReader);
|
ctxt->setContextProperty("afvMapReader", m_afvMapReader);
|
||||||
|
|
||||||
// if (m_afvClient)
|
if (m_afvClient)
|
||||||
// {
|
{
|
||||||
// ctxt->setContextProperty("voiceClient", m_afvClient);
|
ctxt->setContextProperty("voiceClient", afvClient);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // ui->qw_AfvMap->engine()->setBaseUrl(":/blackgui/qml");
|
// ui->qw_AfvMap->engine()->setBaseUrl(":/blackgui/qml");
|
||||||
// ui->qw_AfvMap->setSource(QUrl("qrc:/blackgui/qml/AFVMap.qml"));
|
ui->qw_AfvMap->setSource(QUrl("qrc:/blackgui/qml/AFVMap.qml"));
|
||||||
|
**/
|
||||||
}
|
}
|
||||||
|
|
||||||
CAfvMapDialog::~CAfvMapDialog() { }
|
CAfvMapDialog::~CAfvMapDialog() { }
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace BlackGui
|
|||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CAfvMapDialog> ui;
|
QScopedPointer<Ui::CAfvMapDialog> ui;
|
||||||
BlackCore::Afv::Model::CAfvMapReader *m_afvMapReader = nullptr;
|
BlackCore::Afv::Model::CAfvMapReader *m_afvMapReader = nullptr;
|
||||||
BlackCore::Afv::Clients::CAfvClient *m_afvClient = nullptr;
|
BlackCore::Afv::Clients::CAfvClient *m_afvClient = nullptr;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
Reference in New Issue
Block a user