mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 08:04:49 -05:00
Multiple audio support: renamed AudioDeviceInfo to AudioDeviceManager
This commit is contained in:
parent
f85111251b
commit
e2aabde641
@ -3,7 +3,7 @@ project (sdrbase)
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
|
||||
|
||||
set(sdrbase_SOURCES
|
||||
audio/audiodeviceinfo.cpp
|
||||
audio/audiodevicemanager.cpp
|
||||
audio/audiofifo.cpp
|
||||
audio/audiooutput.cpp
|
||||
audio/audioinput.cpp
|
||||
@ -84,7 +84,7 @@ set(sdrbase_SOURCES
|
||||
)
|
||||
|
||||
set(sdrbase_HEADERS
|
||||
audio/audiodeviceinfo.h
|
||||
audio/audiodevicemanager.h
|
||||
audio/audiofifo.h
|
||||
audio/audiooutput.h
|
||||
audio/audioinput.h
|
||||
|
@ -15,10 +15,10 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "audio/audiodeviceinfo.h"
|
||||
#include <audio/audiodevicemanager.h>
|
||||
#include "util/simpleserializer.h"
|
||||
|
||||
AudioDeviceInfo::AudioDeviceInfo() :
|
||||
AudioDeviceManager::AudioDeviceManager() :
|
||||
m_inputDeviceIndex(-1), // default device
|
||||
m_outputDeviceIndex(-1), // default device
|
||||
m_audioOutputSampleRate(48000), // Use default output device at 48 kHz
|
||||
@ -29,14 +29,14 @@ AudioDeviceInfo::AudioDeviceInfo() :
|
||||
m_outputDevicesInfo = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::resetToDefaults()
|
||||
void AudioDeviceManager::resetToDefaults()
|
||||
{
|
||||
m_inputDeviceIndex = -1;
|
||||
m_outputDeviceIndex = -1;
|
||||
m_inputVolume = 1.0f;
|
||||
}
|
||||
|
||||
QByteArray AudioDeviceInfo::serialize() const
|
||||
QByteArray AudioDeviceManager::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
s.writeS32(1, m_inputDeviceIndex);
|
||||
@ -45,7 +45,7 @@ QByteArray AudioDeviceInfo::serialize() const
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool AudioDeviceInfo::deserialize(const QByteArray& data)
|
||||
bool AudioDeviceManager::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
||||
@ -68,87 +68,87 @@ bool AudioDeviceInfo::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::setInputDeviceIndex(int inputDeviceIndex)
|
||||
void AudioDeviceManager::setInputDeviceIndex(int inputDeviceIndex)
|
||||
{
|
||||
int nbDevices = m_inputDevicesInfo.size();
|
||||
m_inputDeviceIndex = inputDeviceIndex < -1 ? -1 : inputDeviceIndex >= nbDevices ? nbDevices-1 : inputDeviceIndex;
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::setOutputDeviceIndex(int outputDeviceIndex)
|
||||
void AudioDeviceManager::setOutputDeviceIndex(int outputDeviceIndex)
|
||||
{
|
||||
int nbDevices = m_outputDevicesInfo.size();
|
||||
m_outputDeviceIndex = outputDeviceIndex < -1 ? -1 : outputDeviceIndex >= nbDevices ? nbDevices-1 : outputDeviceIndex;
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::setInputVolume(float inputVolume)
|
||||
void AudioDeviceManager::setInputVolume(float inputVolume)
|
||||
{
|
||||
m_inputVolume = inputVolume < 0.0 ? 0.0 : inputVolume > 1.0 ? 1.0 : inputVolume;
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::addAudioSink(AudioFifo* audioFifo)
|
||||
void AudioDeviceManager::addAudioSink(AudioFifo* audioFifo)
|
||||
{
|
||||
qDebug("AudioDeviceInfo::addAudioSink");
|
||||
m_audioOutput.addFifo(audioFifo);
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::removeAudioSink(AudioFifo* audioFifo)
|
||||
void AudioDeviceManager::removeAudioSink(AudioFifo* audioFifo)
|
||||
{
|
||||
qDebug("AudioDeviceInfo::removeAudioSink");
|
||||
m_audioOutput.removeFifo(audioFifo);
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::addAudioSource(AudioFifo* audioFifo)
|
||||
void AudioDeviceManager::addAudioSource(AudioFifo* audioFifo)
|
||||
{
|
||||
qDebug("AudioDeviceInfo::addAudioSource");
|
||||
m_audioInput.addFifo(audioFifo);
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::removeAudioSource(AudioFifo* audioFifo)
|
||||
void AudioDeviceManager::removeAudioSource(AudioFifo* audioFifo)
|
||||
{
|
||||
qDebug("AudioDeviceInfo::removeAudioSource");
|
||||
m_audioInput.removeFifo(audioFifo);
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::startAudioOutput()
|
||||
void AudioDeviceManager::startAudioOutput()
|
||||
{
|
||||
m_audioOutput.start(m_outputDeviceIndex, m_audioOutputSampleRate);
|
||||
m_audioOutputSampleRate = m_audioOutput.getRate(); // update with actual rate
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::stopAudioOutput()
|
||||
void AudioDeviceManager::stopAudioOutput()
|
||||
{
|
||||
m_audioOutput.stop();
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::startAudioOutputImmediate()
|
||||
void AudioDeviceManager::startAudioOutputImmediate()
|
||||
{
|
||||
m_audioOutput.startImmediate(m_outputDeviceIndex, m_audioOutputSampleRate);
|
||||
m_audioOutputSampleRate = m_audioOutput.getRate(); // update with actual rate
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::stopAudioOutputImmediate()
|
||||
void AudioDeviceManager::stopAudioOutputImmediate()
|
||||
{
|
||||
m_audioOutput.stopImmediate();
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::startAudioInput()
|
||||
void AudioDeviceManager::startAudioInput()
|
||||
{
|
||||
m_audioInput.start(m_inputDeviceIndex, m_audioInputSampleRate);
|
||||
m_audioInputSampleRate = m_audioInput.getRate(); // update with actual rate
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::stopAudioInput()
|
||||
void AudioDeviceManager::stopAudioInput()
|
||||
{
|
||||
m_audioInput.stop();
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::startAudioInputImmediate()
|
||||
void AudioDeviceManager::startAudioInputImmediate()
|
||||
{
|
||||
m_audioInput.startImmediate(m_inputDeviceIndex, m_audioInputSampleRate);
|
||||
m_audioInputSampleRate = m_audioInput.getRate(); // update with actual rate
|
||||
}
|
||||
|
||||
void AudioDeviceInfo::stopAudioInputImmediate()
|
||||
void AudioDeviceManager::stopAudioInputImmediate()
|
||||
{
|
||||
m_audioInput.stopImmediate();
|
||||
}
|
@ -15,8 +15,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_AUDIODEVICEINFO_H
|
||||
#define INCLUDE_AUDIODEVICEINFO_H
|
||||
#ifndef INCLUDE_AUDIODEVICEMANGER_H
|
||||
#define INCLUDE_AUDIODEVICEMANGER_H
|
||||
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
@ -28,9 +28,9 @@
|
||||
|
||||
class AudioFifo;
|
||||
|
||||
class SDRBASE_API AudioDeviceInfo {
|
||||
class SDRBASE_API AudioDeviceManager {
|
||||
public:
|
||||
AudioDeviceInfo();
|
||||
AudioDeviceManager();
|
||||
|
||||
const QList<QAudioDeviceInfo>& getInputDevices() const { return m_inputDevicesInfo; }
|
||||
const QList<QAudioDeviceInfo>& getOutputDevices() const { return m_outputDevicesInfo; }
|
||||
@ -81,4 +81,4 @@ private:
|
||||
friend class MainSettings;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_AUDIODEVICEINFO_H
|
||||
#endif // INCLUDE_AUDIODEVICEMANGER_H
|
@ -18,11 +18,11 @@
|
||||
#ifndef INCLUDE_DSPENGINE_H
|
||||
#define INCLUDE_DSPENGINE_H
|
||||
|
||||
#include <audio/audiodevicemanager.h>
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include <vector>
|
||||
#include "audio/audiodeviceinfo.h"
|
||||
#include "audio/audiooutput.h"
|
||||
#include "audio/audioinput.h"
|
||||
#include "export.h"
|
||||
@ -49,7 +49,7 @@ public:
|
||||
DSPDeviceSinkEngine *addDeviceSinkEngine();
|
||||
void removeLastDeviceSinkEngine();
|
||||
|
||||
AudioDeviceInfo *getAudioDeviceInfo() { return &m_audioDeviceInfo; }
|
||||
AudioDeviceManager *getAudioDeviceManager() { return &m_audioDeviceManager; }
|
||||
void startAudioOutput();
|
||||
void stopAudioOutput();
|
||||
void startAudioOutputImmediate();
|
||||
@ -95,7 +95,7 @@ private:
|
||||
uint m_deviceSourceEnginesUIDSequence;
|
||||
std::vector<DSPDeviceSinkEngine*> m_deviceSinkEngines;
|
||||
uint m_deviceSinkEnginesUIDSequence;
|
||||
AudioDeviceInfo m_audioDeviceInfo;
|
||||
AudioDeviceManager m_audioDeviceManager;
|
||||
AudioOutput m_audioOutput;
|
||||
AudioInput m_audioInput;
|
||||
uint m_audioOutputSampleRate;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "settings/mainsettings.h"
|
||||
#include "commands/command.h"
|
||||
|
||||
MainSettings::MainSettings() : m_audioDeviceInfo(0)
|
||||
MainSettings::MainSettings() : m_audioDeviceManager(0)
|
||||
{
|
||||
resetToDefaults();
|
||||
}
|
||||
@ -29,9 +29,9 @@ void MainSettings::load()
|
||||
m_preferences.deserialize(qUncompress(QByteArray::fromBase64(s.value("preferences").toByteArray())));
|
||||
m_workingPreset.deserialize(qUncompress(QByteArray::fromBase64(s.value("current").toByteArray())));
|
||||
|
||||
if (m_audioDeviceInfo)
|
||||
if (m_audioDeviceManager)
|
||||
{
|
||||
m_audioDeviceInfo->deserialize(qUncompress(QByteArray::fromBase64(s.value("audio").toByteArray())));
|
||||
m_audioDeviceManager->deserialize(qUncompress(QByteArray::fromBase64(s.value("audio").toByteArray())));
|
||||
}
|
||||
|
||||
QStringList groups = s.childGroups();
|
||||
@ -80,9 +80,9 @@ void MainSettings::save() const
|
||||
s.setValue("preferences", qCompress(m_preferences.serialize()).toBase64());
|
||||
s.setValue("current", qCompress(m_workingPreset.serialize()).toBase64());
|
||||
|
||||
if (m_audioDeviceInfo)
|
||||
if (m_audioDeviceManager)
|
||||
{
|
||||
s.setValue("audio", qCompress(m_audioDeviceInfo->serialize()).toBase64());
|
||||
s.setValue("audio", qCompress(m_audioDeviceManager->serialize()).toBase64());
|
||||
}
|
||||
|
||||
QStringList groups = s.childGroups();
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef INCLUDE_SETTINGS_H
|
||||
#define INCLUDE_SETTINGS_H
|
||||
|
||||
#include <audio/audiodevicemanager.h>
|
||||
#include <QString>
|
||||
#include "preferences.h"
|
||||
#include "preset.h"
|
||||
#include "audio/audiodeviceinfo.h"
|
||||
#include "export.h"
|
||||
|
||||
class Command;
|
||||
@ -57,12 +57,12 @@ public:
|
||||
bool getUseLogFile() const { return m_preferences.getUseLogFile(); }
|
||||
const QString& getLogFileName() const { return m_preferences.getLogFileName(); }
|
||||
|
||||
const AudioDeviceInfo *getAudioDeviceInfo() const { return m_audioDeviceInfo; }
|
||||
void setAudioDeviceInfo(AudioDeviceInfo *audioDeviceInfo) { m_audioDeviceInfo = audioDeviceInfo; }
|
||||
const AudioDeviceManager *getAudioDeviceManager() const { return m_audioDeviceManager; }
|
||||
void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager) { m_audioDeviceManager = audioDeviceManager; }
|
||||
|
||||
protected:
|
||||
Preferences m_preferences;
|
||||
AudioDeviceInfo *m_audioDeviceInfo;
|
||||
AudioDeviceManager *m_audioDeviceManager;
|
||||
Preset m_workingPreset;
|
||||
typedef QList<Preset*> Presets;
|
||||
Presets m_presets;
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include <gui/audiodialog.h>
|
||||
|
||||
#include <audio/audiodevicemanager.h>
|
||||
#include <QTreeWidgetItem>
|
||||
#include "ui_audiodialog.h"
|
||||
#include "audio/audiodeviceinfo.h"
|
||||
|
||||
AudioDialog::AudioDialog(AudioDeviceInfo* audioDeviceInfo, QWidget* parent) :
|
||||
AudioDialog::AudioDialog(AudioDeviceManager* audioDeviceInfo, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AudioDialog),
|
||||
m_audioDeviceInfo(audioDeviceInfo)
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
class AudioDeviceInfo;
|
||||
class AudioDeviceManager;
|
||||
|
||||
namespace Ui {
|
||||
class AudioDialog;
|
||||
@ -15,13 +15,13 @@ class SDRGUI_API AudioDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AudioDialog(AudioDeviceInfo* audioDeviceInfo, QWidget* parent = NULL);
|
||||
explicit AudioDialog(AudioDeviceManager* audioDeviceInfo, QWidget* parent = NULL);
|
||||
~AudioDialog();
|
||||
|
||||
private:
|
||||
Ui::AudioDialog* ui;
|
||||
|
||||
AudioDeviceInfo* m_audioDeviceInfo;
|
||||
AudioDeviceManager* m_audioDeviceInfo;
|
||||
float m_inputVolume;
|
||||
|
||||
private slots:
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "device/deviceuiset.h"
|
||||
#include "device/deviceenumerator.h"
|
||||
#include "audio/audiodeviceinfo.h"
|
||||
#include "gui/indicator.h"
|
||||
#include "gui/presetitem.h"
|
||||
#include "gui/commanditem.h"
|
||||
@ -64,6 +63,9 @@
|
||||
#include "commands/command.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <audio/audiodevicemanager.h>
|
||||
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <string>
|
||||
@ -97,7 +99,7 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
|
||||
qDebug() << "MainWindow::MainWindow: start";
|
||||
|
||||
m_instance = this;
|
||||
m_settings.setAudioDeviceInfo(m_dspEngine->getAudioDeviceInfo());
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
|
||||
ui->setupUi(this);
|
||||
createStatusBar();
|
||||
@ -1412,11 +1414,11 @@ void MainWindow::on_action_Loaded_Plugins_triggered()
|
||||
|
||||
void MainWindow::on_action_Audio_triggered()
|
||||
{
|
||||
AudioDialog audioDialog(m_dspEngine->getAudioDeviceInfo(), this);
|
||||
AudioDialog audioDialog(m_dspEngine->getAudioDeviceManager(), this);
|
||||
audioDialog.exec();
|
||||
m_dspEngine->setAudioInputVolume(m_dspEngine->getAudioDeviceInfo()->getInputVolume());
|
||||
m_dspEngine->setAudioInputDeviceIndex(m_dspEngine->getAudioDeviceInfo()->getInputDeviceIndex());
|
||||
m_dspEngine->setAudioOutputDeviceIndex(m_dspEngine->getAudioDeviceInfo()->getOutputDeviceIndex());
|
||||
m_dspEngine->setAudioInputVolume(m_dspEngine->getAudioDeviceManager()->getInputVolume());
|
||||
m_dspEngine->setAudioInputDeviceIndex(m_dspEngine->getAudioDeviceManager()->getInputDeviceIndex());
|
||||
m_dspEngine->setAudioOutputDeviceIndex(m_dspEngine->getAudioDeviceManager()->getOutputDeviceIndex());
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Logging_triggered()
|
||||
|
@ -227,17 +227,17 @@ int WebAPIAdapterGUI::instanceAudioGet(
|
||||
SWGSDRangel::SWGAudioDevices& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getOutputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDevices();
|
||||
int nbInputDevices = audioInputDevices.size();
|
||||
int nbOutputDevices = audioOutputDevices.size();
|
||||
|
||||
response.init();
|
||||
response.setNbInputDevices(nbInputDevices);
|
||||
response.setInputDeviceSelectedIndex(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputDeviceIndex());
|
||||
response.setInputDeviceSelectedIndex(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceIndex());
|
||||
response.setNbOutputDevices(nbOutputDevices);
|
||||
response.setOutputDeviceSelectedIndex(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputVolume());
|
||||
response.setOutputDeviceSelectedIndex(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputVolume());
|
||||
QList<SWGSDRangel::SWGAudioDevice*> *inputDevices = response.getInputDevices();
|
||||
QList<SWGSDRangel::SWGAudioDevice*> *outputDevices = response.getOutputDevices();
|
||||
|
||||
@ -267,8 +267,8 @@ int WebAPIAdapterGUI::instanceAudioPatch(
|
||||
int inputIndex = response.getInputIndex();
|
||||
int outputIndex = response.getOutputIndex();
|
||||
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getOutputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDevices();
|
||||
int nbInputDevices = audioInputDevices.size();
|
||||
int nbOutputDevices = audioOutputDevices.size();
|
||||
|
||||
@ -276,17 +276,17 @@ int WebAPIAdapterGUI::instanceAudioPatch(
|
||||
inputIndex = inputIndex < -1 ? -1 : inputIndex > nbInputDevices ? nbInputDevices-1 : inputIndex;
|
||||
outputIndex = outputIndex < -1 ? -1 : outputIndex > nbOutputDevices ? nbOutputDevices-1 : outputIndex;
|
||||
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceInfo()->setInputVolume(inputVolume);
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceInfo()->setInputDeviceIndex(inputIndex);
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceInfo()->setOutputDeviceIndex(outputIndex);
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceManager()->setInputVolume(inputVolume);
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceManager()->setInputDeviceIndex(inputIndex);
|
||||
m_mainWindow.m_dspEngine->getAudioDeviceManager()->setOutputDeviceIndex(outputIndex);
|
||||
|
||||
m_mainWindow.m_dspEngine->setAudioInputVolume(inputVolume);
|
||||
m_mainWindow.m_dspEngine->setAudioInputDeviceIndex(inputIndex);
|
||||
m_mainWindow.m_dspEngine->setAudioOutputDeviceIndex(outputIndex);
|
||||
|
||||
response.setInputVolume(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputVolume());
|
||||
response.setInputIndex(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getInputDeviceIndex());
|
||||
response.setOutputIndex(m_mainWindow.m_dspEngine->getAudioDeviceInfo()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputVolume());
|
||||
response.setInputIndex(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceIndex());
|
||||
response.setOutputIndex(m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceIndex());
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ MainCore::MainCore(qtwebapp::LoggerWithFile *logger, const MainParser& parser, Q
|
||||
qDebug() << "MainCore::MainCore: start";
|
||||
|
||||
m_instance = this;
|
||||
m_settings.setAudioDeviceInfo(m_dspEngine->getAudioDeviceInfo());
|
||||
m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager());
|
||||
|
||||
m_pluginManager = new PluginManager(this);
|
||||
m_pluginManager->loadPlugins(QString("pluginssrv"));
|
||||
|
@ -228,17 +228,17 @@ int WebAPIAdapterSrv::instanceAudioGet(
|
||||
SWGSDRangel::SWGAudioDevices& response,
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainCore.m_dspEngine->getAudioDeviceInfo()->getOutputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainCore.m_dspEngine->getAudioDeviceManager()->getOutputDevices();
|
||||
int nbInputDevices = audioInputDevices.size();
|
||||
int nbOutputDevices = audioOutputDevices.size();
|
||||
|
||||
response.init();
|
||||
response.setNbInputDevices(nbInputDevices);
|
||||
response.setInputDeviceSelectedIndex(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputDeviceIndex());
|
||||
response.setInputDeviceSelectedIndex(m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputDeviceIndex());
|
||||
response.setNbOutputDevices(nbOutputDevices);
|
||||
response.setOutputDeviceSelectedIndex(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputVolume());
|
||||
response.setOutputDeviceSelectedIndex(m_mainCore.m_dspEngine->getAudioDeviceManager()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputVolume());
|
||||
QList<SWGSDRangel::SWGAudioDevice*> *inputDevices = response.getInputDevices();
|
||||
QList<SWGSDRangel::SWGAudioDevice*> *outputDevices = response.getOutputDevices();
|
||||
|
||||
@ -268,8 +268,8 @@ int WebAPIAdapterSrv::instanceAudioPatch(
|
||||
int inputIndex = response.getInputIndex();
|
||||
int outputIndex = response.getOutputIndex();
|
||||
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainCore.m_dspEngine->getAudioDeviceInfo()->getOutputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioInputDevices = m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputDevices();
|
||||
const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainCore.m_dspEngine->getAudioDeviceManager()->getOutputDevices();
|
||||
int nbInputDevices = audioInputDevices.size();
|
||||
int nbOutputDevices = audioOutputDevices.size();
|
||||
|
||||
@ -277,17 +277,17 @@ int WebAPIAdapterSrv::instanceAudioPatch(
|
||||
inputIndex = inputIndex < -1 ? -1 : inputIndex > nbInputDevices ? nbInputDevices-1 : inputIndex;
|
||||
outputIndex = outputIndex < -1 ? -1 : outputIndex > nbOutputDevices ? nbOutputDevices-1 : outputIndex;
|
||||
|
||||
m_mainCore.m_dspEngine->getAudioDeviceInfo()->setInputVolume(inputVolume);
|
||||
m_mainCore.m_dspEngine->getAudioDeviceInfo()->setInputDeviceIndex(inputIndex);
|
||||
m_mainCore.m_dspEngine->getAudioDeviceInfo()->setOutputDeviceIndex(outputIndex);
|
||||
m_mainCore.m_dspEngine->getAudioDeviceManager()->setInputVolume(inputVolume);
|
||||
m_mainCore.m_dspEngine->getAudioDeviceManager()->setInputDeviceIndex(inputIndex);
|
||||
m_mainCore.m_dspEngine->getAudioDeviceManager()->setOutputDeviceIndex(outputIndex);
|
||||
|
||||
m_mainCore.m_dspEngine->setAudioInputVolume(inputVolume);
|
||||
m_mainCore.m_dspEngine->setAudioInputDeviceIndex(inputIndex);
|
||||
m_mainCore.m_dspEngine->setAudioOutputDeviceIndex(outputIndex);
|
||||
|
||||
response.setInputVolume(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputVolume());
|
||||
response.setInputIndex(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getInputDeviceIndex());
|
||||
response.setOutputIndex(m_mainCore.m_dspEngine->getAudioDeviceInfo()->getOutputDeviceIndex());
|
||||
response.setInputVolume(m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputVolume());
|
||||
response.setInputIndex(m_mainCore.m_dspEngine->getAudioDeviceManager()->getInputDeviceIndex());
|
||||
response.setOutputIndex(m_mainCore.m_dspEngine->getAudioDeviceManager()->getOutputDeviceIndex());
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user