mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
AFV initial commit
This commit is contained in:
committed by
Mat Sutcliffe
parent
7030302e73
commit
b5a2f2ad13
59
src/blackcore/afv/audio/receiversampleprovider.h
Normal file
59
src/blackcore/afv/audio/receiversampleprovider.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#ifndef RECEIVERSAMPLEPROVIDER_H
|
||||
#define RECEIVERSAMPLEPROVIDER_H
|
||||
|
||||
#include "callsignsampleprovider.h"
|
||||
#include "blacksound/sampleprovider/sampleprovider.h"
|
||||
#include "blacksound/sampleprovider/mixingsampleprovider.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
struct TransceiverReceivingCallsignsChangedArgs
|
||||
{
|
||||
quint16 transceiverID;
|
||||
QStringList receivingCallsigns;
|
||||
};
|
||||
|
||||
class ReceiverSampleProvider : public ISampleProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ReceiverSampleProvider(const QAudioFormat &audioFormat, quint16 id, int voiceInputNumber, QObject *parent = nullptr);
|
||||
|
||||
void setBypassEffects(bool value);
|
||||
void setFrequency(const uint &frequency);
|
||||
int activeCallsigns() const;
|
||||
float volume() const;
|
||||
|
||||
bool getMute() const;
|
||||
void setMute(bool value);
|
||||
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
|
||||
void addOpusSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio);
|
||||
void addSilentSamples(const IAudioDto &audioDto, uint frequency, float distanceRatio);
|
||||
|
||||
quint16 getId() const;
|
||||
|
||||
signals:
|
||||
void receivingCallsignsChanged(const TransceiverReceivingCallsignsChangedArgs &args);
|
||||
|
||||
private:
|
||||
uint m_frequency = 122800;
|
||||
bool m_mute = false;
|
||||
|
||||
const float m_clickGain = 1.0f;
|
||||
const double m_blockToneGain = 0.10f;
|
||||
|
||||
quint16 m_id;
|
||||
|
||||
// TODO VolumeSampleProvider volume;
|
||||
MixingSampleProvider *m_mixer;
|
||||
// TODO SignalGenerator blockTone;
|
||||
QVector<CallsignSampleProvider *> m_voiceInputs;
|
||||
|
||||
bool m_doClickWhenAppropriate = false;
|
||||
int lastNumberOfInUseInputs = 0;
|
||||
};
|
||||
|
||||
#endif // RECEIVERSAMPLEPROVIDER_H
|
||||
Reference in New Issue
Block a user