mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
[AFV] Finalize blocking tone
Blocking tone is emitted if more than one station is received in parallel.
This commit is contained in:
committed by
Mat Sutcliffe
parent
ec0a20b1d1
commit
b8661918d7
@@ -36,9 +36,9 @@ namespace BlackCore
|
||||
m_mixer->addMixerInput(voiceInput);
|
||||
}
|
||||
|
||||
// TODO blockTone = new SignalGenerator(WaveFormat.SampleRate, 1) { Gain = 0, Type = SignalGeneratorType.Sin, Frequency = 180 };
|
||||
// TODO mixer.AddMixerInput(blockTone.ToMono());
|
||||
// TODO volume = new VolumeSampleProvider(mixer);
|
||||
m_blockTone = new CSinusGenerator(180, this);
|
||||
m_mixer->addMixerInput(m_blockTone);
|
||||
m_volume = new CVolumeSampleProvider(m_mixer);
|
||||
}
|
||||
|
||||
void CReceiverSampleProvider::setBypassEffects(bool value)
|
||||
@@ -88,12 +88,12 @@ namespace BlackCore
|
||||
|
||||
if (numberOfInUseInputs > 1)
|
||||
{
|
||||
// blockTone.Frequency = 180;
|
||||
// blockTone.Gain = blockToneGain;
|
||||
m_blockTone->setFrequency(180.0);
|
||||
m_blockTone->setGain(m_blockToneGain);
|
||||
}
|
||||
else
|
||||
{
|
||||
// blockTone.Gain = 0;
|
||||
m_blockTone->setGain(0.0);
|
||||
}
|
||||
|
||||
if (m_doClickWhenAppropriate && numberOfInUseInputs == 0)
|
||||
@@ -127,8 +127,7 @@ namespace BlackCore
|
||||
}
|
||||
m_lastNumberOfInUseInputs = numberOfInUseInputs;
|
||||
|
||||
// return volume.Read(buffer, offset, count);
|
||||
return m_mixer->readSamples(samples, count);
|
||||
return m_volume->readSamples(samples, count);
|
||||
}
|
||||
|
||||
void CReceiverSampleProvider::addOpusSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "blackcore/afv/audio/callsignsampleprovider.h"
|
||||
#include "blacksound/sampleprovider/sampleprovider.h"
|
||||
#include "blacksound/sampleprovider/mixingsampleprovider.h"
|
||||
#include "blacksound/sampleprovider/sinusgenerator.h"
|
||||
#include "blacksound/sampleprovider/volumesampleprovider.h"
|
||||
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/audio/audiosettings.h"
|
||||
@@ -89,9 +91,9 @@ namespace BlackCore
|
||||
quint16 m_id;
|
||||
BlackMisc::CSettingReadOnly<BlackMisc::Audio::TSettings> m_audioSettings { this };
|
||||
|
||||
// TODO VolumeSampleProvider volume;
|
||||
BlackSound::SampleProvider::CVolumeSampleProvider *m_volume = nullptr;
|
||||
BlackSound::SampleProvider::CMixingSampleProvider *m_mixer = nullptr;
|
||||
// TODO SignalGenerator blockTone;
|
||||
BlackSound::SampleProvider::CSinusGenerator *m_blockTone = nullptr;
|
||||
QVector<CallsignSampleProvider *> m_voiceInputs;
|
||||
|
||||
QString m_receivingCallsignsString;
|
||||
|
||||
Reference in New Issue
Block a user