Adding more for portals, renaming listener to more abstract sound receiver

parent 326c4939
......@@ -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 CVASoundPortalInfo
{
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 CVASoundPortalInfo()
: iID( -1 )
, iNextPortalID( -1 )
, iSoundSourceID( -1 )
, iSoundReceiverID( -1 )
, iMaterialID( -1 )
{};
virtual inline ~CVAPortalInfo() {};
virtual inline ~CVASoundPortalInfo() {};
};
//! 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
......@@ -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 CVASoundPortalInfo 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 );
......
......@@ -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_SOUNDSOURCE_CHANGED_VOLUME = VA_BIT64( 18 );
static const uint64_t VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING = VA_BIT64( 19 );
static const uint64_t VA_COREEVENT_SOUNDSOURCE_CHANGED_POSITIONORIENTATION = VA_BIT64( 20 );
static const uint64_t VA_COREEVENT_LISTENER_CREATED = VA_BIT64( 21 );
static const uint64_t VA_COREEVENT_LISTENER_DELETED = VA_BIT64( 22 );
static const uint64_t VA_COREEVENT_LISTENER_CHANGED_NAME = VA_BIT64( 23 );
static const uint64_t VA_COREEVENT_LISTENER_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_RECEIVER_CREATED = VA_BIT64( 21 );
static const uint64_t VA_COREEVENT_SOUND_RECEIVER_DELETED = VA_BIT64( 22 );
static const uint64_t VA_COREEVENT_SOUND_RECEIVER_CHANGED_NAME = VA_BIT64( 23 );
static const uint64_t VA_COREEVENT_SOUND_RECEIVER_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_SOUNDSOURCE_CHANGED_VOLUME |
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING |
VA_COREEVENT_SOUNDSOURCE_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_LISTENER_CREATED |
VA_COREEVENT_LISTENER_DELETED |
VA_COREEVENT_LISTENER_CHANGED_NAME |
VA_COREEVENT_LISTENER_CHANGED_AURALIZATIONMODE |
VA_COREEVENT_LISTENER_CHANGED_HRIR |
VA_COREEVENT_LISTENER_CHANGED_POSITIONORIENTATION;
static const uint64_t VA_COREEVENT_LISTENER_EVENT = VA_COREEVENT_SOUND_RECEIVER_CREATED |
VA_COREEVENT_SOUND_RECEIVER_DELETED |
VA_COREEVENT_SOUND_RECEIVER_CHANGED_NAME |
VA_COREEVENT_SOUND_RECEIVER_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_SOUNDSOURCE_CHANGED_VOLUME |
VA_COREEVENT_SOUNDSOURCE_CHANGED_MUTING |
VA_COREEVENT_SOUNDSOURCE_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_LISTENER_CHANGED_NAME |
VA_COREEVENT_LISTENER_CHANGED_AURALIZATIONMODE |
VA_COREEVENT_LISTENER_CHANGED_HRIR |
VA_COREEVENT_LISTENER_CHANGED_POSITIONORIENTATION;
static const uint64_t VA_COREEVENT_LISTENER_MODIFICATION = VA_COREEVENT_SOUND_RECEIVER_CHANGED_NAME |
VA_COREEVENT_SOUND_RECEIVER_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]
......
......@@ -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() {};
......
......@@ -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;
};
......
......@@ -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!)
......
......@@ -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();
......
......@@ -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, const char 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, const char 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, const char cPathSeparator = DEFAULT_PATH_SEPARATOR ) const;
CVAStructValue* Traverse( const std::string& sPath, size_t iPathCursor = 0, const char 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;
......
......@@ -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 ,_
......
......@@ -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_SOUNDSOURCE_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_SOUNDSOURCE_CHANGED_POSITIONORIENTATION:
case VA_COREEVENT_SOUND_SOURCE_CHANGED_POSE:
ss << "Sound source " << iObjectID << " changed position orientation" << std::endl
<< "P=" << vPos << ", "
<< "V=" << vView << ", "
<< "U=" << vUp;
break;