Commit 6c8d0ba1 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding more on_click methods

parent c6b53b25
......@@ -24,10 +24,11 @@
#include <VANet.h>
#include <ITAAsioInterface.h>
#include <ITAPortaudioInterface.h>
#include <ITAException.h>
RedstartWindow::RedstartWindow( bool bFailSafeMode, bool bAutoStart, QWidget* pParent )
RedstartWindow::RedstartWindow( bool bFailSafeMode, bool bAutoStart, bool bSkipConfig, QWidget* pParent )
: QMainWindow( pParent )
, ui( new Ui::RedstartWindow )
, m_pVAInterface( NULL )
......@@ -37,7 +38,14 @@ RedstartWindow::RedstartWindow( bool bFailSafeMode, bool bAutoStart, QWidget* pP
m_pVANetServer = IVANetServer::Create();
m_pVANetClient = IVANetClient::Create();
LoadConfiguration();
ui->comboBox_audio_driver->addItem( "ASIO" );
ui->comboBox_audio_driver->addItem( "Portaudio" );
if( !bSkipConfig )
LoadConfiguration();
if( ui->checkBox_redstart_network_connect_as_client->isChecked() )
ui->groupBox_redstart_audio_iface->setEnabled( false );
if( ( ui->checkBox_redstart_auto_start->isChecked() || bAutoStart ) && !bFailSafeMode )
on_pushButton_start_stop_clicked();
......@@ -64,9 +72,6 @@ void RedstartWindow::LoadConfiguration()
{
RestoreWindowSize();
ui->comboBox_audio_driver->addItem( "ASIO" );
ui->comboBox_audio_driver->addItem( "Portaudio" );
bool bValOK;
int iAudioBackend = m_qSettings.value( "Redstart/audio/backend_idx" ).toInt( &bValOK );
if( !bValOK )
......@@ -152,21 +157,8 @@ void RedstartWindow::on_pushButton_start_stop_clicked()
CVAStruct oVAConfigArgs = VACore::GetCoreConfigFromFile( "../VACore/conf/VACore.ini" );
QHash<QString, QVariant> oHash, oHash2;
oHash[ QString( "test" ) ] = int(1);
oHash[ QString( "test2" ) ] = QHash< QString, QVariant >();
m_qSettings.setValue( "sessions_test", oHash );
m_qSettings.sync();
oHash2 = m_qSettings.value( "sessions_test" ).toHash();
int c = oHash2.count();
bool bOK2;
int iTest = oHash[ QString( "test" ) ].toInt( &bOK2 );
int iTest2 = oHash2[ QString( "test" ) ].toInt( &bOK2 );
std::string sBackend, sDevice;
// Override configs
std::string sBackend, sDevice;
switch( ui->comboBox_audio_driver->currentIndex() )
{
case AudioBackend::ASIO:
......@@ -442,3 +434,25 @@ void RedstartWindow::on_actionGet_help_triggered()
QUrl urlVAWebsiteGetHelp( "http://www.virtualacoustics.org/work/help.html" );
QDesktopServices::openUrl( urlVAWebsiteGetHelp );
}
void RedstartWindow::on_checkBox_redstart_network_connect_as_client_clicked()
{
if( ui->checkBox_redstart_network_connect_as_client->isChecked() )
ui->groupBox_redstart_audio_iface->setEnabled( false );
else
ui->groupBox_redstart_audio_iface->setEnabled( true );
}
void RedstartWindow::on_checkBox_portaudio_default_device_clicked()
{
if( ui->checkBox_portaudio_default_device->isChecked() )
ui->comboBox_audio_iface_device->setEnabled( false );
else
ui->comboBox_audio_iface_device->setEnabled( true );
}
void RedstartWindow::on_listView_redstart_session_list_clicked(const QModelIndex &index)
{
// m_pSessionManager->SetCurrentSession( index );
}
......@@ -37,7 +37,7 @@ class RedstartWindow : public QMainWindow
Q_OBJECT
public:
explicit RedstartWindow( bool bFailSafeMode = false, bool bAutoStart = false, QWidget* pParent = 0 );
explicit RedstartWindow( bool bFailSafeMode = false, bool bAutoStart = false, bool bSkipConfig = false, QWidget* pParent = 0 );
~RedstartWindow();
enum AudioBackend
......@@ -93,6 +93,10 @@ private slots:
void on_actionGet_help_triggered();
void on_checkBox_redstart_network_connect_as_client_clicked();
void on_checkBox_portaudio_default_device_clicked();
void on_listView_redstart_session_list_clicked( const QModelIndex &index );
private:
void PostCoreStart();
void PostCoreStop();
......
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