Ref T609, allow to get COM unit from own aircraft context

This commit is contained in:
Klaus Basan
2019-08-01 22:55:31 +02:00
committed by Mat Sutcliffe
parent 398f28fd9e
commit 9ba7dfee4d
2 changed files with 22 additions and 0 deletions

View File

@@ -713,6 +713,22 @@ namespace BlackCore
this->setVoiceOutputVolume(v);
}
CComSystem CContextAudio::getOwnComSystem(CComSystem::ComUnit unit) const
{
if (!this->getIContextOwnAircraft())
{
// context not available
switch (unit)
{
case CComSystem::Com1: return CComSystem::getCom1System(122.800, 122.800);
case CComSystem::Com2: return CComSystem::getCom2System(122.800, 122.800);
default: break;
}
return CComSystem::getCom1System(122.800, 122.800);
}
return this->getIContextOwnAircraft()->getOwnComSystem(unit);
}
QSharedPointer<IVoiceChannel> CContextAudio::getVoiceChannelBy(const CVoiceRoom &voiceRoom)
{
QSharedPointer<IVoiceChannel> voiceChannel;

View File

@@ -167,6 +167,12 @@ namespace BlackCore
void audioDecreaseVolume(bool enabled);
//! @}
//! Get current COM unit from cockpit
//! \remark cross context
//! @{
BlackMisc::Aviation::CComSystem getOwnComSystem(BlackMisc::Aviation::CComSystem::ComUnit unit) const;
//! @}
//! Voice channel by room
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);