mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Add methods to read received callsigns from AFV
ref T729
This commit is contained in:
committed by
Mat Sutcliffe
parent
d9dcadcffa
commit
7ac962ed77
@@ -123,12 +123,13 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
m_receivingCallsigns = receivingCallsigns.join(',');
|
||||
TransceiverReceivingCallsignsChangedArgs args = { m_id, receivingCallsigns };
|
||||
emit receivingCallsignsChanged(args);
|
||||
}
|
||||
lastNumberOfInUseInputs = numberOfInUseInputs;
|
||||
|
||||
// return volume.Read(buffer, offset, count);
|
||||
// return volume.Read(buffer, offset, count);
|
||||
return m_mixer->readSamples(samples, count);
|
||||
}
|
||||
|
||||
@@ -199,6 +200,11 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
QString ReceiverSampleProvider::getReceivingCallsigns() const
|
||||
{
|
||||
return m_receivingCallsigns;
|
||||
}
|
||||
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace BlackCore
|
||||
void addSilentSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio);
|
||||
|
||||
quint16 getId() const { return m_id; }
|
||||
QString getReceivingCallsigns() const;
|
||||
|
||||
signals:
|
||||
void receivingCallsignsChanged(const TransceiverReceivingCallsignsChangedArgs &args);
|
||||
@@ -69,6 +70,7 @@ namespace BlackCore
|
||||
MixingSampleProvider *m_mixer;
|
||||
// TODO SignalGenerator blockTone;
|
||||
QVector<CallsignSampleProvider *> m_voiceInputs;
|
||||
QString m_receivingCallsigns;
|
||||
|
||||
bool m_doClickWhenAppropriate = false;
|
||||
int lastNumberOfInUseInputs = 0;
|
||||
|
||||
@@ -173,6 +173,11 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
QString SoundcardSampleProvider::getReceivingCallsigns(quint16 transceiverID)
|
||||
{
|
||||
return m_receiverInputs.at(transceiverID)->getReceivingCallsigns();
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace BlackCore
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
void addOpusSamples(const IAudioDto &audioDto, const QVector<RxTransceiverDto> &rxTransceivers);
|
||||
void updateRadioTransceivers(const QVector<TransceiverDto> &radioTransceivers);
|
||||
QString getReceivingCallsigns(quint16 transceiverID);
|
||||
|
||||
signals:
|
||||
void receivingCallsignsChanged(const TransceiverReceivingCallsignsChangedArgs &args);
|
||||
|
||||
@@ -347,6 +347,24 @@ namespace BlackCore
|
||||
emit outputVolumePeakVU(m_outputVolumeStream.PeakVU);
|
||||
}
|
||||
|
||||
QString AFVClient::getReceivingCallsignsCom1()
|
||||
{
|
||||
if (soundcardSampleProvider)
|
||||
{
|
||||
return soundcardSampleProvider->getReceivingCallsigns(0);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
QString AFVClient::getReceivingCallsignsCom2()
|
||||
{
|
||||
if (soundcardSampleProvider)
|
||||
{
|
||||
return soundcardSampleProvider->getReceivingCallsigns(1);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void AFVClient::updateTransceiversFromContext(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace BlackCore
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(float inputVolumePeakVU READ getInputVolumePeakVU NOTIFY inputVolumePeakVU)
|
||||
Q_PROPERTY(float outputVolumePeakVU READ getOutputVolumePeakVU NOTIFY outputVolumePeakVU)
|
||||
Q_PROPERTY(QString receivingCallsignsCom1 READ getReceivingCallsignsCom1 NOTIFY receivingCallsignsChanged)
|
||||
Q_PROPERTY(QString receivingCallsignsCom2 READ getReceivingCallsignsCom2 NOTIFY receivingCallsignsChanged)
|
||||
|
||||
public:
|
||||
//! Ctor
|
||||
@@ -96,7 +98,7 @@ namespace BlackCore
|
||||
float getOutputVolumePeakVU() const { return m_outputVolumeStream.PeakVU; }
|
||||
|
||||
signals:
|
||||
void receivingCallsignsChanged(const Audio::TransceiverReceivingCallsignsChangedArgs &args);
|
||||
void receivingCallsignsChanged(const TransceiverReceivingCallsignsChangedArgs &args);
|
||||
void inputVolumePeakVU(float value);
|
||||
void outputVolumePeakVU(float value);
|
||||
|
||||
@@ -105,6 +107,8 @@ namespace BlackCore
|
||||
void audioOutDataAvailable(const AudioRxOnTransceiversDto &dto);
|
||||
void inputVolumeStream(const Audio::InputVolumeStreamArgs &args);
|
||||
void outputVolumeStream(const Audio::OutputVolumeStreamArgs &args);
|
||||
QString getReceivingCallsignsCom1();
|
||||
QString getReceivingCallsignsCom2();
|
||||
|
||||
void input_OpusDataAvailable();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user