mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 20:25:34 +08:00
Ref T376, context support for CVoiceSetup
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "blackmisc/audio/notificationsounds.h"
|
#include "blackmisc/audio/notificationsounds.h"
|
||||||
#include "blackmisc/audio/voiceroom.h"
|
#include "blackmisc/audio/voiceroom.h"
|
||||||
#include "blackmisc/audio/voiceroomlist.h"
|
#include "blackmisc/audio/voiceroomlist.h"
|
||||||
|
#include "blackmisc/audio/voicesetup.h"
|
||||||
#include "blackmisc/aviation/callsignset.h"
|
#include "blackmisc/aviation/callsignset.h"
|
||||||
#include "blackmisc/aviation/comsystem.h"
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/aviation/selcal.h"
|
#include "blackmisc/aviation/selcal.h"
|
||||||
@@ -170,6 +171,12 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Is loobback enabled?
|
//! Is loobback enabled?
|
||||||
virtual bool isAudioLoopbackEnabled() const = 0;
|
virtual bool isAudioLoopbackEnabled() const = 0;
|
||||||
|
|
||||||
|
//! Get voice setup
|
||||||
|
virtual BlackMisc::Audio::CVoiceSetup getVoiceSetup() const = 0;
|
||||||
|
|
||||||
|
//! Set voice setup
|
||||||
|
virtual void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup) = 0;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -175,6 +175,20 @@ namespace BlackCore
|
|||||||
logEmptyContextWarning(Q_FUNC_INFO);
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::getVoiceSetup
|
||||||
|
virtual BlackMisc::Audio::CVoiceSetup getVoiceSetup() const override
|
||||||
|
{
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
return BlackMisc::Audio::CVoiceSetup();
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc IContextAudio::setVoiceSetup
|
||||||
|
virtual void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup) override
|
||||||
|
{
|
||||||
|
Q_UNUSED(setup);
|
||||||
|
logEmptyContextWarning(Q_FUNC_INFO);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -468,6 +468,18 @@ namespace BlackCore
|
|||||||
return m_audioMixer->hasMixerConnection(IAudioMixer::InputMicrophone, IAudioMixer::OutputOutputDevice1);
|
return m_audioMixer->hasMixerConnection(IAudioMixer::InputMicrophone, IAudioMixer::OutputOutputDevice1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CContextAudio::setVoiceSetup(const CVoiceSetup &setup)
|
||||||
|
{
|
||||||
|
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||||
|
if (m_voice) { m_voice->setVoiceSetup(setup); }
|
||||||
|
}
|
||||||
|
|
||||||
|
CVoiceSetup CContextAudio::getVoiceSetup() const
|
||||||
|
{
|
||||||
|
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||||
|
return m_voice ? m_voice->getVoiceSetup() : CVoiceSetup();
|
||||||
|
}
|
||||||
|
|
||||||
bool CContextAudio::parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator)
|
bool CContextAudio::parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator)
|
||||||
{
|
{
|
||||||
Q_UNUSED(originator);
|
Q_UNUSED(originator);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CContextAudio();
|
virtual ~CContextAudio() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Interface implementations
|
// Interface implementations
|
||||||
@@ -93,6 +93,8 @@ namespace BlackCore
|
|||||||
virtual void playNotification(BlackMisc::Audio::CNotificationSounds::Notification notification, bool considerSettings) const override;
|
virtual void playNotification(BlackMisc::Audio::CNotificationSounds::Notification notification, bool considerSettings) const override;
|
||||||
virtual void enableAudioLoopback(bool enable = true) override;
|
virtual void enableAudioLoopback(bool enable = true) override;
|
||||||
virtual bool isAudioLoopbackEnabled() const override;
|
virtual bool isAudioLoopbackEnabled() const override;
|
||||||
|
virtual BlackMisc::Audio::CVoiceSetup getVoiceSetup() const override;
|
||||||
|
virtual void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup) override;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! \addtogroup swiftdotcommands
|
//! \addtogroup swiftdotcommands
|
||||||
|
|||||||
@@ -67,14 +67,14 @@ namespace BlackCore
|
|||||||
this->m_dBusInterface->callDBus(QLatin1String("leaveAllVoiceRooms"));
|
this->m_dBusInterface->callDBus(QLatin1String("leaveAllVoiceRooms"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackMisc::Aviation::CCallsignSet CContextAudioProxy::getRoomCallsigns(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue) const
|
BlackMisc::Aviation::CCallsignSet CContextAudioProxy::getRoomCallsigns(CComSystem::ComUnit comUnitValue) const
|
||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CCallsignSet>(QLatin1String("getRoomCallsigns"), comUnitValue);
|
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CCallsignSet>(QLatin1String("getRoomCallsigns"), comUnitValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackMisc::Network::CUserList CContextAudioProxy::getRoomUsers(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue) const
|
BlackMisc::Network::CUserList CContextAudioProxy::getRoomUsers(CComSystem::ComUnit comUnitValue) const
|
||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<BlackMisc::Network::CUserList>(QLatin1String("getRoomUsers"), comUnitValue);
|
return this->m_dBusInterface->callDBusRet<CUserList>(QLatin1String("getRoomUsers"), comUnitValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAudioDeviceInfoList CContextAudioProxy::getAudioDevices() const
|
CAudioDeviceInfoList CContextAudioProxy::getAudioDevices() const
|
||||||
@@ -107,12 +107,12 @@ namespace BlackCore
|
|||||||
return this->m_dBusInterface->callDBusRet<CVoiceRoomList>(QLatin1String("getComVoiceRooms"));
|
return this->m_dBusInterface->callDBusRet<CVoiceRoomList>(QLatin1String("getComVoiceRooms"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CVoiceRoom CContextAudioProxy::getVoiceRoom(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue, bool withAudioStatus) const
|
CVoiceRoom CContextAudioProxy::getVoiceRoom(CComSystem::ComUnit comUnitValue, bool withAudioStatus) const
|
||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<CVoiceRoom>(QLatin1String("getVoiceRoom"), comUnitValue, withAudioStatus);
|
return this->m_dBusInterface->callDBusRet<CVoiceRoom>(QLatin1String("getVoiceRoom"), comUnitValue, withAudioStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudioProxy::setComVoiceRooms(const BlackMisc::Audio::CVoiceRoomList &voiceRooms)
|
void CContextAudioProxy::setComVoiceRooms(const CVoiceRoomList &voiceRooms)
|
||||||
{
|
{
|
||||||
this->m_dBusInterface->callDBus(QLatin1String("setComVoiceRooms"), voiceRooms);
|
this->m_dBusInterface->callDBus(QLatin1String("setComVoiceRooms"), voiceRooms);
|
||||||
}
|
}
|
||||||
@@ -161,5 +161,15 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
return this->m_dBusInterface->callDBusRet<bool>(QLatin1String("parseCommandLine"), commandLine, originator);
|
return this->m_dBusInterface->callDBusRet<bool>(QLatin1String("parseCommandLine"), commandLine, originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CVoiceSetup CContextAudioProxy::getVoiceSetup() const
|
||||||
|
{
|
||||||
|
return this->m_dBusInterface->callDBusRet<CVoiceSetup>(QLatin1String("getVoiceSetup"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CContextAudioProxy::setVoiceSetup(const CVoiceSetup &setup)
|
||||||
|
{
|
||||||
|
this->m_dBusInterface->callDBus(QLatin1String("setVoiceSetup"), setup);
|
||||||
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CContextAudioProxy() {}
|
virtual ~CContextAudioProxy() override {}
|
||||||
|
|
||||||
//! Unit test relay signals
|
//! Unit test relay signals
|
||||||
//! \private
|
//! \private
|
||||||
@@ -82,6 +82,8 @@ namespace BlackCore
|
|||||||
virtual void enableAudioLoopback(bool enable = true) override;
|
virtual void enableAudioLoopback(bool enable = true) override;
|
||||||
virtual bool isAudioLoopbackEnabled() const override;
|
virtual bool isAudioLoopbackEnabled() const override;
|
||||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
||||||
|
virtual BlackMisc::Audio::CVoiceSetup getVoiceSetup() const override;
|
||||||
|
virtual void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup) override;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user