Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VACore
Commits
10a3c3ed
Commit
10a3c3ed
authored
Oct 12, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Implementing API changes for repros and renderings, but still refactoring required
parent
7fab8f32
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Rendering/VAAudioRenderer.h
View file @
10a3c3ed
...
...
@@ -20,7 +20,8 @@ class IVADirectivity;
class
ITADatasource
;
class
CVACoreImpl
;
class
CVASceneState
;
class
CVAStruct
;
#include
<VA.h>
#include
<string>
#include
<vector>
...
...
@@ -61,26 +62,16 @@ public:
virtual
inline
void
PostLoadHRIRDataset
(
const
IVADirectivity
*
)
{};
virtual
inline
void
PreFreeHRIRDataset
(
const
IVADirectivity
*
)
{};
// --= Update methods =--
//! Handle a scene change
virtual
void
UpdateScene
(
CVASceneState
*
pNewSceneState
)
=
0
;
//
! Handle global auralisation mode change
//
@todo refactor.
virtual
void
UpdateGlobalAuralizationMode
(
int
iGlobalAuralisationMode
)
=
0
;
virtual
inline
int
GetAuralizationMode
()
{
return
IVAInterface
::
VA_AURAMODE_ALL
;
};
// --= Audio streaming =--
virtual
inline
void
SetParameters
(
const
CVAStruct
&
)
{};
virtual
inline
CVAStruct
GetParameters
(
const
CVAStruct
&
)
const
{
return
CVAStruct
();
};
virtual
ITADatasource
*
GetOutputDatasource
()
=
0
;
/*
TODO:
Parameter abfrage ...
Module Interface ...
*/
};
...
...
src/Reproduction/VAAudioReproductionModule.h
View file @
10a3c3ed
...
...
@@ -68,6 +68,9 @@ public:
//! Receive scene updates from core
virtual
void
UpdateScene
(
CVASceneState
*
pNewState
)
=
0
;
virtual
inline
void
SetParameters
(
const
CVAStruct
&
)
{};
virtual
inline
CVAStruct
GetParameters
(
const
CVAStruct
&
)
const
{
return
CVAStruct
();
};
protected:
IVAAudioReproductionModule
()
{};
};
...
...
src/VACoreImpl.cpp
View file @
10a3c3ed
...
...
@@ -1506,7 +1506,7 @@ void CVACoreImpl::SetSignalSourceBufferPlaybackAction( const std::string& sSigna
VA_TRY
{
if
(
!
IsValidAudiofile
SignalSourcePlaybackAction
(
iPlaybackAction
)
)
if
(
!
Get
SignalSource
Buffer
PlaybackAction
Valid
(
iPlaybackAction
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid playback action"
);
IVAAudioSignalSource
*
pSource
=
m_pSignalSourceMan
->
RequestSignalSource
(
sSignalSourceID
);
...
...
@@ -2168,7 +2168,7 @@ void CVACoreImpl::SetSoundSourceAuralizationMode( int iSoundSourceID, int iAural
VA_TRY
{
// Parameter berprfen
if
(
!
IsValid
AuralizationMode
(
iAuralizationMode
)
)
if
(
!
Get
AuralizationMode
Valid
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
bool
bSync
=
GetUpdateLocked
();
...
...
@@ -2344,7 +2344,7 @@ void CVACoreImpl::SetSoundSourceSoundPower( const int iSoundSourceID, const doub
VA_TRY
{
// Parameter berprfen
if
(
!
IsValid
Volume
(
dSoundPower
)
)
if
(
!
Get
Volume
Valid
(
dSoundPower
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid volume"
);
bool
bSync
=
GetUpdateLocked
();
...
...
@@ -2839,7 +2839,7 @@ void CVACoreImpl::SetSoundReceiverAuralizationMode( const int iID, const int iAu
VA_TRY
{
// Parameter berprfen
if
(
!
IsValid
AuralizationMode
(
iAuralizationMode
)
)
if
(
!
Get
AuralizationMode
Valid
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
bool
bSync
=
GetUpdateLocked
();
...
...
@@ -3601,7 +3601,7 @@ void CVACoreImpl::SetInputGain( double dGain )
VA_TRY
{
if
(
!
IsValid
Volume
(
dGain
)
)
if
(
!
Get
Volume
Valid
(
dGain
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid gain"
);
if
(
m_dInputGain
==
dGain
)
...
...
@@ -3647,7 +3647,7 @@ void CVACoreImpl::SetOutputGain( const double dGain )
VA_TRY
{
if
(
!
IsValid
Volume
(
dGain
)
)
if
(
!
Get
Volume
Valid
(
dGain
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid gain"
);
if
(
m_dOutputGain
==
dGain
)
...
...
@@ -3725,7 +3725,7 @@ void CVACoreImpl::SetGlobalAuralizationMode( const int iAuralizationMode )
VA_TRY
{
if
(
!
IsValid
AuralizationMode
(
iAuralizationMode
)
)
if
(
!
Get
AuralizationMode
Valid
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
if
(
m_iGlobalAuralizationMode
==
iAuralizationMode
)
...
...
@@ -4743,6 +4743,34 @@ double CVACoreImpl::GetRenderingModuleGain( const std::string& sModuleID ) const
return
0.0
f
;
}
void
CVACoreImpl
::
SetRenderingModuleAuralizationMode
(
const
std
::
string
&
sModuleID
,
const
int
iAM
)
{
for
(
size_t
n
=
0
;
n
<
m_voRenderers
.
size
();
n
++
)
{
const
CVAAudioRendererDesc
&
oRend
(
m_voRenderers
[
n
]
);
if
(
oRend
.
sID
==
sModuleID
)
{
oRend
.
pInstance
->
UpdateGlobalAuralizationMode
(
iAM
);
return
;
}
}
VA_ERROR
(
"Core"
,
"Could not find rendering module '"
<<
sModuleID
<<
"'"
);
}
int
CVACoreImpl
::
GetRenderingModuleAuralizationMode
(
const
std
::
string
&
sModuleID
)
const
{
for
(
size_t
n
=
0
;
n
<
m_voRenderers
.
size
();
n
++
)
{
const
CVAAudioRendererDesc
&
oRend
(
m_voRenderers
[
n
]
);
if
(
oRend
.
sID
==
sModuleID
)
return
oRend
.
pInstance
->
GetAuralizationMode
();
}
VA_ERROR
(
"Core"
,
"Could not find rendering module '"
<<
sModuleID
<<
"'"
);
return
0.0
f
;
}
bool
CVACoreImpl
::
GetRenderingModuleMuted
(
const
std
::
string
&
sModuleID
)
const
{
for
(
size_t
n
=
0
;
n
<
m_voRenderers
.
size
();
n
++
)
...
...
@@ -4827,6 +4855,35 @@ void CVACoreImpl::GetRenderingModules( std::vector< CVAAudioRendererInfo >& vRen
}
}
void
CVACoreImpl
::
SetReproductionModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
{
for
(
size_t
n
=
0
;
n
<
m_voReproductionModules
.
size
();
n
++
)
{
const
CVAAudioReproductionModuleDesc
&
oRep
(
m_voReproductionModules
[
n
]
);
if
(
oRep
.
sID
==
sModuleID
)
{
oRep
.
pInstance
->
SetParameters
(
oParams
);
return
;
}
}
VA_ERROR
(
"Core"
,
"Could not find Reproduction module '"
<<
sModuleID
<<
"'"
);
}
CVAStruct
CVACoreImpl
::
GetReproductionModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
const
{
for
(
size_t
n
=
0
;
n
<
m_voReproductionModules
.
size
();
n
++
)
{
const
CVAAudioReproductionModuleDesc
&
oRep
(
m_voReproductionModules
[
n
]
);
if
(
oRep
.
sID
==
sModuleID
)
return
oRep
.
pInstance
->
GetParameters
(
oParams
);
}
VA_ERROR
(
"Core"
,
"Could not find Reproduction module '"
<<
sModuleID
<<
"'"
);
return
CVAStruct
();
}
void
CVACoreImpl
::
GetReproductionModules
(
std
::
vector
<
CVAAudioReproductionInfo
>&
vRepros
,
const
bool
bFilterEnabled
/* = true */
)
const
{
vRepros
.
clear
();
...
...
@@ -4840,4 +4897,32 @@ void CVACoreImpl::GetReproductionModules( std::vector< CVAAudioReproductionInfo
if
(
!
bFilterEnabled
||
oRepInfo
.
bEnabled
)
vRepros
.
push_back
(
oRepInfo
);
}
}
\ No newline at end of file
}
void
CVACoreImpl
::
SetRenderingModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
{
for
(
size_t
n
=
0
;
n
<
m_voRenderers
.
size
();
n
++
)
{
const
CVAAudioRendererDesc
&
oRend
(
m_voRenderers
[
n
]
);
if
(
oRend
.
sID
==
sModuleID
)
{
oRend
.
pInstance
->
SetParameters
(
oParams
);
return
;
}
}
VA_ERROR
(
"Core"
,
"Could not find rendering module '"
<<
sModuleID
<<
"'"
);
}
CVAStruct
CVACoreImpl
::
GetRenderingModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
const
{
for
(
size_t
n
=
0
;
n
<
m_voRenderers
.
size
();
n
++
)
{
const
CVAAudioRendererDesc
&
oRend
(
m_voRenderers
[
n
]
);
if
(
oRend
.
sID
==
sModuleID
)
return
oRend
.
pInstance
->
GetParameters
(
oParams
);
}
VA_ERROR
(
"Core"
,
"Could not find rendering module '"
<<
sModuleID
<<
"'"
);
return
CVAStruct
();
}
src/VACoreImpl.h
View file @
10a3c3ed
...
...
@@ -258,10 +258,14 @@ public:
// Rendering
void
GetRenderingModules
(
std
::
vector
<
CVAAudioRendererInfo
>&
,
const
bool
)
const
;
void
SetRenderingModuleMuted
(
const
std
::
string
&
sModuleID
,
const
bool
bMuted
);
double
GetRenderingModuleGain
(
const
std
::
string
&
sModuleID
)
const
;
void
SetRenderingModuleGain
(
const
std
::
string
&
sModuleID
,
const
double
dGain
);
bool
GetRenderingModuleMuted
(
const
std
::
string
&
sModuleID
)
const
;
void
SetRenderingModuleMuted
(
const
std
::
string
&
sModuleID
,
const
bool
bMuted
);
void
SetRenderingModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
);
CVAStruct
GetRenderingModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
const
;
int
GetRenderingModuleAuralizationMode
(
const
std
::
string
&
sModuleID
)
const
;
void
SetRenderingModuleAuralizationMode
(
const
std
::
string
&
sModuleID
,
const
int
iAuralizationMode
);
// Reproduction
void
GetReproductionModules
(
std
::
vector
<
CVAAudioReproductionInfo
>&
,
const
bool
)
const
;
...
...
@@ -269,6 +273,8 @@ public:
double
GetReproductionModuleGain
(
const
std
::
string
&
sModuleID
)
const
;
void
SetReproductionModuleGain
(
const
std
::
string
&
sModuleID
,
const
double
dGain
);
bool
GetReproductionModuleMuted
(
const
std
::
string
&
sModuleID
)
const
;
void
SetReproductionModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
);
CVAStruct
GetReproductionModuleParameters
(
const
std
::
string
&
sModuleID
,
const
CVAStruct
&
oParams
)
const
;
// Global controls
bool
GetInputMuted
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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