Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VABase
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
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)
VABase
Commits
66f62523
Commit
66f62523
authored
Sep 13, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding more for portals, renaming listener to more abstract sound receiver
parent
326c4939
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
622 additions
and
411 deletions
+622
-411
include/VABase.h
include/VABase.h
+68
-4
include/VACore.h
include/VACore.h
+44
-5
include/VACoreEvent.h
include/VACoreEvent.h
+56
-54
include/VAEventHandlerGlobalLock.h
include/VAEventHandlerGlobalLock.h
+2
-2
include/VAObject.h
include/VAObject.h
+4
-7
include/VAObjectRegistry.h
include/VAObjectRegistry.h
+5
-5
include/VASamples.h
include/VASamples.h
+1
-1
include/VAStruct.h
include/VAStruct.h
+26
-17
src/VACore.cpp
src/VACore.cpp
+4
-0
src/VACoreEvent.cpp
src/VACoreEvent.cpp
+17
-25
src/VAObject.cpp
src/VAObject.cpp
+1
-8
src/VAObjectRegistry.cpp
src/VAObjectRegistry.cpp
+90
-66
src/VASamples.cpp
src/VASamples.cpp
+1
-1
src/VAStruct.cpp
src/VAStruct.cpp
+303
-216
No files found.
include/VABase.h
View file @
66f62523
...
...
@@ -485,8 +485,8 @@ public:
};
//! Data class containing information of a portal (acoustic portal)
class
VABASE_API
CVAPortalInfo
//! Data class containing information of a
sound
portal (acoustic portal)
class
VABASE_API
CVA
Sound
PortalInfo
{
public:
int
iID
;
//!< ID
...
...
@@ -494,14 +494,78 @@ public:
VAVec3
vPos
;
//!< Position vector [m]
VAVec3
vView
,
vUp
;
//!< View-/Up-vector
VAQuat
qOrient
;
//!< Orientation (quaternion)
int
iMaterialID
;
//!< Material ID with transmission data
int
iNextPortalID
;
int
iSoundReceiverID
;
int
iSoundSourceID
;
CVAStruct
oParams
;
//!< Special parameters
inline
CVAPortalInfo
()
inline
CVA
Sound
PortalInfo
()
:
iID
(
-
1
)
,
iNextPortalID
(
-
1
)
,
iSoundSourceID
(
-
1
)
,
iSoundReceiverID
(
-
1
)
,
iMaterialID
(
-
1
)
{};
virtual
inline
~
CVAPortalInfo
()
{};
virtual
inline
~
CVA
Sound
PortalInfo
()
{};
};
//! Data class containing information of a sound portal (acoustic portal)
class
VABASE_API
CVAAcousticMaterial
{
public:
enum
Type
{
UNSPECIFIED
=
-
1
,
PROTOTYPE
=
0
,
ENERGETIC_BAND_FILTER_WHOLE_OCTAVE
,
ENERGETIC_BAND_FILTER_THIRD_OCTAVE
,
};
int
iID
;
//!< ID
int
iType
;
CVAStruct
oParams
;
std
::
vector
<
float
>
vfValues
;
inline
CVAAcousticMaterial
()
:
iID
(
-
1
)
{};
};
//! Geometry mesh class
/**
* This is only intended to be used as an exchange
* format of the simplest mesh structure. Renderers
* use more elaborate representations.
*
* It can be used for rudimentary rooms and dynamic geometry objects.
*/
class
VABASE_API
CVAGeometryMesh
{
class
CVAVertex
{
public:
int
iID
;
VAVec3
v3Point
;
CVAVertex
()
:
iID
(
-
1
)
{};
};
class
CVAFace
{
int
iID
;
int
iMaterialID
;
//!< Assigned material
std
::
vector
<
int
>
viVertexList
;
CVAFace
()
:
iID
(
-
1
),
iMaterialID
(
-
1
)
{};
};
int
iID
;
std
::
vector
<
CVAVertex
>
voVertices
;
//!< List of available vertices
std
::
vector
<
CVAFace
>
voFaces
;
//!< List of faces defined by vertices
CVAStruct
oParams
;
//!< Additional parameters
};
#endif // IW_VABASE
include/VACore.h
View file @
66f62523
...
...
@@ -115,13 +115,15 @@ public:
static
const
int
VA_AURAMODE_NEARFIELD
=
(
1
<<
8
);
//!< Near-field effects
static
const
int
VA_AURAMODE_DOPPLER
=
(
1
<<
9
);
//!< Doppler effects
static
const
int
VA_AURAMODE_SPREADING_LOSS
=
(
1
<<
10
);
//!< Spherical spreading loss
static
const
int
VA_AURAMODE_TRANSMISSION
=
(
1
<<
11
);
//!< Sound transmission
//! Default auralization mode (alias)
static
const
int
VA_AURAMODE_DEFAULT
=
VA_AURAMODE_DIRECT_SOUND
|
VA_AURAMODE_DIRECTIVITY
|
VA_AURAMODE_AIR_ABSORPTION
|
VA_AURAMODE_DOPPLER
|
VA_AURAMODE_SPREADING_LOSS
;
VA_AURAMODE_SPREADING_LOSS
|
VA_AURAMODE_TRANSMISSION
;
//! All auralization modes (mask)
static
const
int
VA_AURAMODE_ALL
=
VA_AURAMODE_DIRECT_SOUND
|
...
...
@@ -134,7 +136,8 @@ public:
VA_AURAMODE_DIFFRACTION
|
VA_AURAMODE_NEARFIELD
|
VA_AURAMODE_DOPPLER
|
VA_AURAMODE_SPREADING_LOSS
;
VA_AURAMODE_SPREADING_LOSS
|
VA_AURAMODE_TRANSMISSION
;
//! Destructor
...
...
@@ -858,12 +861,12 @@ public:
//! Create a sound portal
virtual
int
CreateSoundPortal
(
const
CVAStruct
&
oParams
,
const
std
::
string
&
sName
=
""
)
=
0
;
virtual
int
CreateSoundPortal
(
const
std
::
string
&
sName
=
""
)
=
0
;
//! Return all portal IDs
virtual
void
GetSoundPortalIDs
(
std
::
vector
<
int
>&
viIDs
)
=
0
;
virtual
CVAPortalInfo
GetSoundPortalInfo
(
const
int
iID
)
const
=
0
;
virtual
CVA
Sound
PortalInfo
GetSoundPortalInfo
(
const
int
iID
)
const
=
0
;
//! Returns the name of a portal
virtual
std
::
string
GetSoundPortalName
(
const
int
iID
)
const
=
0
;
...
...
@@ -871,10 +874,46 @@ public:
//! Sets the name of a portal
virtual
void
SetSoundPortalName
(
const
int
iID
,
const
std
::
string
&
sName
)
=
0
;
//! Sound portal material setter
virtual
void
SetSoundPortalMaterial
(
const
int
iSoundPortalID
,
const
int
iMaterialID
)
=
0
;
//! Sound portal material getter
virtual
int
GetSoundPortalMaterial
(
const
int
iSoundPortalID
)
const
=
0
;
//! Sound portal next portal setter
virtual
void
SetSoundPortalNextPortal
(
const
int
iSoundPortalID
,
const
int
iNextSoundPortalID
)
=
0
;
//! Sound portal next portal getter
virtual
int
GetSoundPortalNextPortal
(
const
int
iSoundPortalID
)
const
=
0
;
//! Sound portal target sound receiver setter
virtual
void
SetSoundPortalSoundReceiver
(
const
int
iSoundPortalID
,
const
int
iSoundReceiverID
)
=
0
;
//! Sound portal target sound receiver getter
virtual
int
GetSoundPortalSoundReceiver
(
const
int
iSoundPortalID
)
const
=
0
;
//! Sound portal sound source setter
virtual
void
SetSoundPortalSoundSource
(
const
int
iSoundPortalID
,
const
int
iSoundSourceID
)
=
0
;
//! Sound portal sound source getter
virtual
int
GetSoundPortalSoundSource
(
const
int
iSoundPortalID
)
const
=
0
;
virtual
CVAStruct
GetSoundPortalParameters
(
const
int
iID
)
const
=
0
;
virtual
void
SetSoundPortalParameters
(
const
int
iID
,
const
CVAStruct
&
oParams
)
=
0
;
//! Sound portal position setter
virtual
void
SetSoundPortalPosition
(
const
int
iSoundPortalID
,
const
VAVec3
&
vPos
)
=
0
;
//! Sound portal position getter
virtual
VAVec3
SetSoundPortalPosition
(
const
int
iSoundPortalID
)
const
=
0
;
//! Sound portal orientation setter
virtual
void
SetSoundPortalOrientation
(
const
int
iSoundPortalID
,
const
VAQuat
&
qOrient
)
=
0
;
//! Sound portal orientation getter
virtual
VAQuat
GetSoundPortalOrientation
(
const
int
iSoundPortalID
)
const
=
0
;
//! Returns all available renderers (default: only those that are enabled)
/**
* @param [out] voRenderer List of renderers modules
...
...
@@ -1022,7 +1061,7 @@ public:
* \note Also substitutes macros
* \note Prints a warning if file not found or ambiguous name
*/
virtual
std
::
string
FindFilePath
(
const
std
::
string
&
sFilePath
)
const
;
virtual
std
::
string
FindFilePath
(
const
std
::
string
&
sFilePath
)
const
=
0
;
static
bool
IsValidAuralizationMode
(
const
int
iAuralizationMode
);
...
...
include/VACoreEvent.h
View file @
66f62523
...
...
@@ -24,7 +24,7 @@
class
IVACore
;
// Helper macro for 64-bit bitmasks
#define VA_BIT64( i ) ( ( ( const uint64_t ) 1) << i )
#define VA_BIT64( i ) ( ( ( const uint64_t ) 1
) << i )
//! Data class encapsulating events of a VACore
class
VABASE_API
CVACoreEvent
...
...
@@ -50,23 +50,24 @@ public:
static
const
uint64_t
VA_COREEVENT_SAMPLE_LOADED
=
VA_BIT64
(
11
);
static
const
uint64_t
VA_COREEVENT_SAMPLE_FREED
=
VA_BIT64
(
12
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CREATED
=
VA_BIT64
(
13
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_DELETED
=
VA_BIT64
(
14
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CHANGED_NAME
=
VA_BIT64
(
15
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CHANGED_SIGNALSOURCE
=
VA_BIT64
(
16
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CHANGED_AURALIZATIONMODE
=
VA_BIT64
(
17
);
static
const
uint64_t
VA_COREEVENT_SOUND
SOURCE_CHANGED_VOLUME
=
VA_BIT64
(
18
);
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING
=
VA_BIT64
(
19
);
static
const
uint64_t
VA_COREEVENT_SOUND
SOURCE_CHANGED_POSITIONORIENTATION
=
VA_BIT64
(
20
);
static
const
uint64_t
VA_COREEVENT_
LISTEN
ER_CREATED
=
VA_BIT64
(
21
);
static
const
uint64_t
VA_COREEVENT_
LISTEN
ER_DELETED
=
VA_BIT64
(
22
);
static
const
uint64_t
VA_COREEVENT_
LISTEN
ER_CHANGED_NAME
=
VA_BIT64
(
23
);
static
const
uint64_t
VA_COREEVENT_
LISTEN
ER_CHANGED_AURALIZATIONMODE
=
VA_BIT64
(
24
);
static
const
uint64_t
VA_COREEVENT_
LISTENER_CHANGED_POSITIONORIENTATION
=
VA_BIT64
(
25
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CREATED
=
VA_BIT64
(
13
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_DELETED
=
VA_BIT64
(
14
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_NAME
=
VA_BIT64
(
15
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_SIGNALSOURCE
=
VA_BIT64
(
16
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_AURALIZATIONMODE
=
VA_BIT64
(
17
);
static
const
uint64_t
VA_COREEVENT_SOUND
_SOURCE_CHANGED_SOUND_POWER
=
VA_BIT64
(
18
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_MUTING
=
VA_BIT64
(
19
);
static
const
uint64_t
VA_COREEVENT_SOUND
_SOURCE_CHANGED_POSE
=
VA_BIT64
(
20
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIV
ER_CREATED
=
VA_BIT64
(
21
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIV
ER_DELETED
=
VA_BIT64
(
22
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_NAME
=
VA_BIT64
(
23
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_AURALIZATIONMODE
=
VA_BIT64
(
24
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_POSE
=
VA_BIT64
(
25
);
static
const
uint64_t
VA_COREEVENT_PORTAL_CHANGED_NAME
=
VA_BIT64
(
26
);
static
const
uint64_t
VA_COREEVENT_PORTAL_CHANGED_STATE
=
VA_BIT64
(
27
);
static
const
uint64_t
VA_COREEVENT_PORTAL_CHANGED_POSE
=
VA_BIT64
(
27
);
static
const
uint64_t
VA_COREEVENT_PORTAL_CHANGED_PARAMETER
=
VA_BIT64
(
41
);
static
const
uint64_t
VA_COREEVENT_ACTIVE_LISTENER_CHANGED
=
VA_BIT64
(
28
);
static
const
uint64_t
VA_COREEVENT_INPUTGAIN_CHANGED
=
VA_BIT64
(
29
);
...
...
@@ -75,63 +76,63 @@ public:
static
const
uint64_t
VA_COREEVENT_OUTPUTMUTING_CHANGED
=
VA_BIT64
(
32
);
static
const
uint64_t
VA_COREEVENT_GLOBALAURALIZATIONMODE_CHANGED
=
VA_BIT64
(
33
);
static
const
uint64_t
VA_COREEVENT_
HRIR_LOADED
=
VA_BIT64
(
34
);
static
const
uint64_t
VA_COREEVENT_
HRIR_FREED
=
VA_BIT64
(
35
);
static
const
uint64_t
VA_COREEVENT_
LISTENER_CHANGED_HRIR
=
VA_BIT64
(
36
);
static
const
uint64_t
VA_COREEVENT_
UNSPECIFIED_34
=
VA_BIT64
(
34
);
static
const
uint64_t
VA_COREEVENT_
UNSPECIFIED_35
=
VA_BIT64
(
35
);
static
const
uint64_t
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_DIRECTIVITY
=
VA_BIT64
(
36
);
static
const
uint64_t
VA_COREEVENT_MEASURES_UPDATE
=
VA_BIT64
(
37
);
static
const
uint64_t
VA_COREEVENT_RESET
=
VA_BIT64
(
38
);
// DO NOT USE AS A KOMBINED EVENT TYPE
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_CHANGED_DIRECTIVITY
=
VA_BIT64
(
39
);
static
const
uint64_t
VA_COREEVENT_RESET
=
VA_BIT64
(
38
);
static
const
uint64_t
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_DIRECTIVITY
=
VA_BIT64
(
39
);
// Nachricht das ein Core gelscht wird.
static
const
uint64_t
VA_COREEVENT_DESTROY
=
VA_BIT64
(
40
);
// Next free slot: 42
// Selector mask for signal source related events
static
const
uint64_t
VA_COREEVENT_SIGNALSOURCE_EVENT
=
VA_COREEVENT_SIGNALSOURCE_CREATED
|
VA_COREEVENT_SIGNALSOURCE_DELETED
|
VA_COREEVENT_SIGNALSOURCE_REGISTERED
|
VA_COREEVENT_SIGNALSOURCE_UNREGISTERED
|
VA_COREEVENT_SIGNALSOURCE_STATE_CHANGED
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_SIGNALSOURCE
;
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_SIGNALSOURCE
;
// Selector mask for sound source related events
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_EVENT
=
VA_COREEVENT_SOUNDSOURCE_CREATED
|
VA_COREEVENT_SOUNDSOURCE_DELETED
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_NAME
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_SIGNALSOURCE
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_SOUND
SOURCE_CHANGED_VOLUME
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING
|
VA_COREEVENT_SOUND
SOURCE_CHANGED_POSITIONORIENTATION
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_DIRECTIVITY
;
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_EVENT
=
VA_COREEVENT_SOUND
_
SOURCE_CREATED
|
VA_COREEVENT_SOUND
_
SOURCE_DELETED
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_NAME
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_SIGNALSOURCE
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_SOUND
_SOURCE_CHANGED_SOUND_POWER
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_MUTING
|
VA_COREEVENT_SOUND
_SOURCE_CHANGED_POSE
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_DIRECTIVITY
;
// Selector mask for listener related events
static
const
uint64_t
VA_COREEVENT_LISTENER_EVENT
=
VA_COREEVENT_
LISTEN
ER_CREATED
|
VA_COREEVENT_
LISTEN
ER_DELETED
|
VA_COREEVENT_
LISTEN
ER_CHANGED_NAME
|
VA_COREEVENT_
LISTEN
ER_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_
LISTENER_CHANGED_HRIR
|
VA_COREEVENT_
LISTENER_CHANGED_POSITIONORIENTATION
;
static
const
uint64_t
VA_COREEVENT_LISTENER_EVENT
=
VA_COREEVENT_
SOUND_RECEIV
ER_CREATED
|
VA_COREEVENT_
SOUND_RECEIV
ER_DELETED
|
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_NAME
|
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_DIRECTIVITY
|
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_POSE
;
// Selector mask for portal related events
static
const
uint64_t
VA_COREEVENT_PORTAL_EVENT
=
VA_COREEVENT_PORTAL_CHANGED_NAME
|
VA_COREEVENT_PORTAL_CHANGED_
STATE
;
VA_COREEVENT_PORTAL_CHANGED_
PARAMETER
;
// Selector mask for sound source modification event
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_MODIFICATION
=
VA_COREEVENT_SOUNDSOURCE_CHANGED_NAME
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_SIGNALSOURCE
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_SOUND
SOURCE_CHANGED_VOLUME
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING
|
VA_COREEVENT_SOUND
SOURCE_CHANGED_POSITIONORIENTATION
|
VA_COREEVENT_SOUNDSOURCE_CHANGED_DIRECTIVITY
;
static
const
uint64_t
VA_COREEVENT_SOUNDSOURCE_MODIFICATION
=
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_NAME
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_SIGNALSOURCE
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_SOUND
_SOURCE_CHANGED_SOUND_POWER
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_MUTING
|
VA_COREEVENT_SOUND
_SOURCE_CHANGED_POSE
|
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_DIRECTIVITY
;
// Selector mask for listener modification event
static
const
uint64_t
VA_COREEVENT_LISTENER_MODIFICATION
=
VA_COREEVENT_
LISTEN
ER_CHANGED_NAME
|
VA_COREEVENT_
LISTEN
ER_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_
LISTENER_CHANGED_HRIR
|
VA_COREEVENT_
LISTENER_CHANGED_POSITIONORIENTATION
;
static
const
uint64_t
VA_COREEVENT_LISTENER_MODIFICATION
=
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_NAME
|
VA_COREEVENT_
SOUND_RECEIV
ER_CHANGED_AURALIZATIONMODE
|
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_DIRECTIVITY
|
VA_COREEVENT_
SOUND_RECEIVER_CHANGED_POSE
;
IVACore
*
pSender
;
...
...
@@ -148,11 +149,12 @@ public:
bool
bMuted
;
std
::
string
sName
;
std
::
string
sFilename
;
// All angles in degrees!
VAVec3
vPos
,
vView
,
vUp
,
vVelocity
;
VAOrientYPR
oOrientation
;
VAVec3
vPos
,
vView
,
vUp
,
qHATO
;
VAQuat
oOrientation
;
std
::
vector
<
float
>
vfInputPeaks
;
// Peak values of the input channels [factor]
std
::
vector
<
float
>
vfInputRMSs
;
// RMS values of the input channels [factor]
std
::
vector
<
float
>
vfOutputPeaks
;
// Peak values of the output channels [factor]
std
::
vector
<
float
>
vfOutputRMSs
;
// RMS values of the output channels [factor]
float
fSysLoad
,
fDSPLoad
;
// System and DSP load [percent]
double
dCoreClock
;
// Current value of the core clock [s]
...
...
include/VAEventHandlerGlobalLock.h
View file @
66f62523
...
...
@@ -31,10 +31,10 @@ public:
static
IVAEventHandlerGlobalLock
&
GetInstance
();
// Lock (blocking wait, no try)
virtual
void
Lock
()
const
=
0
;
virtual
void
Lock
()
const
=
0
;
// Unlock
virtual
void
Unlock
()
const
=
0
;
virtual
void
Unlock
()
const
=
0
;
protected:
inline
IVAEventHandlerGlobalLock
()
{};
...
...
include/VAObject.h
View file @
66f62523
...
...
@@ -47,12 +47,9 @@ public:
//! Call the object with a message and capture return message
/**
* \return >0, if the object returned an answer message
* 0, if the object did not return an answer message
* -1, if the message could not be handled
*/
// TODO: Int als Rckgabe? @todo jst: remove return value, unnecessary. But check consequence.
virtual
int
CallObject
(
const
CVAStruct
&
oArgs
,
CVAStruct
&
oReturn
);
*
*/
virtual
CVAStruct
CallObject
(
const
CVAStruct
&
oArgs
)
=
0
;
protected:
// Important: An object may not change its name after it is registered
...
...
@@ -63,7 +60,7 @@ private:
std
::
string
m_sObjectName
;
// Note: This may only be called from an object registry
void
SetObjectID
(
int
iID
);
void
SetObjectID
(
const
int
iID
);
friend
class
CVAObjectRegistry
;
};
...
...
include/VAObjectRegistry.h
View file @
66f62523
...
...
@@ -47,7 +47,7 @@ public:
void
UnregisterObject
(
CVAObject
*
pObject
);
//! Query the IDs of all objects
void
GetObjectIDs
(
std
::
vector
<
int
>&
viIDs
)
const
;
void
GetObjectIDs
(
std
::
vector
<
int
>&
viIDs
)
const
;
//! Query information on all objects
void
GetObjectInfos
(
std
::
vector
<
CVAObjectInfo
>&
viInfos
)
const
;
...
...
@@ -56,7 +56,7 @@ public:
/**
* \return Pointer to the object, NULL if not found
*/
CVAObject
*
FindObjectByID
(
int
iID
)
const
;
CVAObject
*
FindObjectByID
(
const
int
iID
)
const
;
//! Finds the object with the given name
/**
...
...
@@ -70,7 +70,7 @@ public:
* \return Pointer to the object
* \note Throws an exception "invalid object ID" in case the object does not exist
*/
CVAObject
*
GetObjectByID
(
int
iID
)
const
;
CVAObject
*
GetObjectByID
(
const
int
iID
)
const
;
//! Returns the object with the given name
/**
...
...
@@ -84,13 +84,13 @@ public:
/**
* \returns Throws an "invalid object ID" exception, if the object does not exist
*/
void
CallObjectByID
(
int
iID
,
const
CVAStruct
&
oArgs
,
CVAStruct
&
oReturn
)
const
;
CVAStruct
CallObjectByID
(
const
int
iID
,
const
CVAStruct
&
oArgs
)
const
;
//! Calls an object determined by its name
/**
* \returns Throws an "unknown object" exception, if the object does not exist
*/
void
CallObjectByName
(
const
std
::
string
&
sName
,
const
CVAStruct
&
oArgs
,
CVAStruct
&
oReturn
)
const
;
CVAStruct
CallObjectByName
(
const
std
::
string
&
sName
,
const
CVAStruct
&
oArgs
)
const
;
private:
std
::
vector
<
CVAObject
*
>
m_vpObjects
;
// Object table (O(1) lookups!)
...
...
include/VASamples.h
View file @
66f62523
...
...
@@ -32,7 +32,7 @@ class VABASE_API CVASampleBuffer
{
public:
CVASampleBuffer
();
CVASampleBuffer
(
int
iNumSamples
,
bool
bZeroInit
=
true
);
CVASampleBuffer
(
const
int
iNumSamples
,
const
bool
bZeroInit
=
true
);
CVASampleBuffer
(
const
CVASampleBuffer
&
);
virtual
~
CVASampleBuffer
();
...
...
include/VAStruct.h
View file @
66f62523
...
...
@@ -98,7 +98,7 @@ public:
* \return Valid pointer, if the given key exists,
* nullptr, otherwise
*/
const
CVAStructValue
*
GetValue
(
const
std
::
string
&
sPath
,
char
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
)
const
;
const
CVAStructValue
*
GetValue
(
const
std
::
string
&
sPath
,
c
onst
c
har
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
)
const
;
//! Return the pointer to a key (read-write)
/**
...
...
@@ -111,15 +111,21 @@ public:
* \return Valid pointer, if the given key exists,
* nullptr, otherwise
*/
CVAStructValue
*
GetValue
(
const
std
::
string
&
sPath
,
char
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
);
CVAStructValue
*
GetValue
(
const
std
::
string
&
sPath
,
c
onst
c
har
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
);
//! Read-only data access
const
CVAStructValue
&
operator
[](
const
char
*
pcKey
)
const
;
inline
const
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
const
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
inline
const
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
const
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
//! Read/write data access
CVAStructValue
&
operator
[](
const
char
*
pcKey
);
inline
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
inline
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
//! Assignment
CVAStruct
&
operator
=
(
const
CVAStruct
&
rhs
);
...
...
@@ -131,10 +137,10 @@ public:
CVAStruct
::
const_iterator
End
()
const
;
//! Merge struct with another one
void
Merge
(
const
CVAStruct
&
rhs
,
bool
bUnique
=
true
);
void
Merge
(
const
CVAStruct
&
rhs
,
const
bool
bUnique
=
true
);
//! Return a string representation of the container
std
::
string
ToString
(
int
iIndent
=
0
)
const
;
std
::
string
ToString
(
const
int
iIndent
=
0
)
const
;
private:
typedef
std
::
map
<
std
::
string
,
CVAStructValue
,
compareStringCaseInsensitive
>
Map
;
typedef
Map
::
const_iterator
MapCit
;
...
...
@@ -142,8 +148,8 @@ private:
Map
m_mData
;
// Traversal methods
const
CVAStructValue
*
Traverse
(
const
std
::
string
&
sPath
,
size_t
iPathCursor
=
0
,
char
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
)
const
;
CVAStructValue
*
Traverse
(
const
std
::
string
&
sPath
,
size_t
iPathCursor
=
0
,
char
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
);
const
CVAStructValue
*
Traverse
(
const
std
::
string
&
sPath
,
size_t
iPathCursor
=
0
,
c
onst
c
har
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
)
const
;
CVAStructValue
*
Traverse
(
const
std
::
string
&
sPath
,
size_t
iPathCursor
=
0
,
c
onst
c
har
cPathSeparator
=
DEFAULT_PATH_SEPARATOR
);
};
//! Associative array value class
...
...
@@ -171,13 +177,13 @@ public:
CVAStructValue
();
//! Initialization constructors
CVAStructValue
(
bool
value
);
CVAStructValue
(
int
value
);
CVAStructValue
(
double
value
);
CVAStructValue
(
const
bool
value
);
CVAStructValue
(
const
int
value
);
CVAStructValue
(
const
double
value
);
CVAStructValue
(
const
char
*
value
);
CVAStructValue
(
const
std
::
string
&
value
);
CVAStructValue
(
const
CVAStruct
&
value
);
CVAStructValue
(
void
*
pData
,
int
iBytes
);
CVAStructValue
(
void
*
pData
,
const
int
iBytes
);
CVAStructValue
(
const
CVASampleBuffer
&
);
//! Copy constructor
...
...
@@ -197,7 +203,7 @@ public:
void
*
GetData
();
//! Sets the data (only for datatype DATA)
void
SetData
(
void
*
pData
,
int
iBytes
);
void
SetData
(
void
*
pData
,
const
int
iBytes
);
//! Returns a pointer to the struct value (only for datatype STRUCT)
const
CVAStruct
&
GetStruct
()
const
;
...
...
@@ -216,9 +222,9 @@ public:
//! Assignment operators
CVAStructValue
&
operator
=
(
const
CVAStructValue
&
);
CVAStructValue
&
operator
=
(
bool
);
CVAStructValue
&
operator
=
(
int
);
CVAStructValue
&
operator
=
(
double
);
CVAStructValue
&
operator
=
(
const
bool
);
CVAStructValue
&
operator
=
(
const
int
);
CVAStructValue
&
operator
=
(
const
double
);
CVAStructValue
&
operator
=
(
const
char
*
);
CVAStructValue
&
operator
=
(
const
std
::
string
&
);
CVAStructValue
&
operator
=
(
const
CVASampleBuffer
&
);
...
...
@@ -230,7 +236,10 @@ public:
//! Read/write data access
// Note: Is applicable only for struct keys
CVAStructValue
&
operator
[](
const
char
*
pcKey
);
inline
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
inline
CVAStructValue
&
operator
[](
const
std
::
string
&
sKey
)
{
return
(
*
this
)[
sKey
.
c_str
()
];
};
//! Cast to bool operator (required for assignments of the form 'bool = CVAStructKey')
operator
bool
()
const
;
...
...
src/VACore.cpp
View file @
66f62523
...
...
@@ -58,6 +58,7 @@ public:
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_NEARFIELD
);
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_DOPPLER
);
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_SPREADING_LOSS
);
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_TRANSMISSION
);
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_DEFAULT
);
VACORE_REGISTER_LITERAL
(
VA_AURAMODE_ALL
);
};
...
...
@@ -128,6 +129,7 @@ int ParseAuralizationModeToken( const std::string& t )
if
(
t
==
"NF"
)
return
IVACore
::
VA_AURAMODE_NEARFIELD
;
if
(
t
==
"DP"
)
return
IVACore
::
VA_AURAMODE_DOPPLER
;
if
(
t
==
"SL"
)
return
IVACore
::
VA_AURAMODE_SPREADING_LOSS
;
if
(
t
==
"TR"
)
return
IVACore
::
VA_AURAMODE_TRANSMISSION
;
return
-
1
;
}
...
...
@@ -303,6 +305,7 @@ std::string IVACore::GetAuralizationModeStr( const int iAuralizationMode, const
if
(
iAuralizationMode
&
VA_AURAMODE_NEARFIELD
)
ss
<<
"NF, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_DOPPLER
)
ss
<<
"DP, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_SPREADING_LOSS
)
ss
<<
"SL, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_TRANSMISSION
)
ss
<<
"TR, "
;
}
else
{
...
...
@@ -319,6 +322,7 @@ std::string IVACore::GetAuralizationModeStr( const int iAuralizationMode, const
if
(
iAuralizationMode
&
VA_AURAMODE_NEARFIELD
)
ss
<<
"near-field effects, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_DOPPLER
)
ss
<<
"doppler shifts, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_SPREADING_LOSS
)
ss
<<
"spherical spreading loss, "
;
if
(
iAuralizationMode
&
VA_AURAMODE_TRANSMISSION
)
ss
<<
"transmission, "
;
}
// Remove last ,_
...
...
src/VACoreEvent.cpp
View file @
66f62523
...
...
@@ -51,15 +51,7 @@ std::string CVACoreEvent::ToString() const
case
VA_COREEVENT_DIRECTIVITY_FREED
:
ss
<<
"Directivity "
<<
iObjectID
<<
" freed"
;
break
;
case
VA_COREEVENT_HRIR_LOADED
:
ss
<<
"HRIR dataset loaded (ID = "
<<
iObjectID
<<
")"
;
break
;
case
VA_COREEVENT_HRIR_FREED
:
ss
<<
"HRIR dataset "
<<
iObjectID
<<
" freed"
;
break
;
case
VA_COREEVENT_SIGNALSOURCE_CREATED
:
ss
<<
"Signal source created (ID = "
<<
sObjectID
<<
")"
;
break
;
...
...
@@ -76,69 +68,69 @@ std::string CVACoreEvent::ToString() const
ss
<<
"Sample "
<<
iObjectID
<<
" freed"
;
break
;
case
VA_COREEVENT_SOUNDSOURCE_CREATED
:
case
VA_COREEVENT_SOUND
_
SOURCE_CREATED
:
ss
<<
"Sound source created (ID = "
<<
iObjectID
<<
", amode = "
<<
IVACore
::
GetAuralizationModeStr
(
iAuralizationMode
)
<<
", volume = "
<<
IVACore
::
GetVolumeStrDecibel
(
dVolume
)
<<
")"
;
break
;
case
VA_COREEVENT_SOUNDSOURCE_DELETED
:
case
VA_COREEVENT_SOUND
_
SOURCE_DELETED
:
ss
<<
"Sound source "
<<
iObjectID
<<
" deleted"
;
break
;
case
VA_COREEVENT_SOUNDSOURCE_CHANGED_NAME
:
case
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_NAME
:
ss
<<
"Sound source "
<<
iObjectID
<<
" changed name to
\"
"
<<
sName
<<
"
\"
"
;
break
;
case
VA_COREEVENT_SOUNDSOURCE_CHANGED_SIGNALSOURCE
:
case
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_SIGNALSOURCE
:
ss
<<
"Sound source "
<<
iObjectID
<<
" changed signal source to
\"
"
<<
sParam
<<
"
\"
"
;
break
;
case
VA_COREEVENT_SOUNDSOURCE_CHANGED_AURALIZATIONMODE
:
case
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_AURALIZATIONMODE
:
ss
<<
"Sound source "
<<
iObjectID
<<
" changed auralization mode to "
<<
IVACore
::
GetAuralizationModeStr
(
iAuralizationMode
);
break
;
case
VA_COREEVENT_SOUND
SOURCE_CHANGED_VOLUME
:
case
VA_COREEVENT_SOUND
_SOURCE_CHANGED_SOUND_POWER
:
ss
<<
"Sound source "
<<
iObjectID
<<
" changed volume to "
<<
IVACore
::
GetVolumeStrDecibel
(
dVolume
);
break
;
case
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING
:
case
VA_COREEVENT_SOUND
_
SOURCE_CHANGED_MUTING
:
ss
<<
"Sound source "
<<
iObjectID
<<
(
bMuted
?
" muted"
:
" unmuted"
);
break
;
case
VA_COREEVENT_SOUND
SOURCE_CHANGED_POSITIONORIENTATION
:
case
VA_COREEVENT_SOUND
_SOURCE_CHANGED_POSE
: