mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refactor: Remove unused PTT enum
Currently, the PTT can only be activated on the active frequency anyway.
This commit is contained in:
@@ -106,7 +106,7 @@ signals:
|
||||
void updatedFromOwnAircraftCockpit();
|
||||
|
||||
//! PTT status in this particular AFV client
|
||||
void ptt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
|
||||
void ptt(bool active, const BlackMisc::CIdentifier &identifier);
|
||||
|
||||
//! VU levels
|
||||
//! @{
|
||||
|
||||
@@ -672,13 +672,6 @@ namespace BlackCore::Afv::Clients
|
||||
|
||||
void CAfvClient::setPtt(bool active)
|
||||
{
|
||||
this->setPttForCom(active, COMUnspecified);
|
||||
}
|
||||
|
||||
void CAfvClient::setPttForCom(bool active, PTTCOM com)
|
||||
{
|
||||
Q_UNUSED(com)
|
||||
|
||||
if (!m_isStarted)
|
||||
{
|
||||
CLogMessage(this).info(u"Voice client not started");
|
||||
@@ -708,7 +701,7 @@ namespace BlackCore::Afv::Clients
|
||||
**/
|
||||
}
|
||||
|
||||
emit this->ptt(active, com, this->identifier());
|
||||
emit this->ptt(active, this->identifier());
|
||||
}
|
||||
|
||||
double CAfvClient::getInputVolumeDb() const
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "blacksound/sampleprovider/volumesampleprovider.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blackmisc/audio/audiodeviceinfo.h"
|
||||
#include "blackmisc/logcategories.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
@@ -205,12 +204,9 @@ namespace BlackCore::Afv::Clients
|
||||
//! \threadsafe
|
||||
void updateFromOwnAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool withSignals = true);
|
||||
|
||||
//! @{
|
||||
//! Push to talk
|
||||
//! \threadsafe
|
||||
Q_INVOKABLE void setPtt(bool active);
|
||||
void setPttForCom(bool active, BlackMisc::Audio::PTTCOM com);
|
||||
//! @}
|
||||
|
||||
//! @{
|
||||
//! Loopback
|
||||
@@ -298,7 +294,7 @@ namespace BlackCore::Afv::Clients
|
||||
void updatedFromOwnAircraftCockpit();
|
||||
|
||||
//! PTT status in this particular AFV client
|
||||
void ptt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
|
||||
void ptt(bool active, const BlackMisc::CIdentifier &identifier);
|
||||
|
||||
//! @{
|
||||
//! VU levels
|
||||
|
||||
@@ -535,15 +535,10 @@ namespace BlackCore::Context
|
||||
return m_voiceClient->isLoopback();
|
||||
}
|
||||
|
||||
void CContextAudioBase::setVoiceTransmission(bool enable, PTTCOM com)
|
||||
void CContextAudioBase::setVoiceTransmission(bool enable)
|
||||
{
|
||||
if (!m_voiceClient) { return; }
|
||||
m_voiceClient->setPttForCom(enable, com);
|
||||
}
|
||||
|
||||
void CContextAudioBase::setVoiceTransmissionComActive(bool enabled)
|
||||
{
|
||||
this->setVoiceTransmission(enabled, COMActive);
|
||||
m_voiceClient->setPtt(enable);
|
||||
}
|
||||
|
||||
void CContextAudioBase::changeDeviceSettings()
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/aviation/selcal.h"
|
||||
@@ -280,7 +279,7 @@ namespace BlackCore
|
||||
void stoppedAudio();
|
||||
|
||||
//! PTT in voice client received
|
||||
void ptt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
|
||||
void ptt(bool active, const BlackMisc::CIdentifier &identifier);
|
||||
|
||||
/*
|
||||
* Workaround those must be invisible for DBus
|
||||
@@ -309,11 +308,8 @@ namespace BlackCore
|
||||
//! Terminate the voice client
|
||||
void terminateVoiceClient();
|
||||
|
||||
//! @{
|
||||
//! Enable/disable voice transmission, nornally used with hotkey
|
||||
void setVoiceTransmission(bool enable, BlackMisc::Audio::PTTCOM com);
|
||||
void setVoiceTransmissionComActive(bool enabled);
|
||||
//! @}
|
||||
//! Enable/disable voice transmission, normally used with hotkey
|
||||
void setVoiceTransmission(bool enable);
|
||||
|
||||
//! Change the device settings
|
||||
void changeDeviceSettings();
|
||||
@@ -340,7 +336,7 @@ namespace BlackCore
|
||||
//! AFV client authentication failed
|
||||
void onAfvConnectionFailure(const BlackMisc::CStatusMessage &msg);
|
||||
|
||||
CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CContextAudioBase::setVoiceTransmissionComActive };
|
||||
CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::Input::pttHotkeyIcon(), this, &CContextAudioBase::setVoiceTransmission };
|
||||
CActionBind m_actionAudioVolumeIncrease { BlackMisc::Input::audioVolumeIncreaseHotkeyAction(), BlackMisc::Input::audioVolumeIncreaseHotkeyIcon(), this, &CContextAudioBase::audioIncreaseVolume };
|
||||
CActionBind m_actionAudioVolumeDecrease { BlackMisc::Input::audioVolumeDecreaseHotkeyAction(), BlackMisc::Input::audioVolumeDecreaseHotkeyIcon(), this, &CContextAudioBase::audioDecreaseVolume };
|
||||
CActionBind m_actionAudioVolumeIncreaseCom1 { BlackMisc::Input::audioVolumeIncreaseCom1HotkeyAction(), BlackMisc::Input::audioVolumeIncreaseHotkeyIcon(), this, &CContextAudioBase::audioIncreaseVolumeCom1 };
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "blackcore/context/contextaudioproxy.h"
|
||||
#include "blackcore/afv/clients/afvclient.h"
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blackmisc/dbus.h"
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackmisc/genericdbusinterface.h"
|
||||
|
||||
@@ -270,23 +270,6 @@ namespace BlackGui::Components
|
||||
ui->led_Ptt->setOn(enabled);
|
||||
}
|
||||
|
||||
void CInfoBarStatusComponent::onAudioPtt(bool active, PTTCOM pttcom, const CIdentifier &identifier)
|
||||
{
|
||||
// those here come directly from AUDIO client,
|
||||
// we display COM1/2 directly, but COM is directly hooked up with onPttChanged
|
||||
|
||||
Q_UNUSED(identifier)
|
||||
Q_UNUSED(active)
|
||||
Q_UNUSED(pttcom)
|
||||
|
||||
/*
|
||||
if (pttcom == COM1 || pttcom == COM2)
|
||||
{
|
||||
this->onPttChanged(active);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void CInfoBarStatusComponent::updateValues()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "blackcore/actionbind.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blackmisc/audio/audiodeviceinfo.h"
|
||||
#include "blackmisc/input/actionhotkeydefs.h"
|
||||
#include "blackmisc/network/connectionstatus.h"
|
||||
@@ -95,9 +94,6 @@ namespace BlackGui::Components
|
||||
//! PTT button changed
|
||||
void onPttChanged(bool enabled);
|
||||
|
||||
//! PTT, as received in in audio
|
||||
void onAudioPtt(bool active, BlackMisc::Audio::PTTCOM pttcom, const BlackMisc::CIdentifier &identifier);
|
||||
|
||||
//! Update values
|
||||
void updateValues();
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ add_library(misc SHARED
|
||||
audio/audioutils.h
|
||||
audio/notificationsounds.cpp
|
||||
audio/notificationsounds.h
|
||||
audio/ptt.h
|
||||
audio/registermetadataaudio.cpp
|
||||
audio/registermetadataaudio.h
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_AUDIO_PTT_H
|
||||
#define BLACKMISC_AUDIO_PTT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackMisc::Audio
|
||||
{
|
||||
//! Voice COM channel
|
||||
enum PTTCOM
|
||||
{
|
||||
COM1,
|
||||
COM2,
|
||||
COMActive,
|
||||
COMUnspecified
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Audio::PTTCOM)
|
||||
|
||||
#endif // guard
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include <QDBusMetaType>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -23,7 +22,6 @@ namespace BlackMisc
|
||||
CSettings::registerMetadata();
|
||||
|
||||
// ENUMs
|
||||
qDBusRegisterMetaType<PTTCOM>();
|
||||
qDBusRegisterMetaType<CNotificationSounds::NotificationFlag>();
|
||||
qDBusRegisterMetaType<CAudioDeviceInfo::DeviceType>();
|
||||
qRegisterMetaTypeStreamOperators<CNotificationSounds::NotificationFlag>();
|
||||
|
||||
Reference in New Issue
Block a user