mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 08:24:43 -04:00
Tx ph.1: added device sinks list to DSP engine
This commit is contained in:
@@ -17,10 +17,15 @@
|
||||
|
||||
#include <QGlobalStatic>
|
||||
#include <QThread>
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspdevicesourceengine.h"
|
||||
#include "dsp/dspdevicesinkengine.h"
|
||||
|
||||
|
||||
DSPEngine::DSPEngine() :
|
||||
m_deviceSourceEnginesUIDSequence(0),
|
||||
m_deviceSinkEnginesUIDSequence(0),
|
||||
m_audioSampleRate(48000) // Use default output device at 48 kHz
|
||||
{
|
||||
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()
|
||||
{
|
||||
m_audioOutput.start(-1, m_audioSampleRate);
|
||||
@@ -114,6 +137,23 @@ DSPDeviceSourceEngine *DSPEngine::getDeviceSourceEngineByUID(uint uid)
|
||||
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)
|
||||
{
|
||||
#ifdef DSD_USE_SERIALDV
|
||||
|
||||
Reference in New Issue
Block a user