More gui stuff for audio settings

parent edcef3c1
......@@ -170,7 +170,7 @@ void RedstartWindow::AcquireAsioDevices()
if( lDrivers <= 0 )
ITA_EXCEPT1( INVALID_PARAMETER, "No ASIO-compatibel drivers could be found on this system." );
m_voAsioDevices.clear();
m_voAudioDevices.clear();
for( long i = 0; i < lDrivers; i++ )
{
......@@ -186,7 +186,7 @@ void RedstartWindow::AcquireAsioDevices()
ITAsioGetChannels( &in, &out );
oDeviceSpecs.iNumInputChannels = int( in );
oDeviceSpecs.iNumInputChannels = int( out );
m_voAsioDevices.push_back( oDeviceSpecs );
m_voAudioDevices.push_back( oDeviceSpecs );
ITAsioFinalizeDriver();
......@@ -200,7 +200,7 @@ void RedstartWindow::AcquireAsioDevices()
}
if( oDeviceSpecs.bInitializable )
m_voAsioDevices.push_back( oDeviceSpecs );
m_voAudioDevices.push_back( oDeviceSpecs );
}
ITAsioFinalizeLibrary();
......@@ -219,6 +219,15 @@ void RedstartWindow::PopulateAsioDevicesFromSettings()
}
void RedstartWindow::PopulateAudioDevices()
{
ui->comboBox_audio_iface_device->clear();
for( const CAudioDeviceSpecs& oDevice : m_voAudioDevices )
{
ui->comboBox_audio_iface_device->addItem( oDevice.sName, QVariant( oDevice.iDriverNumber ) );
}
}
void RedstartWindow::AcquirePortaudioDevices()
{
......@@ -228,3 +237,28 @@ void RedstartWindow::PopulatePortaudioDevicesFromSettings()
{
}
void RedstartWindow::on_pushButton_refresh_clicked()
{
const int iAudioBackend = ui->comboBox_audio_driver->currentIndex();
if( iAudioBackend == AudioBackend::PORTAUDIO )
{
AcquirePortaudioDevices();
}
else
{
AcquireAsioDevices();
}
PopulateAudioDevices();
}
void RedstartWindow::on_comboBox_audio_driver_currentIndexChanged(int iIndex)
{
PopulateAudioDevices();
}
void RedstartWindow::on_comboBox_audio_iface_device_currentIndexChanged(int index)
{
}
......@@ -64,6 +64,12 @@ private slots:
void on_pushButton_start_stop_clicked();
void on_pushButton_refresh_clicked();
void on_comboBox_audio_driver_currentIndexChanged(int index);
void on_comboBox_audio_iface_device_currentIndexChanged(int index);
private:
void PostCoreStart();
void PostCoreStop();
......@@ -76,8 +82,7 @@ private:
IVAInterface* m_pCoreInstance;
std::vector< QString > m_vsAudioBackends;
std::vector< CAudioDeviceSpecs > m_voAsioDevices;
std::vector< CAudioDeviceSpecs > m_voPortaudioDevices;
std::vector< CAudioDeviceSpecs > m_voAudioDevices;
QSettings m_qSettings;
......@@ -89,6 +94,9 @@ private:
void AcquirePortaudioDevices();
void PopulatePortaudioDevicesFromSettings();
void PopulateAudioDevices();
};
#endif // IW_REDSTART_WINDOW
......@@ -17,6 +17,9 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
......@@ -578,6 +581,9 @@
</layout>
</widget>
<widget class="QWidget" name="tab_console">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Console</string>
</attribute>
......@@ -632,21 +638,33 @@
</widget>
</widget>
<widget class="QWidget" name="tab_rendering">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Rendering</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_reproduction">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Reproduction</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_audio_io">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Audio I/O</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_scene">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Scene</string>
</attribute>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment