Audio CAT SISO: removed reference to Audio input and output devices

pull/1744/head
f4exb 2023-07-10 11:49:52 +02:00
rodzic df917bb489
commit 249cb476c0
4 zmienionych plików z 25 dodań i 5 usunięć

Wyświetl plik

@ -488,7 +488,8 @@ void AudioCATSISO::applySettings(const AudioCATSISOSettings& settings, const QLi
if (settingsKeys.contains("rxVolume") || force) if (settingsKeys.contains("rxVolume") || force)
{ {
m_audioInput.setVolume(settings.m_rxVolume); AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();
audioDeviceManager->setInputDeviceVolume(settings.m_rxVolume, m_rxAudioDeviceIndex);
qDebug() << "AudioCATSISO::applySettings: set Rx volume to " << settings.m_rxVolume; qDebug() << "AudioCATSISO::applySettings: set Rx volume to " << settings.m_rxVolume;
} }

Wyświetl plik

@ -25,8 +25,6 @@
#include <QThread> #include <QThread>
#include "dsp/devicesamplemimo.h" #include "dsp/devicesamplemimo.h"
#include "audio/audioinputdevice.h"
#include "audio/audiooutputdevice.h"
#include "audio/audiofifo.h" #include "audio/audiofifo.h"
#include "audiocatsisosettings.h" #include "audiocatsisosettings.h"
#include "audiocatsisohamlib.h" #include "audiocatsisohamlib.h"
@ -161,9 +159,7 @@ private:
}; };
DeviceAPI *m_deviceAPI; DeviceAPI *m_deviceAPI;
AudioInputDevice m_audioInput;
AudioFifo m_inputFifo; AudioFifo m_inputFifo;
AudioOutputDevice m_audioOutput;
AudioFifo m_outputFifo; AudioFifo m_outputFifo;
QMutex m_mutex; QMutex m_mutex;
AudioCATSISOSettings m_settings; AudioCATSISOSettings m_settings;

Wyświetl plik

@ -839,6 +839,27 @@ void AudioDeviceManager::outputInfosCleanup()
} }
} }
bool AudioDeviceManager::setInputDeviceVolume(float volume, int inputDeviceIndex)
{
if (m_audioInputs.find(inputDeviceIndex) == m_audioInputs.end()) { // no FIFO registered yet hence no audio input has been allocated yet
return false;
}
m_audioInputs[inputDeviceIndex]->setVolume(volume);
return true;
}
bool AudioDeviceManager::setOutputDeviceVolume(float volume, int outputDeviceIndex)
{
if (m_audioOutputs.find(outputDeviceIndex) == m_audioOutputs.end()) { // no FIFO registered yet hence no audio output has been allocated yet
return false;
}
m_audioOutputs[outputDeviceIndex]->setVolume(volume);
return true;
}
void AudioDeviceManager::debugAudioInputInfos() const void AudioDeviceManager::debugAudioInputInfos() const
{ {
QMap<QString, InputDeviceInfo>::const_iterator it = m_audioInputInfos.begin(); QMap<QString, InputDeviceInfo>::const_iterator it = m_audioInputInfos.begin();

Wyświetl plik

@ -124,6 +124,8 @@ public:
void unsetOutputDeviceInfo(int outputDeviceIndex); void unsetOutputDeviceInfo(int outputDeviceIndex);
void inputInfosCleanup(); //!< Remove input info from map for input devices not present void inputInfosCleanup(); //!< Remove input info from map for input devices not present
void outputInfosCleanup(); //!< Remove output info from map for output devices not present void outputInfosCleanup(); //!< Remove output info from map for output devices not present
bool setInputDeviceVolume(float volume, int inputDeviceIndex);
bool setOutputDeviceVolume(float volume, int outputDeviceIndex);
static const int m_defaultAudioSampleRate = 48000; static const int m_defaultAudioSampleRate = 48000;
static const float m_defaultAudioInputVolume; static const float m_defaultAudioInputVolume;