diff --git a/plugins/samplesource/fcdpro/fcdproinput.cpp b/plugins/samplesource/fcdpro/fcdproinput.cpp index 033107a60..ef85a8fda 100644 --- a/plugins/samplesource/fcdpro/fcdproinput.cpp +++ b/plugins/samplesource/fcdpro/fcdproinput.cpp @@ -176,11 +176,13 @@ bool FCDProInput::openFCDAudio(const char* cardname) if (itAudio.deviceName().contains(QString(cardname))) { int fcdDeviceIndex = audioDeviceManager->getInputDeviceIndex(itAudio.deviceName()); - m_fcdAudioInput.start(fcdDeviceIndex, fcd_traits::sampleRate); - int fcdSampleRate = m_fcdAudioInput.getRate(); - qDebug("FCDProPlusInput::openFCDAudio: %s index %d at %d S/s", - itAudio.deviceName().toStdString().c_str(), fcdDeviceIndex, fcdSampleRate); - m_fcdAudioInput.addFifo(&m_fcdFIFO); + AudioDeviceManager::InputDeviceInfo fcdDeviceInfo; + audioDeviceManager->getInputDeviceInfo(itAudio.deviceName(), fcdDeviceInfo); + fcdDeviceInfo.sampleRate = fcd_traits::sampleRate; + audioDeviceManager->setInputDeviceInfo(fcdDeviceIndex, fcdDeviceInfo); + audioDeviceManager->addAudioSource(&m_fcdFIFO, getInputMessageQueue(), fcdDeviceIndex); + qDebug("FCDProPlusInput::openFCDAudio: %s index %d", + itAudio.deviceName().toStdString().c_str(), fcdDeviceIndex); return true; } } @@ -191,8 +193,8 @@ bool FCDProInput::openFCDAudio(const char* cardname) void FCDProInput::closeFCDAudio() { - m_fcdAudioInput.removeFifo(&m_fcdFIFO); - m_fcdAudioInput.stop(); + AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager(); + audioDeviceManager->removeAudioSource(&m_fcdFIFO); } void FCDProInput::stop() diff --git a/plugins/samplesource/fcdpro/fcdproinput.h b/plugins/samplesource/fcdpro/fcdproinput.h index 88c0c8566..8322bfd00 100644 --- a/plugins/samplesource/fcdpro/fcdproinput.h +++ b/plugins/samplesource/fcdpro/fcdproinput.h @@ -25,7 +25,6 @@ #include #include "dsp/devicesamplesource.h" -#include "audio/audioinputdevice.h" #include "audio/audiofifo.h" #include "fcdprosettings.h" @@ -158,7 +157,6 @@ public: private: DeviceAPI *m_deviceAPI; hid_device *m_dev; - AudioInputDevice m_fcdAudioInput; AudioFifo m_fcdFIFO; QMutex m_mutex; FCDProSettings m_settings; diff --git a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp index ba3a50804..4eb36d9f7 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp @@ -178,11 +178,13 @@ bool FCDProPlusInput::openFCDAudio(const char* cardname) if (itAudio.deviceName().contains(QString(cardname))) { int fcdDeviceIndex = audioDeviceManager->getInputDeviceIndex(itAudio.deviceName()); - m_fcdAudioInput.start(fcdDeviceIndex, fcd_traits::sampleRate); - int fcdSampleRate = m_fcdAudioInput.getRate(); - qDebug("FCDProPlusInput::openFCDAudio: %s index %d at %d S/s", - itAudio.deviceName().toStdString().c_str(), fcdDeviceIndex, fcdSampleRate); - m_fcdAudioInput.addFifo(&m_fcdFIFO); + AudioDeviceManager::InputDeviceInfo fcdDeviceInfo; + audioDeviceManager->getInputDeviceInfo(itAudio.deviceName(), fcdDeviceInfo); + fcdDeviceInfo.sampleRate = fcd_traits::sampleRate; + audioDeviceManager->setInputDeviceInfo(fcdDeviceIndex, fcdDeviceInfo); + audioDeviceManager->addAudioSource(&m_fcdFIFO, getInputMessageQueue(), fcdDeviceIndex); + qDebug("FCDProPlusInput::openFCDAudio: %s index %d", + itAudio.deviceName().toStdString().c_str(), fcdDeviceIndex); return true; } } @@ -193,8 +195,8 @@ bool FCDProPlusInput::openFCDAudio(const char* cardname) void FCDProPlusInput::closeFCDAudio() { - m_fcdAudioInput.removeFifo(&m_fcdFIFO); - m_fcdAudioInput.stop(); + AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager(); + audioDeviceManager->removeAudioSource(&m_fcdFIFO); } void FCDProPlusInput::stop() diff --git a/plugins/samplesource/fcdproplus/fcdproplusinput.h b/plugins/samplesource/fcdproplus/fcdproplusinput.h index 034069435..d24e45db2 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinput.h +++ b/plugins/samplesource/fcdproplus/fcdproplusinput.h @@ -25,7 +25,6 @@ #include #include "dsp/devicesamplesource.h" -#include "audio/audioinputdevice.h" #include "audio/audiofifo.h" #include "fcdproplussettings.h" @@ -148,7 +147,6 @@ public: private: DeviceAPI *m_deviceAPI; hid_device *m_dev; - AudioInputDevice m_fcdAudioInput; AudioFifo m_fcdFIFO; QMutex m_mutex; FCDProPlusSettings m_settings; diff --git a/sdrbase/audio/audioinputdevice.h b/sdrbase/audio/audioinputdevice.h index 8becaddfb..f7341e803 100644 --- a/sdrbase/audio/audioinputdevice.h +++ b/sdrbase/audio/audioinputdevice.h @@ -149,8 +149,6 @@ private: friend class AudioOutputPipe; friend class AudioInput; - friend class FCDProInput; - friend class FCDProPlusInput; private slots: void handleInputMessages();