1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

New audio devices dialog and handling: put the AudioDeviceInfo object on the main window stack instead of dynamically allocating

This commit is contained in:
f4exb 2017-01-06 19:00:45 +01:00
parent fb3e6dc90d
commit 83fcf912e9
2 changed files with 6 additions and 7 deletions

View File

@ -57,7 +57,6 @@
MainWindow::MainWindow(QWidget* parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
m_audioDeviceInfo(new AudioDeviceInfo),
m_masterTabIndex(0),
m_settings(),
m_dspEngine(DSPEngine::instance()),
@ -69,7 +68,7 @@ MainWindow::MainWindow(QWidget* parent) :
{
qDebug() << "MainWindow::MainWindow: start";
m_settings.setAudioDeviceInfo(m_audioDeviceInfo);
m_settings.setAudioDeviceInfo(&m_audioDeviceInfo);
ui->setupUi(this);
createStatusBar();
@ -739,11 +738,11 @@ void MainWindow::on_action_Loaded_Plugins_triggered()
void MainWindow::on_action_Audio_triggered()
{
AudioDialog audioDialog(m_audioDeviceInfo, this);
AudioDialog audioDialog(&m_audioDeviceInfo, this);
audioDialog.exec();
m_dspEngine->setAudioInputVolume(m_audioDeviceInfo->getInputVolume());
m_dspEngine->setAudioInputDeviceIndex(m_audioDeviceInfo->getInputDeviceIndex());
m_dspEngine->setAudioOutputDeviceIndex(m_audioDeviceInfo->getOutputDeviceIndex());
m_dspEngine->setAudioInputVolume(m_audioDeviceInfo.getInputVolume());
m_dspEngine->setAudioInputDeviceIndex(m_audioDeviceInfo.getInputDeviceIndex());
m_dspEngine->setAudioOutputDeviceIndex(m_audioDeviceInfo.getOutputDeviceIndex());
}
void MainWindow::on_action_My_Position_triggered()

View File

@ -101,7 +101,7 @@ private:
};
Ui::MainWindow* ui;
AudioDeviceInfo* m_audioDeviceInfo;
AudioDeviceInfo m_audioDeviceInfo;
MessageQueue m_inputMessageQueue;
MainSettings m_settings;
std::vector<DeviceUISet*> m_deviceUIs;