mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
differentiate DSPConfigureAudio messages for input and output device
This commit is contained in:
parent
1ac701f01b
commit
68f6994f49
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user