Commit a2b5910e authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Adding dialog

parents 0bb4d113 313615a2
......@@ -50,9 +50,24 @@ if( NOT WIN32 )
add_definitions( -std=gnu++11 )
endif( )
set( Redstart_Sources
"src/main.cpp"
"src/RedstartWindow.cpp"
"src/RedstartWindow.h"
"src/RedstartRunSimpleExample.h"
"src/RedstartUtils.h"
"src/RedstartSessionBinauralHeadphonesDialog.cpp"
"src/RedstartSessionBinauralHeadphonesDialog.h"
)
set( Redstart_UIs
"ui/RedstartWindow.ui"
"ui/RedstartSessionBinauralHeadphonesDialog.ui"
)
# Qt UI form compiler
qt5_wrap_ui( "ui_RedstartWindow.h" "ui/RedstartWindow.ui" )
qt5_wrap_ui( "ui_RedstartSessionBinauralHeadphonesDialog.h" "ui/RedstartSessionBinauralHeadphonesDialog.ui" )
include_directories( "${CMAKE_CURRENT_BINARY_DIR}" ) # Qt UI form compiler generates files into this folder
......@@ -61,7 +76,7 @@ include_directories( "${CMAKE_CURRENT_BINARY_DIR}" ) # Qt UI form compiler gener
qt5_add_resources( VA_REDSTART_RESOURCES "res/QRedstart.qrc" OPTIONS -compress 3 )
add_executable( Redstart ${VA_REDSTART_RESOURCES} "src/main.cpp" "src/RedstartWindow.cpp" "src/RedstartWindow.h" "src/RedstartUtils.h" "ui/RedstartWindow.ui" )
add_executable( Redstart ${VA_REDSTART_RESOURCES} ${Redstart_Sources} ${Redstart_UIs} )
target_link_libraries( Redstart ${VISTA_USE_PACKAGE_LIBRARIES} ${VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES} Qt5::Widgets )
install( TARGETS Redstart RUNTIME DESTINATION "bin" )
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A Virtual Acoustics (VA) | http://www.virtualacoustics.org
* VVV VVV AAA Licensed under the Apache License, Version 2.0
* VVV VVV AAA
* VVV VVV AAA Copyright 2015-2017
* VVVVVV AAA Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University
*
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_REDSTART_RUN_SIMPLE_EXAMPLE
#define IW_REDSTART_RUN_SIMPLE_EXAMPLE
#include <VA.h>
inline void RunSimpleExample( IVAInterface* pVA )
{
const std::string sSignalSourceID = pVA->CreateSignalSourceBufferFromFile( "$(DemoSound)" );
pVA->SetSignalSourceBufferPlaybackAction( sSignalSourceID, IVAInterface::VA_PLAYBACK_ACTION_PLAY );
pVA->SetSignalSourceBufferLooping( sSignalSourceID, true );
const int iSoundSourceID = pVA->CreateSoundSource( "Redstart C++ example sound source" );
pVA->SetSoundSourcePose( iSoundSourceID, VAVec3( 2.0f, 1.7f, 2.0f ), VAQuat( 0.0f, 0.0f, 0.0f, 1.0f ) );
pVA->SetSoundSourceSignalSource( iSoundSourceID, sSignalSourceID );
const int iHRIR = pVA->CreateDirectivityFromFile( "$(DefaultHRIR)" );
const int iSoundReceiverID = pVA->CreateSoundReceiver( "Redstart C++ example sound receiver" );
pVA->SetSoundReceiverPose( iSoundReceiverID, VAVec3( 0.0f, 1.7f, 0.0f ), VAQuat( 0.0f, 0.0f, 0.0f, 1.0f ) );
pVA->SetSoundReceiverDirectivity( iSoundReceiverID, iHRIR );
};
#endif // IW_REDSTART_RUN_SIMPLE_EXAMPLE
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A Virtual Acoustics (VA) | http://www.virtualacoustics.org
* VVV VVV AAA Licensed under the Apache License, Version 2.0
* VVV VVV AAA
* VVV VVV AAA Copyright 2015-2017
* VVVVVV AAA Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University
*
* --------------------------------------------------------------------------------------------
*/
#include "RedstartSessionBinauralHeadphonesDialog.h"
#include <ui_RedstartSessionBinauralHeadphonesDialog.h>
RedstartSessionBinauralHeadphonesDialog::RedstartSessionBinauralHeadphonesDialog( QWidget *parent )
: QDialog( parent ),
ui( new Ui::RedstartDialogSessionBinauralHeadphones )
{
ui->setupUi( this );
}
RedstartSessionBinauralHeadphonesDialog::~RedstartSessionBinauralHeadphonesDialog()
{
//m_qSettings.setValue( "Redstart/Sessions/", ui->checkBox_IncludeAllChannels->checkState() );
}
QVariantHash RedstartSessionBinauralHeadphonesDialog::GetCoreConfig() const
{
QVariantHash oHash;
//ui->line
return oHash;
}
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A Virtual Acoustics (VA) | http://www.virtualacoustics.org
* VVV VVV AAA Licensed under the Apache License, Version 2.0
* VVV VVV AAA
* VVV VVV AAA Copyright 2015-2017
* VVVVVV AAA Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University
*
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_REDSTART_SESSION_BINAURAL_HEADPHONES_DIALOG
#define IW_REDSTART_SESSION_BINAURAL_HEADPHONES_DIALOG
#include <QDialog>
#include <QDir>
#include <QString>
#include <QSettings>
#include <QHash>
namespace Ui
{
class RedstartDialogSessionBinauralHeadphones;
}
class RedstartSessionBinauralHeadphonesDialog : public QDialog
{
Q_OBJECT
public:
explicit RedstartSessionBinauralHeadphonesDialog( QWidget *parent );
~RedstartSessionBinauralHeadphonesDialog();
QVariantHash GetCoreConfig() const;
private:
Ui::RedstartDialogSessionBinauralHeadphones* ui;
QDir m_oBasePath;
QString m_sFileBaseName;
QSettings m_qSettings;
};
#endif // IW_REDSTART_SESSION_BINAURAL_HEADPHONES_DIALOG
This diff is collapsed.
......@@ -15,6 +15,7 @@
#include <QMainWindow>
#include <QSettings>
#include <QStringList>
#include <ITAPortaudioInterface.h>
#ifdef WIN32
......@@ -23,6 +24,7 @@
#include <ITAJACKInterface.h>
#endif
class IVAInterface;
class IVANetClient;
class IVANetServer;
......@@ -37,7 +39,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
......@@ -70,8 +72,39 @@ public:
inline CAudioDeviceSpecs()
{
iDriverNumber = -1;
iNumInputChannels = -1;
iNumOutputChannels = -1;
bInitializable = false;
bDefaultDevice = false;
iBackend = -1;
};
inline CAudioDeviceSpecs( const QVariantHash& oHash )
: CAudioDeviceSpecs()
{
iDriverNumber = oHash[ "DriverNumber" ].toInt();
sName = oHash[ "Name" ].toString();
iNumInputChannels = oHash[ "NumInputChannels" ].toInt();
iNumOutputChannels = oHash[ "NumOutputChannels" ].toInt();
bInitializable = oHash[ "Initializable" ].toBool();
bDefaultDevice = oHash[ "DefaultDevice" ].toBool();
iBackend = oHash[ "Backend" ].toInt();
};
inline QVariantHash asHash() const
{
QVariantHash oHash;
oHash[ "DriverNumber" ] = iDriverNumber;
oHash[ "Name" ] = sName;
oHash[ "NumInputChannels" ] = iNumInputChannels;
oHash[ "NumOutputChannels" ] = iNumOutputChannels;
oHash[ "Initializable" ] = bInitializable;
oHash[ "DefaultDevice" ] = bDefaultDevice;
oHash[ "Backend" ] = iBackend;
return oHash;
};
};
private slots:
......@@ -93,6 +126,16 @@ 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 );
void on_actionBinauralHeadphones_triggered();
void on_actionDefault_experimental_session_triggered();
void on_actionRunSimpleExample_triggered();
private:
void PostCoreStart();
void PostCoreStop();
......@@ -106,21 +149,17 @@ private:
IVANetClient* m_pVANetClient;
IVANetServer* m_pVANetServer;
std::vector< QString > m_vsAudioBackends;
std::vector< CAudioDeviceSpecs > m_voAudioDevices;
int m_iPortaudioDefaultDevice;
QSettings m_qSettings;
void LoadConfiguration();
void StoreConfiguration();
void PopulateAudioDevices();
void AcquireAsioDevices();
void PopulateAsioDevicesFromSettings();
void AcquirePortaudioDevices();
void PopulatePortaudioDevicesFromSettings();
void PopulateAudioDevices();
};
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RedstartDialogSessionBinauralHeadphones</class>
<widget class="QDialog" name="RedstartDialogSessionBinauralHeadphones">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>609</width>
<height>240</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Headphone channels</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>DefaultHRIR macro value</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_macro_DemoSound">
<property name="text">
<string>WelcomeToVA.wav</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButton_BrowseDemoSound">
<property name="text">
<string>Select</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>DemoSound macro label</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_macro_DefaultHRIR">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>ITA-Kunstkopf_5x5_256_44kHz.v17.ir.daff</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="pushButton_BrowseHRIR">
<property name="text">
<string>Select</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QCheckBox" name="checkBox_folders_as_search_path">
<property name="text">
<string>Add all base folders as search paths (instead of using absolute paths)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_headphone_channels">
<property name="text">
<string>1,2</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_session_name">
<property name="text">
<string>MyBinauralHeadphoneSession</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Session name</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string>The filter length is only used to define the convolution engine length. Use a power of 2 and at least the filter length of your HRIR.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>HRIR filter length</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_hrir_filter_length">
<property name="toolTip">
<string>The filter length is only used to define the convolution engine length. Use a power of 2 and at least the filter length of your HRIR.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>256</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>The filter length is only used to define the convolution engine length. Use a power of 2 and at least the filter length of your HRIR.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Samples</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="pushButton_CreateSession">
<property name="text">
<string>Create binaural headphone session</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -65,8 +65,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1025</width>
<height>658</height>
<width>1023</width>
<height>661</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="0,0,0,0,1">
......@@ -176,17 +176,17 @@ background-color: rgb(254, 228, 255);</string>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="gridLayout_redstart_network">
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>TCP/IP server address</string>
<string>TCP/IP port</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>TCP/IP port</string>
<string>TCP/IP server address</string>
</property>
</widget>
</item>
......@@ -204,7 +204,7 @@ background-color: rgb(254, 228, 255);</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_redstart_network_connect_as_client">
<property name="text">
<string>Connect as client</string>
......@@ -515,6 +515,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="pageStep">
<number>3</number>
</property>
<property name="tracking">
<bool>false</bool>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
......@@ -552,6 +555,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="sliderPosition">
<number>0</number>
</property>
<property name="tracking">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -809,7 +815,7 @@ background-color: rgb(208, 255, 188);</string>
<addaction name="separator"/>
<addaction name="actionOpen_session"/>
<addaction name="separator"/>
<addaction name="actionDefault_binaural_session"/>
<addaction name="actionBinauralHeadphones"/>
<addaction name="actionDefault_experimental_session"/>
</widget>
<widget class="QMenu" name="menuCrurrent_session">
......@@ -828,7 +834,7 @@ background-color: rgb(208, 255, 188);</string>
<addaction name="separator"/>
<addaction name="actionPreferences"/>
<addaction name="separator"/>
<addaction name="actionQuit_2"/>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menuRun">
<property name="enabled">
......@@ -837,7 +843,7 @@ background-color: rgb(208, 255, 188);</string>
<property name="title">
<string>Run</string>
</property>
<addaction name="actionSimple_example"/>
<addaction name="actionRunSimpleExample"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
......@@ -855,11 +861,6 @@ background-color: rgb(208, 255, 188);</string>
<addaction name="menuRun"/>
<addaction name="menuHelp"/>
</widget>
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
</action>
<action name="actionOpen_session">
<property name="text">
<string>Import session from file</string>
......@@ -881,7 +882,7 @@ background-color: rgb(208, 255, 188);</string>
<string>Save session as ...</string>
</property>
</action>
<action name="actionQuit_2">
<action name="actionQuit">
<property name="text">
<string>Quit</string>
</property>
......@@ -891,7 +892,7 @@ background-color: rgb(208, 255, 188);</string>
<string>Session wizard</string>
</property>
</action>
<action name="actionSimple_example">
<action name="actionRunSimpleExample">
<property name="text">
<string>Simple example</string>
</property>
......@@ -911,14 +912,14 @@ background-color: rgb(208, 255, 188);</string>
<string>Empty session</string>
</property>
</action>
<action name="actionDefault_binaural_session">
<action name="actionBinauralHeadphones">
<property name="text">
<string>Default binaural session</string>
<string>Binaural headphones</string>
</property>
</action>
<action name="actionDefault_experimental_session">
<property name="text">
<string>Default experimental session</string>
<string>Experimental</string>
</property>
</action>
<action name="actionExport_to_file">
......
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