mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
Ref T609, style
This commit is contained in:
committed by
Mat Sutcliffe
parent
45427f5ef3
commit
143a3a6006
@@ -156,10 +156,10 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
Q_ASSERT(m_voice);
|
Q_ASSERT(m_voice);
|
||||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||||
return getComVoiceRooms();
|
return this->getComVoiceRooms();
|
||||||
}
|
}
|
||||||
|
|
||||||
CVoiceRoom CContextAudio::getVoiceRoom(BlackMisc::Aviation::CComSystem::ComUnit comUnitValue, bool withAudioStatus) const
|
CVoiceRoom CContextAudio::getVoiceRoom(CComSystem::ComUnit comUnitValue, bool withAudioStatus) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_voice);
|
Q_ASSERT(m_voice);
|
||||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << withAudioStatus; }
|
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << withAudioStatus; }
|
||||||
@@ -291,7 +291,7 @@ namespace BlackCore
|
|||||||
Q_ASSERT(m_voiceOutputDevice);
|
Q_ASSERT(m_voiceOutputDevice);
|
||||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << volume; }
|
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << volume; }
|
||||||
|
|
||||||
bool wasMuted = isMuted();
|
const bool wasMuted = isMuted();
|
||||||
volume = qMin(CSettings::MaxAudioVolume, volume);
|
volume = qMin(CSettings::MaxAudioVolume, volume);
|
||||||
|
|
||||||
bool changedVoiceOutput = m_voiceOutputDevice->getOutputVolume() != volume;
|
bool changedVoiceOutput = m_voiceOutputDevice->getOutputVolume() != volume;
|
||||||
@@ -345,11 +345,11 @@ namespace BlackCore
|
|||||||
if (newVolume != m_voiceOutputDevice->getOutputVolume())
|
if (newVolume != m_voiceOutputDevice->getOutputVolume())
|
||||||
{
|
{
|
||||||
m_voiceOutputDevice->setOutputVolume(newVolume);
|
m_voiceOutputDevice->setOutputVolume(newVolume);
|
||||||
emit changedAudioVolume(newVolume);
|
emit this->changedAudioVolume(newVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
// signal
|
// signal
|
||||||
emit changedMute(muted);
|
emit this->changedMute(muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CContextAudio::isMuted() const
|
bool CContextAudio::isMuted() const
|
||||||
@@ -400,8 +400,8 @@ namespace BlackCore
|
|||||||
QSharedPointer<IVoiceChannel> newVoiceChannel = this->getVoiceChannelBy(newRoomCom1);
|
QSharedPointer<IVoiceChannel> newVoiceChannel = this->getVoiceChannelBy(newRoomCom1);
|
||||||
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
newVoiceChannel->setOwnAircraftCallsign(ownCallsign);
|
||||||
newVoiceChannel->setUserId(id);
|
newVoiceChannel->setUserId(id);
|
||||||
bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
const bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel);
|
||||||
m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel);
|
m_voiceChannelMapping.insert(CComSystem::Com1, newVoiceChannel);
|
||||||
|
|
||||||
// If the voice channel is not used by anybody else
|
// If the voice channel is not used by anybody else
|
||||||
if (!inUse)
|
if (!inUse)
|
||||||
@@ -627,8 +627,9 @@ namespace BlackCore
|
|||||||
this->setVoiceTransmission(enabled, COMActive);
|
this->setVoiceTransmission(enabled, COMActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::onConnectionStatusChanged(BlackCore::IVoiceChannel::ConnectionStatus oldStatus,
|
void CContextAudio::onConnectionStatusChanged(
|
||||||
BlackCore::IVoiceChannel::ConnectionStatus newStatus)
|
IVoiceChannel::ConnectionStatus oldStatus,
|
||||||
|
IVoiceChannel::ConnectionStatus newStatus)
|
||||||
{
|
{
|
||||||
Q_UNUSED(oldStatus);
|
Q_UNUSED(oldStatus);
|
||||||
|
|
||||||
@@ -717,7 +718,11 @@ namespace BlackCore
|
|||||||
QSharedPointer<IVoiceChannel> voiceChannel;
|
QSharedPointer<IVoiceChannel> voiceChannel;
|
||||||
for (const auto &channel : as_const(m_voiceChannelMapping))
|
for (const auto &channel : as_const(m_voiceChannelMapping))
|
||||||
{
|
{
|
||||||
if (channel->getVoiceRoom().getVoiceRoomUrl() == voiceRoom.getVoiceRoomUrl()) voiceChannel = channel;
|
if (channel->getVoiceRoom().getVoiceRoomUrl() == voiceRoom.getVoiceRoomUrl())
|
||||||
|
{
|
||||||
|
voiceChannel = channel;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we haven't found a valid voice channel pointer, get an unused one
|
// If we haven't found a valid voice channel pointer, get an unused one
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
#ifndef BLACKCORE_CONTEXT_CONTEXTAUDIO_IMPL_H
|
#ifndef BLACKCORE_CONTEXT_CONTEXTAUDIO_IMPL_H
|
||||||
#define BLACKCORE_CONTEXT_CONTEXTAUDIO_IMPL_H
|
#define BLACKCORE_CONTEXT_CONTEXTAUDIO_IMPL_H
|
||||||
|
|
||||||
#include "blackcore/actionbind.h"
|
|
||||||
#include "blackcore/blackcoreexport.h"
|
|
||||||
#include "blackcore/context/contextaudio.h"
|
#include "blackcore/context/contextaudio.h"
|
||||||
#include "blackcore/corefacadeconfig.h"
|
|
||||||
#include "blackcore/audio/audiosettings.h"
|
#include "blackcore/audio/audiosettings.h"
|
||||||
|
#include "blackcore/actionbind.h"
|
||||||
|
#include "blackcore/corefacadeconfig.h"
|
||||||
#include "blackcore/voicechannel.h"
|
#include "blackcore/voicechannel.h"
|
||||||
#include "blackcore/audiomixer.h"
|
#include "blackcore/audiomixer.h"
|
||||||
|
#include "blackcore/blackcoreexport.h"
|
||||||
#include "blackmisc/audio/audiosettings.h"
|
#include "blackmisc/audio/audiosettings.h"
|
||||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||||
#include "blackmisc/audio/notificationsounds.h"
|
#include "blackmisc/audio/notificationsounds.h"
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
#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"
|
||||||
|
#include "blackmisc/macos/microphoneaccess.h"
|
||||||
#include "blackmisc/identifier.h"
|
#include "blackmisc/identifier.h"
|
||||||
#include "blackmisc/network/userlist.h"
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackmisc/macos/microphoneaccess.h"
|
|
||||||
#include "blacksound/selcalplayer.h"
|
#include "blacksound/selcalplayer.h"
|
||||||
#include "blacksound/notificationplayer.h"
|
#include "blacksound/notificationplayer.h"
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ namespace BlackCore
|
|||||||
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Voice COM channel
|
//! Voice COM channel
|
||||||
enum COM
|
enum COM
|
||||||
{
|
{
|
||||||
COM1,
|
COM1,
|
||||||
@@ -140,7 +140,7 @@ namespace BlackCore
|
|||||||
//! \sa IContextAudio::changedVoiceRooms
|
//! \sa IContextAudio::changedVoiceRooms
|
||||||
void onConnectionStatusChanged(IVoiceChannel::ConnectionStatus oldStatus, IVoiceChannel::ConnectionStatus newStatus);
|
void onConnectionStatusChanged(IVoiceChannel::ConnectionStatus oldStatus, IVoiceChannel::ConnectionStatus newStatus);
|
||||||
|
|
||||||
//! Enable/disable voice transmission @{
|
//! Enable/disable voice transmission, nornally used with hotkey @{
|
||||||
void setVoiceTransmission(bool enable, COM com);
|
void setVoiceTransmission(bool enable, COM com);
|
||||||
void setVoiceTransmissionCom1(bool enabled);
|
void setVoiceTransmissionCom1(bool enabled);
|
||||||
void setVoiceTransmissionCom2(bool enabled);
|
void setVoiceTransmissionCom2(bool enabled);
|
||||||
@@ -162,7 +162,7 @@ namespace BlackCore
|
|||||||
//! Changed audio settings
|
//! Changed audio settings
|
||||||
void onChangedAudioSettings();
|
void onChangedAudioSettings();
|
||||||
|
|
||||||
//! Audio increase/decrease @{
|
//! Audio increase/decrease volume @{
|
||||||
void audioIncreaseVolume(bool enabled);
|
void audioIncreaseVolume(bool enabled);
|
||||||
void audioDecreaseVolume(bool enabled);
|
void audioDecreaseVolume(bool enabled);
|
||||||
//! @}
|
//! @}
|
||||||
@@ -193,8 +193,8 @@ namespace BlackCore
|
|||||||
std::unique_ptr<IAudioInputDevice> m_voiceInputDevice;
|
std::unique_ptr<IAudioInputDevice> m_voiceInputDevice;
|
||||||
|
|
||||||
QList<QSharedPointer<IVoiceChannel>> m_unusedVoiceChannels;
|
QList<QSharedPointer<IVoiceChannel>> m_unusedVoiceChannels;
|
||||||
QHash<BlackMisc::Aviation::CComSystem::ComUnit, QSharedPointer<IVoiceChannel>> m_voiceChannelMapping;
|
QHash<BlackMisc::Aviation::CComSystem::ComUnit, QSharedPointer<IVoiceChannel>> m_voiceChannelMapping; //!< COM unit to voice channel
|
||||||
QHash<QSharedPointer<IVoiceChannel>, IAudioMixer::OutputPort> m_voiceChannelOutputPortMapping;
|
QHash<QSharedPointer<IVoiceChannel>, IAudioMixer::OutputPort> m_voiceChannelOutputPortMapping; //!< channel to output port
|
||||||
BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr;
|
BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr;
|
||||||
BlackSound::CNotificationPlayer m_notificationPlayer;
|
BlackSound::CNotificationPlayer m_notificationPlayer;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user