diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index 3ee1c62c3..90b383ee5 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -576,7 +576,7 @@ void FreeDVDemod::applyFreeDVMode(FreeDVDemodSettings::FreeDVMode mode) if (getMessageQueueToGUI()) { - DSPConfigureAudio *cfg = new DSPConfigureAudio(m_modemSampleRate); + DSPConfigureAudio *cfg = new DSPConfigureAudio(m_modemSampleRate, DSPConfigureAudio::AudioOutput); getMessageQueueToGUI()->push(cfg); } } diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index afe9f4db0..8a64cb445 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -450,7 +450,7 @@ void SSBDemod::applyAudioSampleRate(int sampleRate) if (m_guiMessageQueue) // forward to GUI if any { - DSPConfigureAudio *cfg = new DSPConfigureAudio(m_audioSampleRate); + DSPConfigureAudio *cfg = new DSPConfigureAudio(m_audioSampleRate, DSPConfigureAudio::AudioOutput); m_guiMessageQueue->push(cfg); } } diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index 4cff2888f..5ca596d5b 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -639,7 +639,7 @@ void FreeDVMod::applyFreeDVMode(FreeDVModSettings::FreeDVMode mode) if (getMessageQueueToGUI()) { - DSPConfigureAudio *cfg = new DSPConfigureAudio(m_modemSampleRate); + DSPConfigureAudio *cfg = new DSPConfigureAudio(m_modemSampleRate, DSPConfigureAudio::AudioInput); getMessageQueueToGUI()->push(cfg); } } diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 3ff0e6334..f14d2fa1c 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -724,7 +724,7 @@ void SSBMod::applyAudioSampleRate(int sampleRate) if (getMessageQueueToGUI()) { - DSPConfigureAudio *cfg = new DSPConfigureAudio(m_audioSampleRate); + DSPConfigureAudio *cfg = new DSPConfigureAudio(m_audioSampleRate, DSPConfigureAudio::AudioInput); getMessageQueueToGUI()->push(cfg); } } diff --git a/sdrbase/audio/audiodevicemanager.cpp b/sdrbase/audio/audiodevicemanager.cpp index 4f1c34619..1541094f7 100644 --- a/sdrbase/audio/audiodevicemanager.cpp +++ b/sdrbase/audio/audiodevicemanager.cpp @@ -558,7 +558,7 @@ void AudioDeviceManager::setInputDeviceInfo(int inputDeviceIndex, const InputDev for (; it != m_inputDeviceSourceMessageQueues[inputDeviceIndex].end(); ++it) { - DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioInputInfos[deviceName].sampleRate); + DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioInputInfos[deviceName].sampleRate, DSPConfigureAudio::AudioInput); (*it)->push(msg); } } @@ -605,7 +605,7 @@ void AudioDeviceManager::setOutputDeviceInfo(int outputDeviceIndex, const Output for (; it != m_outputDeviceSinkMessageQueues[outputDeviceIndex].end(); ++it) { - DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioOutputInfos[deviceName].sampleRate); + DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioOutputInfos[deviceName].sampleRate, DSPConfigureAudio::AudioOutput); (*it)->push(msg); } } @@ -655,7 +655,7 @@ void AudioDeviceManager::unsetOutputDeviceInfo(int outputDeviceIndex) for (; it != m_outputDeviceSinkMessageQueues[outputDeviceIndex].end(); ++it) { - DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioOutputInfos[deviceName].sampleRate); + DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioOutputInfos[deviceName].sampleRate, DSPConfigureAudio::AudioOutput); (*it)->push(msg); } } @@ -695,7 +695,7 @@ void AudioDeviceManager::unsetInputDeviceInfo(int inputDeviceIndex) for (; it != m_inputDeviceSourceMessageQueues[inputDeviceIndex].end(); ++it) { - DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioInputInfos[deviceName].sampleRate); + DSPConfigureAudio *msg = new DSPConfigureAudio(m_audioInputInfos[deviceName].sampleRate, DSPConfigureAudio::AudioInput); (*it)->push(msg); } } diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index 12e5403c7..0700530ea 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -376,13 +376,23 @@ class SDRBASE_API DSPConfigureAudio : public Message { MESSAGE_CLASS_DECLARATION public: - DSPConfigureAudio(int sampleRate) : m_sampleRate(sampleRate) + enum AudioType + { + AudioInput, + AudioOutput + }; + + DSPConfigureAudio(int sampleRate, AudioType audioType) : + m_sampleRate(sampleRate), + m_autioType(audioType) { } int getSampleRate() const { return m_sampleRate; } + bool getAudioType() const { return m_autioType; } private: int m_sampleRate; + AudioType m_autioType; }; #endif // INCLUDE_DSPCOMMANDS_H