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
c861f530
Commit
c861f530
authored
Nov 29, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
100912e9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
30 deletions
+104
-30
src/RedstartSessionImportDialog.cpp
src/RedstartSessionImportDialog.cpp
+2
-0
src/RedstartSessionList.h
src/RedstartSessionList.h
+22
-9
src/RedstartWindow.cpp
src/RedstartWindow.cpp
+75
-17
src/RedstartWindow.h
src/RedstartWindow.h
+3
-0
ui/RedstartSessionImportDialog.ui
ui/RedstartSessionImportDialog.ui
+1
-1
ui/RedstartWindow.ui
ui/RedstartWindow.ui
+1
-3
No files found.
src/RedstartSessionImportDialog.cpp
View file @
c861f530
...
...
@@ -91,6 +91,8 @@ void RedstartSessionImportDialog::on_pushButton_select_import_file_clicked()
m_oLastBasePath
=
fd
.
directory
();
ui
->
lineEdit_import_config_file
->
setText
(
m_oConfigFileBasePath
.
fileName
()
);
if
(
ui
->
lineEdit_session_name
->
text
().
isEmpty
()
)
ui
->
lineEdit_session_name
->
setText
(
m_oConfigFileBasePath
.
baseName
()
);
}
}
}
src/RedstartSessionList.h
View file @
c861f530
...
...
@@ -53,7 +53,7 @@ public:
inline
~
RedstartSessionListView
()
{
QString
sCurrentSessionName
=
m_pModel
->
data
(
currentIndex
(),
0
).
toString
();
QString
sCurrentSessionName
=
m_pModel
->
data
(
currentIndex
(),
0
).
toString
();
m_qSettings
.
setValue
(
"Redstart/last_session"
,
sCurrentSessionName
);
};
...
...
@@ -81,18 +81,18 @@ public:
{
QMap
<
QString
,
QVariant
>
sessions
=
m_qSettings
.
value
(
"Redstart/Sessions"
).
toMap
();
if
(
sessions
.
count
()
==
0
)
return
;
QStringList
list
;
QMap
<
QString
,
QVariant
>::
const_iterator
cit
=
sessions
.
constBegin
();
while
(
cit
!=
sessions
.
constEnd
()
)
list
.
push_back
(
cit
++
.
key
()
);
if
(
sessions
.
count
()
>
0
)
{
QMap
<
QString
,
QVariant
>::
const_iterator
cit
=
sessions
.
constBegin
();
while
(
cit
!=
sessions
.
constEnd
()
)
list
.
push_back
(
cit
++
.
key
()
);
}
m_pModel
->
setStringList
(
list
);
};
QString
GetCurrentSessionID
()
const
inline
QString
GetCurrentSessionID
()
const
{
QModelIndex
index
=
currentIndex
();
if
(
m_pModel
->
rowCount
()
==
0
||
!
index
.
isValid
()
)
...
...
@@ -102,6 +102,19 @@ public:
return
sSessionName
;
};
inline
void
RemoveCurrentSession
()
{
QMap
<
QString
,
QVariant
>
sessions
=
m_qSettings
.
value
(
"Redstart/Sessions"
).
toMap
();
sessions
.
remove
(
GetCurrentSessionID
()
);
m_qSettings
.
setValue
(
"Redstart/Sessions"
,
sessions
);
m_qSettings
.
sync
();
UpdateSessionList
();
if
(
m_pModel
->
rowCount
()
>
0
)
setCurrentIndex
(
m_pModel
->
index
(
0
,
0
)
);
};
inline
void
AddSession
(
const
QString
&
sID
,
const
QVariantHash
&
oCoreConfig
,
const
bool
bMakeCurrent
=
true
)
{
QMap
<
QString
,
QVariant
>
sessions
=
m_qSettings
.
value
(
"Redstart/Sessions"
).
toMap
();
...
...
@@ -135,7 +148,7 @@ public:
if
(
!
oMacros
.
HasKey
(
"ProjectName"
)
)
oMacros
[
"ProjectName"
]
=
"Redstart"
;
return
oCoreConfig
;
return
oCoreConfig
;
};
public
slots
:
...
...
src/RedstartWindow.cpp
View file @
c861f530
...
...
@@ -149,6 +149,9 @@ void RedstartWindow::LoadConfiguration()
ui
->
comboBox_core_settings_log_level
->
addItem
(
QString
::
fromStdString
(
m_pVAInterface
->
GetLogLevelStr
(
IVAInterface
::
VA_LOG_LEVEL_VERBOSE
)
)
);
ui
->
comboBox_core_settings_log_level
->
addItem
(
QString
::
fromStdString
(
m_pVAInterface
->
GetLogLevelStr
(
IVAInterface
::
VA_LOG_LEVEL_TRACE
)
)
);
if
(
ui
->
listView_redstart_session_list
->
GetCurrentSessionID
().
isEmpty
()
==
false
)
ui
->
treeView_session_details
->
SetStruct
(
ui
->
listView_redstart_session_list
->
GetCurrentConfig
()
);
}
void
RedstartWindow
::
StoreConfiguration
()
...
...
@@ -627,7 +630,11 @@ void RedstartWindow::on_actionBinauralHeadphones_triggered()
{
RedstartSessionBinauralHeadphonesDialog
d
(
this
);
if
(
d
.
exec
()
)
{
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
CVAStruct
oStruct
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
ui
->
treeView_session_details
->
SetStruct
(
oStruct
);
}
}
void
RedstartWindow
::
on_actionImport_session_triggered
()
...
...
@@ -638,6 +645,9 @@ void RedstartWindow::on_actionImport_session_triggered()
try
{
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
CVAStruct
oStruct
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
ui
->
treeView_session_details
->
SetStruct
(
oStruct
);
}
catch
(
CVAException
&
e
)
{
...
...
@@ -653,24 +663,10 @@ void RedstartWindow::on_actionDefault_experimental_session_triggered()
{
RedstartSessionExperimentalTalkthroughDialog
d
(
this
);
if
(
d
.
exec
()
)
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
}
void
RedstartWindow
::
on_actionRunSimpleExample_triggered
()
{
try
{
if
(
!
m_pVAInterface
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"No VA interface available. Please start a session, first."
);
RunSimpleExample
(
m_pVAInterface
);
}
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
();
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
d
.
GetCoreConfig
()
);
CVAStruct
oStruct
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
ui
->
treeView_session_details
->
SetStruct
(
oStruct
);
}
}
...
...
@@ -725,6 +721,68 @@ void RedstartWindow::on_actionExport_to_file_triggered()
}
}
}
}
void
RedstartWindow
::
on_actionRemove_triggered
()
{
ui
->
listView_redstart_session_list
->
RemoveCurrentSession
();
CVAStruct
oStruct
;
if
(
!
ui
->
listView_redstart_session_list
->
GetCurrentSessionID
().
isEmpty
()
)
oStruct
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
ui
->
treeView_session_details
->
SetStruct
(
oStruct
);
}
void
RedstartWindow
::
on_actionEdit_session_triggered
()
{
RedstartSessionWizardDialog
d
(
this
);
QString
sCurrentSessionID
=
ui
->
listView_redstart_session_list
->
GetCurrentSessionID
();
CVAStruct
oCurrentConfig
;
if
(
!
sCurrentSessionID
.
isEmpty
()
)
{
oCurrentConfig
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
d
.
SetSession
(
sCurrentSessionID
,
ConvertVAStructToQHash
(
oCurrentConfig
)
);
}
if
(
d
.
exec
()
)
{
QVariantHash
oNewConfig
=
d
.
GetCoreConfig
();
if
(
d
.
GetSessionName
()
!=
sCurrentSessionID
)
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
oNewConfig
);
else
ui
->
listView_redstart_session_list
->
UpdateSession
(
d
.
GetSessionName
(),
oNewConfig
);
ui
->
treeView_session_details
->
SetStruct
(
ConvertQHashToVAStruct
(
oNewConfig
)
);
}
}
void
RedstartWindow
::
on_actionDuplicate_current_session_triggered
()
{
RedstartSessionDuplicateCurrentDialog
d
(
this
);
if
(
d
.
exec
()
)
{
CVAStruct
oStruct
=
ui
->
listView_redstart_session_list
->
GetCurrentConfig
();
ui
->
listView_redstart_session_list
->
AddSession
(
d
.
GetSessionName
(),
ConvertVAStructToQHash
(
oStruct
)
);
ui
->
treeView_session_details
->
SetStruct
(
oStruct
);
}
}
void
RedstartWindow
::
on_actionRunSimpleExample_triggered
()
{
try
{
if
(
!
m_pVAInterface
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"No VA interface available. Please start a session, first."
);
RunSimpleExample
(
m_pVAInterface
);
}
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
();
}
}
\ No newline at end of file
src/RedstartWindow.h
View file @
c861f530
...
...
@@ -147,6 +147,9 @@ private slots:
void
on_actionAmbisonics_triggered
();
void
on_actionExport_to_file_triggered
();
void
on_actionRemove_triggered
();
void
on_actionEdit_session_triggered
();
void
on_actionDuplicate_current_session_triggered
();
private:
void
PostCoreStart
();
...
...
ui/RedstartSessionImportDialog.ui
View file @
c861f530
...
...
@@ -36,7 +36,7 @@
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"lineEdit_session_name"
>
<property
name=
"text"
>
<string
>
MyImportedSession
</string
>
<string
/
>
</property>
</widget>
</item>
...
...
ui/RedstartWindow.ui
View file @
c861f530
...
...
@@ -843,13 +843,11 @@ background-color: rgb(208, 255, 188);</string>
<property
name=
"title"
>
<string>
New session
</string>
</property>
<addaction
name=
"actionAmbisonics"
/>
<addaction
name=
"actionBinauralHeadphones"
/>
<addaction
name=
"actionDefault_experimental_session"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionSession_wizard"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionEmpty_session"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionImport_session"
/>
</widget>
...
...
@@ -1076,7 +1074,7 @@ background-color: rgb(208, 255, 188);</string>
</action>
<action
name=
"actionEdit_session"
>
<property
name=
"enabled"
>
<bool>
fals
e
</bool>
<bool>
tru
e
</bool>
</property>
<property
name=
"text"
>
<string>
Edit session
</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