Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Redstart
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
Redstart
Commits
1bd72b6c
Commit
1bd72b6c
authored
Nov 28, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding session import feature
parent
f85b5ce1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
254 additions
and
5 deletions
+254
-5
CMakeLists.txt
CMakeLists.txt
+4
-0
src/RedstartSessionImportDialog.cpp
src/RedstartSessionImportDialog.cpp
+96
-0
src/RedstartSessionImportDialog.h
src/RedstartSessionImportDialog.h
+50
-0
src/RedstartWindow.cpp
src/RedstartWindow.cpp
+21
-2
src/RedstartWindow.h
src/RedstartWindow.h
+1
-0
ui/RedstartSessionImportDialog.ui
ui/RedstartSessionImportDialog.ui
+79
-0
ui/RedstartWindow.ui
ui/RedstartWindow.ui
+3
-3
No files found.
CMakeLists.txt
View file @
1bd72b6c
...
...
@@ -60,6 +60,8 @@ set( Redstart_Sources
"src/RedstartSessionBinauralHeadphonesDialog.h"
"src/RedstartSessionExperimentalTalkthroughDialog.cpp"
"src/RedstartSessionExperimentalTalkthroughDialog.h"
"src/RedstartSessionImportDialog.cpp"
"src/RedstartSessionImportDialog.h"
"src/RedstartSessionList.h"
"src/RedstartSessionDetailsTreeView.h"
)
...
...
@@ -68,12 +70,14 @@ set( Redstart_UIs
"ui/RedstartWindow.ui"
"ui/RedstartSessionBinauralHeadphonesDialog.ui"
"ui/RedstartSessionExperimentalTalkthroughDialog.ui"
"ui/RedstartSessionImportDialog.ui"
)
# Qt UI form compiler
qt5_wrap_ui
(
"ui_RedstartWindow.h"
"ui/RedstartWindow.ui"
)
qt5_wrap_ui
(
"ui_RedstartSessionBinauralHeadphonesDialog.h"
"ui/RedstartSessionBinauralHeadphonesDialog.ui"
)
qt5_wrap_ui
(
"ui_RedstartSessionExperimentalTalkthroughDialog.h"
"ui/RedstartSessionExperimentalTalkthroughDialog.ui"
)
qt5_wrap_ui
(
"ui_RedstartSessionImportDialog.h"
"ui/RedstartSessionImportDialog.ui"
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
# Qt UI form compiler generates files into this folder
...
...
src/RedstartSessionImportDialog.cpp
0 → 100644
View file @
1bd72b6c
/*
* --------------------------------------------------------------------------------------------
*
* 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 "RedstartSessionImportDialog.h"
#include <ui_RedstartSessionImportDialog.h>
#include "RedstartUtils.h"
#include <VAException.h>
#include <VAStruct.h>
#include <VACore.h>
#include <QFileDialog>
#include <QSettings>
RedstartSessionImportDialog
::
RedstartSessionImportDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
),
ui
(
new
Ui
::
RedstartSessionImportDialog
)
{
ui
->
setupUi
(
this
);
QDialog
::
setWindowTitle
(
"Import session"
);
QSettings
qSettings
;
QString
sLastBrowseFolder
=
qSettings
.
value
(
"Redstart/last_browse_folder"
).
toString
();
std
::
string
s
=
sLastBrowseFolder
.
toStdString
();
if
(
QDir
(
sLastBrowseFolder
).
exists
()
)
m_oLastBasePath
.
setCurrent
(
sLastBrowseFolder
);
}
RedstartSessionImportDialog
::~
RedstartSessionImportDialog
()
{
if
(
m_oLastBasePath
.
exists
()
)
m_qSettings
.
setValue
(
"Redstart/last_browse_folder"
,
m_oLastBasePath
.
absolutePath
()
);
delete
ui
;
}
QString
RedstartSessionImportDialog
::
GetSessionName
()
const
{
return
ui
->
lineEdit_session_name
->
text
();
}
bool
RedstartSessionImportDialog
::
ValidFile
()
const
{
return
m_oConfigFileBasePath
.
exists
()
&&
!
m_oConfigFileBasePath
.
isDir
();
}
QVariantHash
RedstartSessionImportDialog
::
GetCoreConfig
()
const
{
if
(
!
ValidFile
()
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Can not import from a directory or non-existing file"
);
CVAStruct
oCoreConfig
=
VACore
::
GetCoreConfigFromFile
(
m_oConfigFileBasePath
.
absoluteFilePath
().
toStdString
()
);
return
ConvertVAStructToQHash
(
oCoreConfig
);
}
void
RedstartSessionImportDialog
::
on_pushButton_CreateSession_clicked
()
{
accept
();
close
();
}
void
RedstartSessionImportDialog
::
on_pushButton_select_import_file_clicked
()
{
QFileDialog
fd
;
fd
.
setNameFilters
(
QStringList
()
<<
"INI files (*.ini)"
<<
"Any file (*.*)"
);
fd
.
setViewMode
(
QFileDialog
::
Detail
);
if
(
m_oLastBasePath
.
exists
()
)
fd
.
setDirectory
(
m_oLastBasePath
);
else
fd
.
setDirectory
(
QDir
(
QApplication
::
applicationDirPath
()
)
);
if
(
fd
.
exec
()
)
{
QStringList
lFiles
=
fd
.
selectedFiles
();
if
(
lFiles
.
empty
()
==
false
)
{
QString
sFilePath
=
lFiles
[
0
];
m_oConfigFileBasePath
.
setFile
(
sFilePath
);
if
(
m_oConfigFileBasePath
.
exists
()
)
m_oLastBasePath
=
fd
.
directory
();
ui
->
lineEdit_import_config_file
->
setText
(
m_oConfigFileBasePath
.
fileName
()
);
}
}
}
src/RedstartSessionImportDialog.h
0 → 100644
View file @
1bd72b6c
/*
* --------------------------------------------------------------------------------------------
*
* 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_IMPORT_DIALOG
#define IW_REDSTART_SESSION_IMPORT_DIALOG
#include <QDialog>
#include <QDir>
#include <QFileInfo>
#include <QString>
#include <QSettings>
#include <QHash>
namespace
Ui
{
class
RedstartSessionImportDialog
;
}
class
RedstartSessionImportDialog
:
public
QDialog
{
Q_OBJECT
public:
explicit
RedstartSessionImportDialog
(
QWidget
*
parent
);
~
RedstartSessionImportDialog
();
QVariantHash
GetCoreConfig
()
const
;
QString
GetSessionName
()
const
;
bool
ValidFile
()
const
;
private
slots
:
void
on_pushButton_CreateSession_clicked
();
void
on_pushButton_select_import_file_clicked
();
private:
Ui
::
RedstartSessionImportDialog
*
ui
;
QDir
m_oLastBasePath
;
QFileInfo
m_oConfigFileBasePath
;
QSettings
m_qSettings
;
};
#endif // IW_REDSTART_SESSION_IMPORT_DIALOG
src/RedstartWindow.cpp
View file @
1bd72b6c
...
...
@@ -23,6 +23,7 @@
#include "RedstartRunSimpleExample.h"
#include "RedstartSessionBinauralHeadphonesDialog.h"
#include "RedstartSessionExperimentalTalkthroughDialog.h"
#include "RedstartSessionImportDialog.h"
#include "RedstartUtils.h"
#include <VA.h>
...
...
@@ -238,7 +239,7 @@ void RedstartWindow::HandleVAEvent( const CVAEvent* pEvent )
switch
(
pEvent
->
iEventType
)
{
case
CVAEvent
::
VA_EVENT_PROGRESS_UPDATE
:
ui
->
statusBar
->
showMessage
(
pEvent
->
sParam
.
c_str
()
);
//
ui->statusBar->showMessage( pEvent->sParam.c_str() );
break
;
case
CVAEvent
::
VA_EVENT_MEASURES_UPDATE
:
UpdateMeasures
(
pEvent
->
vfInputRMSs
,
pEvent
->
vfInputPeaks
,
pEvent
->
vfOutputRMSs
,
pEvent
->
vfOutputPeaks
);
...
...
@@ -628,6 +629,25 @@ void RedstartWindow::on_actionBinauralHeadphones_triggered()
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
}
void
RedstartWindow
::
on_actionImport_session_triggered
()
{
RedstartSessionImportDialog
d
(
this
);
if
(
d
.
exec
()
)
{
try
{
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
}
catch
(
CVAException
&
e
)
{
QString
sErrorMessage
=
QString
(
"Could not run simple example scene: %1"
).
arg
(
QString
::
fromStdString
(
e
.
ToString
()
)
);
QErrorMessage
oErrMsg
;
oErrMsg
.
showMessage
(
sErrorMessage
);
oErrMsg
.
exec
();
}
}
}
void
RedstartWindow
::
on_actionDefault_experimental_session_triggered
()
{
RedstartSessionExperimentalTalkthroughDialog
d
(
this
);
...
...
@@ -637,7 +657,6 @@ void RedstartWindow::on_actionDefault_experimental_session_triggered()
void
RedstartWindow
::
on_actionRunSimpleExample_triggered
()
{
try
{
if
(
!
m_pVAInterface
)
...
...
src/RedstartWindow.h
View file @
1bd72b6c
...
...
@@ -135,6 +135,7 @@ private slots:
void
on_listView_redstart_session_list_clicked
(
const
QModelIndex
&
index
);
void
on_actionBinauralHeadphones_triggered
();
void
on_actionImport_session_triggered
();
void
on_actionDefault_experimental_session_triggered
();
...
...
ui/RedstartSessionImportDialog.ui
0 → 100644
View file @
1bd72b6c
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
RedstartSessionImportDialog
</class>
<widget
class=
"QDialog"
name=
"RedstartSessionImportDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
625
</width>
<height>
133
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"lineEdit_import_config_file"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Import
</string>
</property>
<property
name=
"buddy"
>
<cstring>
lineEdit_import_config_file
</cstring>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"lineEdit_session_name"
>
<property
name=
"text"
>
<string>
MyImportedSession
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Session name
</string>
</property>
<property
name=
"buddy"
>
<cstring>
lineEdit_session_name
</cstring>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
colspan=
"3"
>
<widget
class=
"QPushButton"
name=
"pushButton_CreateSession"
>
<property
name=
"text"
>
<string>
Create
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"2"
>
<widget
class=
"QPushButton"
name=
"pushButton_select_import_file"
>
<property
name=
"text"
>
<string>
Select
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>
pushButton_CreateSession
</tabstop>
<tabstop>
lineEdit_session_name
</tabstop>
<tabstop>
lineEdit_import_config_file
</tabstop>
<tabstop>
pushButton_select_import_file
</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
ui/RedstartWindow.ui
View file @
1bd72b6c
...
...
@@ -70,7 +70,7 @@
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
-45
</y>
<y>
0
</y>
<width>
1015
</width>
<height>
709
</height>
</rect>
...
...
@@ -646,7 +646,7 @@ background-color: rgb(208, 255, 188);</string>
<property
name=
"title"
>
<string>
Core
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_4"
columnstretch=
"1,0,0,0
,0
"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_4"
columnstretch=
"1,0,0,0"
>
<item
row=
"1"
column=
"0"
colspan=
"4"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_core_settings"
>
<item
row=
"3"
column=
"0"
>
...
...
@@ -902,7 +902,7 @@ background-color: rgb(208, 255, 188);</string>
</widget>
<action
name=
"actionImport_session"
>
<property
name=
"enabled"
>
<bool>
fals
e
</bool>
<bool>
tru
e
</bool>
</property>
<property
name=
"text"
>
<string>
Import session from file
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment