mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-05 06:37:51 -04:00
Tx ph.1: added device sinks list to DSP engine
This commit is contained in:
parent
e5509b5fe8
commit
9f3fec7600
@ -17,10 +17,15 @@
|
|||||||
|
|
||||||
#include <QGlobalStatic>
|
#include <QGlobalStatic>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
|
#include "dsp/dspdevicesourceengine.h"
|
||||||
|
#include "dsp/dspdevicesinkengine.h"
|
||||||
|
|
||||||
|
|
||||||
DSPEngine::DSPEngine() :
|
DSPEngine::DSPEngine() :
|
||||||
m_deviceSourceEnginesUIDSequence(0),
|
m_deviceSourceEnginesUIDSequence(0),
|
||||||
|
m_deviceSinkEnginesUIDSequence(0),
|
||||||
m_audioSampleRate(48000) // Use default output device at 48 kHz
|
m_audioSampleRate(48000) // Use default output device at 48 kHz
|
||||||
{
|
{
|
||||||
m_dvSerialSupport = false;
|
m_dvSerialSupport = false;
|
||||||
@ -63,6 +68,24 @@ void DSPEngine::removeLastDeviceSourceEngine()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DSPDeviceSinkEngine *DSPEngine::addDeviceSinkEngine()
|
||||||
|
{
|
||||||
|
m_deviceSinkEngines.push_back(new DSPDeviceSinkEngine(m_deviceSinkEnginesUIDSequence));
|
||||||
|
m_deviceSinkEnginesUIDSequence++;
|
||||||
|
return m_deviceSinkEngines.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DSPEngine::removeLastDeviceSinkEngine()
|
||||||
|
{
|
||||||
|
if (m_deviceSinkEngines.size() > 0)
|
||||||
|
{
|
||||||
|
DSPDeviceSinkEngine *lastDeviceEngine = m_deviceSinkEngines.back();
|
||||||
|
delete lastDeviceEngine;
|
||||||
|
m_deviceSinkEngines.pop_back();
|
||||||
|
m_deviceSinkEnginesUIDSequence--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DSPEngine::startAudio()
|
void DSPEngine::startAudio()
|
||||||
{
|
{
|
||||||
m_audioOutput.start(-1, m_audioSampleRate);
|
m_audioOutput.start(-1, m_audioSampleRate);
|
||||||
@ -114,6 +137,23 @@ DSPDeviceSourceEngine *DSPEngine::getDeviceSourceEngineByUID(uint uid)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DSPDeviceSinkEngine *DSPEngine::getDeviceSinkEngineByUID(uint uid)
|
||||||
|
{
|
||||||
|
std::vector<DSPDeviceSinkEngine*>::iterator it = m_deviceSinkEngines.begin();
|
||||||
|
|
||||||
|
while (it != m_deviceSinkEngines.end())
|
||||||
|
{
|
||||||
|
if ((*it)->getUID() == uid)
|
||||||
|
{
|
||||||
|
return *it;
|
||||||
|
}
|
||||||
|
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void DSPEngine::setDVSerialSupport(bool support)
|
void DSPEngine::setDVSerialSupport(bool support)
|
||||||
{
|
{
|
||||||
#ifdef DSD_USE_SERIALDV
|
#ifdef DSD_USE_SERIALDV
|
||||||
|
@ -21,14 +21,13 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "audio/audiooutput.h"
|
#include "audio/audiooutput.h"
|
||||||
#include "dspdevicesourceengine.h"
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
#ifdef DSD_USE_SERIALDV
|
#ifdef DSD_USE_SERIALDV
|
||||||
#include "dsp/dvserialengine.h"
|
#include "dsp/dvserialengine.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class DSPDeviceSourceEngine;
|
class DSPDeviceSourceEngine;
|
||||||
class ThreadedBasebandSampleSink;
|
class DSPDeviceSinkEngine;
|
||||||
|
|
||||||
class SDRANGEL_API DSPEngine : public QObject {
|
class SDRANGEL_API DSPEngine : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -43,6 +42,9 @@ public:
|
|||||||
DSPDeviceSourceEngine *addDeviceSourceEngine();
|
DSPDeviceSourceEngine *addDeviceSourceEngine();
|
||||||
void removeLastDeviceSourceEngine();
|
void removeLastDeviceSourceEngine();
|
||||||
|
|
||||||
|
DSPDeviceSinkEngine *addDeviceSinkEngine();
|
||||||
|
void removeLastDeviceSinkEngine();
|
||||||
|
|
||||||
void startAudio();
|
void startAudio();
|
||||||
void stopAudio();
|
void stopAudio();
|
||||||
void startAudioImmediate();
|
void startAudioImmediate();
|
||||||
@ -51,7 +53,10 @@ public:
|
|||||||
DSPDeviceSourceEngine *getDeviceSourceEngineByIndex(uint deviceIndex) { return m_deviceSourceEngines[deviceIndex]; }
|
DSPDeviceSourceEngine *getDeviceSourceEngineByIndex(uint deviceIndex) { return m_deviceSourceEngines[deviceIndex]; }
|
||||||
DSPDeviceSourceEngine *getDeviceSourceEngineByUID(uint uid);
|
DSPDeviceSourceEngine *getDeviceSourceEngineByUID(uint uid);
|
||||||
|
|
||||||
void addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink
|
DSPDeviceSinkEngine *getDeviceSinkEngineByIndex(uint deviceIndex) { return m_deviceSinkEngines[deviceIndex]; }
|
||||||
|
DSPDeviceSinkEngine *getDeviceSinkEngineByUID(uint uid);
|
||||||
|
|
||||||
|
void addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink
|
||||||
void removeAudioSink(AudioFifo* audioFifo); //!< Remove the audio sink
|
void removeAudioSink(AudioFifo* audioFifo); //!< Remove the audio sink
|
||||||
|
|
||||||
// Serial DV methods:
|
// Serial DV methods:
|
||||||
@ -84,6 +89,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::vector<DSPDeviceSourceEngine*> m_deviceSourceEngines;
|
std::vector<DSPDeviceSourceEngine*> m_deviceSourceEngines;
|
||||||
uint m_deviceSourceEnginesUIDSequence;
|
uint m_deviceSourceEnginesUIDSequence;
|
||||||
|
std::vector<DSPDeviceSinkEngine*> m_deviceSinkEngines;
|
||||||
|
uint m_deviceSinkEnginesUIDSequence;
|
||||||
AudioOutput m_audioOutput;
|
AudioOutput m_audioOutput;
|
||||||
uint m_audioSampleRate;
|
uint m_audioSampleRate;
|
||||||
bool m_dvSerialSupport;
|
bool m_dvSerialSupport;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user