mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-04 10:38:45 -04:00
Use new audio fifo based on audio sample type
This commit is contained in:
parent
f104f217f9
commit
511686f820
@ -34,7 +34,7 @@ AMDemod::AMDemod() :
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(2400, 1.0),
|
||||
m_audioFifo(4, 48000),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("AMDemod");
|
||||
|
@ -36,7 +36,7 @@ const Real BFMDemod::default_deemphasis = 50.0; // 50 us
|
||||
|
||||
BFMDemod::BFMDemod(BasebandSampleSink* sampleSink, RDSParser *rdsParser) :
|
||||
m_sampleSink(sampleSink),
|
||||
m_audioFifo(4, 250000),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_pilotPLL(19000/384000, 50/384000, 0.01),
|
||||
m_rdsParser(rdsParser),
|
||||
|
@ -38,8 +38,8 @@ DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) :
|
||||
m_squelchOpen(false),
|
||||
m_movingAverage(40, 0),
|
||||
m_fmExcursion(24),
|
||||
m_audioFifo1(4, 48000),
|
||||
m_audioFifo2(4, 48000),
|
||||
m_audioFifo1(48000),
|
||||
m_audioFifo2(48000),
|
||||
m_scope(sampleSink),
|
||||
m_scopeEnabled(true),
|
||||
m_dsdDecoder(),
|
||||
|
@ -47,7 +47,7 @@ NFMDemod::NFMDemod() :
|
||||
m_movingAverage(40, 0),
|
||||
m_afSquelch(2, afSqTones),
|
||||
m_fmExcursion(2400),
|
||||
m_audioFifo(4, 48000),
|
||||
m_audioFifo(48000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("NFMDemod");
|
||||
|
@ -41,7 +41,7 @@ SSBDemod::SSBDemod(BasebandSampleSink* sampleSink) :
|
||||
m_agcThresholdGate(0),
|
||||
m_audioActive(false),
|
||||
m_sampleSink(sampleSink),
|
||||
m_audioFifo(4, 24000),
|
||||
m_audioFifo(24000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("SSBDemod");
|
||||
|
@ -36,7 +36,7 @@ WFMDemod::WFMDemod(BasebandSampleSink* sampleSink) :
|
||||
m_magsqCount(0),
|
||||
m_movingAverage(40, 0),
|
||||
m_sampleSink(sampleSink),
|
||||
m_audioFifo(4, 250000),
|
||||
m_audioFifo(250000),
|
||||
m_settingsMutex(QMutex::Recursive)
|
||||
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ UDPSrc::UDPSrc(MessageQueue* uiMessageQueue, UDPSrcGUI* udpSrcGUI, BasebandSampl
|
||||
m_outMovingAverage(480, 1e-10),
|
||||
m_inMovingAverage(480, 1e-10),
|
||||
m_amMovingAverage(1200, 1e-10),
|
||||
m_audioFifo(4, 24000),
|
||||
m_audioFifo(24000),
|
||||
m_squelchOpen(false),
|
||||
m_squelchOpenCount(0),
|
||||
m_squelchCloseCount(0),
|
||||
|
@ -38,7 +38,7 @@ const int AMMod::m_levelNbSamples = 480; // every 10ms
|
||||
AMMod::AMMod() :
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(40, 0),
|
||||
m_audioFifo(4, 4800),
|
||||
m_audioFifo(4800),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_fileSize(0),
|
||||
m_recordLength(0),
|
||||
|
@ -39,7 +39,7 @@ NFMMod::NFMMod() :
|
||||
m_modPhasor(0.0f),
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(40, 0),
|
||||
m_audioFifo(4, 4800),
|
||||
m_audioFifo(4800),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_fileSize(0),
|
||||
m_recordLength(0),
|
||||
|
@ -46,7 +46,7 @@ SSBMod::SSBMod(BasebandSampleSink* sampleSink) :
|
||||
m_DSBFilterBufferIndex(0),
|
||||
m_sampleSink(sampleSink),
|
||||
m_movingAverage(40, 0),
|
||||
m_audioFifo(4, 4800),
|
||||
m_audioFifo(4800),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_fileSize(0),
|
||||
m_recordLength(0),
|
||||
|
@ -40,7 +40,7 @@ WFMMod::WFMMod() :
|
||||
m_modPhasor(0.0f),
|
||||
m_movingAverage(40, 0),
|
||||
m_volumeAGC(40, 0),
|
||||
m_audioFifo(4, 4800),
|
||||
m_audioFifo(4800),
|
||||
m_settingsMutex(QMutex::Recursive),
|
||||
m_fileSize(0),
|
||||
m_recordLength(0),
|
||||
|
@ -34,7 +34,7 @@ AudioFifo::AudioFifo() :
|
||||
m_tail = 0;
|
||||
}
|
||||
|
||||
AudioFifo::AudioFifo(uint32_t sampleSize, uint32_t numSamples) :
|
||||
AudioFifo::AudioFifo(uint32_t numSamples) :
|
||||
m_fifo(0),
|
||||
m_sampleSize(sizeof(AudioSample)),
|
||||
m_udpSink(0),
|
||||
@ -42,7 +42,7 @@ AudioFifo::AudioFifo(uint32_t sampleSize, uint32_t numSamples) :
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
create(sampleSize, numSamples);
|
||||
create(numSamples);
|
||||
}
|
||||
|
||||
AudioFifo::~AudioFifo()
|
||||
@ -61,11 +61,11 @@ AudioFifo::~AudioFifo()
|
||||
m_size = 0;
|
||||
}
|
||||
|
||||
bool AudioFifo::setSize(uint32_t sampleSize, uint32_t numSamples)
|
||||
bool AudioFifo::setSize(uint32_t numSamples)
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
return create(sampleSize, numSamples);
|
||||
return create(numSamples);
|
||||
}
|
||||
|
||||
uint AudioFifo::write(const quint8* data, uint32_t numSamples, int timeout_ms)
|
||||
@ -258,7 +258,7 @@ void AudioFifo::clear()
|
||||
m_writeWaitCondition.wakeOne();
|
||||
}
|
||||
|
||||
bool AudioFifo::create(uint32_t sampleSize, uint32_t numSamples)
|
||||
bool AudioFifo::create(uint32_t numSamples)
|
||||
{
|
||||
if(m_fifo != 0)
|
||||
{
|
||||
|
@ -28,10 +28,10 @@ class SDRANGEL_API AudioFifo : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioFifo();
|
||||
AudioFifo(uint32_t sampleSize, uint32_t numSamples);
|
||||
AudioFifo(uint32_t numSamples);
|
||||
~AudioFifo();
|
||||
|
||||
bool setSize(uint32_t sampleSize, uint32_t numSamples);
|
||||
bool setSize(uint32_t numSamples);
|
||||
|
||||
uint32_t write(const quint8* data, uint32_t numSamples, int timeout_ms = INT_MAX);
|
||||
uint32_t read(quint8* data, uint32_t numSamples, int timeout_ms = INT_MAX);
|
||||
@ -68,7 +68,7 @@ private:
|
||||
UDPSink<qint16> *m_udpSink;
|
||||
bool m_copyToUDP;
|
||||
|
||||
bool create(uint32_t sampleSize, uint32_t numSamples);
|
||||
bool create(uint32_t numSamples);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_AUDIOFIFO_H
|
||||
|
Loading…
Reference in New Issue
Block a user