mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
Ref T730, pass PTT key events to client
* currently passing from context to client, so context and client know the state * PTT enum in own file so it can be reused
This commit is contained in:
committed by
Mat Sutcliffe
parent
acde5e4f01
commit
e21fdeb039
@@ -16,6 +16,7 @@ using namespace BlackCore::Context;
|
||||
using namespace BlackCore::Afv::Audio;
|
||||
using namespace BlackCore::Afv::Connection;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackSound::SampleProvider;
|
||||
@@ -302,9 +303,14 @@ namespace BlackCore
|
||||
qDebug() << "PTT:" << active;
|
||||
}
|
||||
|
||||
void CAfvClient::setPttForCom(bool active, PTTCOM com)
|
||||
{
|
||||
this->setPtt(active);
|
||||
}
|
||||
|
||||
void CAfvClient::setInputVolumeDb(double value)
|
||||
{
|
||||
if (value > 18) { value = 18; }
|
||||
if (value > 18) { value = 18; }
|
||||
if (value < -18) { value = -18; }
|
||||
m_inputVolumeDb = value;
|
||||
m_input->setVolume(qPow(10, value / 20));
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
#include "blackcore/afv/audio/output.h"
|
||||
#include "blackcore/afv/audio/soundcardsampleprovider.h"
|
||||
#include "blackcore/afv/dto.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
|
||||
#include "blackcore/context/contextownaircraft.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
|
||||
#include "blackmisc/audio/ptt.h"
|
||||
#include "blacksound/sampleprovider/volumesampleprovider.h"
|
||||
|
||||
#include <QAudioDeviceInfo>
|
||||
@@ -87,7 +89,12 @@ namespace BlackCore
|
||||
void setTransmittingTransceivers(quint16 transceiverID);
|
||||
void setTransmittingTransceivers(const QVector<TxTransceiverDto> &transceivers);
|
||||
|
||||
//! Push to talk @{
|
||||
Q_INVOKABLE void setPtt(bool active);
|
||||
void setPttForCom(bool active, BlackMisc::Audio::PTTCOM com);
|
||||
//! @}
|
||||
|
||||
|
||||
Q_INVOKABLE void setLoopBack(bool on) { m_loopbackOn = on; }
|
||||
|
||||
//! Input volume in DB, +-18DB @{
|
||||
|
||||
Reference in New Issue
Block a user