Starting to remove unused classes

parent d1fd3764
......@@ -36,7 +36,7 @@ public:
inline VAVec3() : x( 0 ), y( 0 ), z( 0 ) {};
inline VAVec3( const VAVec3& v ) : x( v.x ), y( v.y ), z( v.z ) {};
inline VAVec3( double x, double y, double z ) : x( x ), y( y ), z( z ) {};
inline VAVec3( const double x, const double y, const double z ) : x( x ), y( y ), z( z ) {};
inline virtual ~VAVec3() {};
inline virtual double Length() const
......@@ -44,7 +44,7 @@ public:
return sqrt( x*x + y*y + z*z );
};
inline virtual void Set( double x_, double y_, double z_ )
inline virtual void Set( const double x_, const double y_, const double z_ )
{
x = x_;
y = y_;
......@@ -112,36 +112,42 @@ inline VABASE_API VAVec3 operator*( const VAVec3& oVec, double dScalar )
return vScaledVector;
};
//! Stream output operator
// Output format: "<1, 2, 3>"
//! Stream output operator for VAVec3
// Output format: "< x, y, z >"
VABASE_API std::ostream& operator<<( std::ostream& os, const VAVec3& oVec );
//! Orientation Yaw-Pitch-Roll angles (double precision) in degree (if not states otherwise)
/**
* @warn Deprecated, will be removed by VAQuat
*/
class VABASE_API VAOrientYPR
//! 4-element Quaternion (double precision)
class VABASE_API VAQuat
{
public:
double yaw; //!< Right-hand rotation around Y-axis
double pitch; //!< Right-hand rotation around X-axis
double roll; //!< Right-hand rotation around negative Z-axis
union
{
double comp[ 4 ];
struct
{
double x, y, z, w;
};
};
inline VAOrientYPR() : yaw( 0 ), pitch( 0 ), roll( 0 ) {};
inline VAOrientYPR( double yaw, double pitch, double roll ) : yaw( yaw ), pitch( pitch ), roll( roll ) {};
inline virtual ~VAOrientYPR() {};
inline VAQuat() : x( 0 ), y( 0 ), z( 0 ), w( 1.0f ) {};
inline VAQuat( const VAQuat& v ) : x( v.x ), y( v.y ), z( v.z ), w( v.w ) {};
inline VAQuat( const double x, const double y, const double z ) : x( x ), y( y ), z( z ), w( w ) {};
inline virtual ~VAQuat() {};
inline virtual void Set( double yaw_deg, double pitch_deg, double roll_deg )
inline virtual void Set( const double x_, const double y_, const double z_, const double w_ )
{
yaw = yaw_deg;
pitch = pitch_deg;
roll = roll_deg;
x = x_;
y = y_;
z = z_;
w = w_;
};
};
//! Stream output operator
// Output format: "<1, 2, 3>"
VABASE_API std::ostream& operator<<( std::ostream& os, const VAOrientYPR& oOrient );
//! Stream output operator for Quaternion
// Output format: "< x, y, z, 'w' >"
VABASE_API std::ostream& operator<<( std::ostream& os, const VAQuat& oOrient );
//! Data class describing callable and registrable objects
......@@ -195,7 +201,7 @@ public:
std::string sSubaction; //!< Currently performed sub action
//! Constructor
inline CVAProgress()
inline CVAProgress()
: iCurrentStep( 0 )
, iMaxStep( 0 )
{
......@@ -219,7 +225,7 @@ public:
* \param sTheName Name string of the integer literal, i.e. 'VA_AURAMOD_DEFAULT'
* \param iTheValue Value of the integer
*/
inline CVAIntLiteral( const std::string& sTheScope, const std::string& sTheName, int iTheValue )
inline CVAIntLiteral( const std::string& sTheScope, const std::string& sTheName, const int iTheValue )
: sScope( sTheScope )
, sName( sTheName )
, iValue( iTheValue )
......@@ -227,63 +233,34 @@ public:
};
};
//! Data class containing information of loaded directivities
//! Data class containing information of loaded directivities for sources and receivers
class VABASE_API CVADirectivityInfo
{
public:
int iID; //!< ID
std::string sName; //!< Name (optional)
std::string sFilename; //!< Filename
std::string sDesc; //!< Description (e.g. resolution)
int iReferences; //!< Number of references
// TODO: Auflsung usw.
//! Default constructor
inline CVADirectivityInfo()
: iID( -1 )
, iReferences( 0 )
enum DirectivityType
{
RECEIVER = 0,
SOURCE,
};
//! Initializing constructor
/**
* \param iID Identifier
* \param sName Name of directivity
* \param sFilename Path to the data file
* \param sDesc Brief description of the directivity
* \param iReferences Usage reference count of directivity data
*/
inline CVADirectivityInfo( int iID,
const std::string& sName,
const std::string& sFilename,
const std::string& sDesc,
int iReferences )
enum DirectivityClass
{
this->iID = iID;
this->sName = sName;
this->sFilename = sFilename;
this->sDesc = sDesc;
this->iReferences = iReferences;
IMPULSE_RESPONSE = 0,
TRANSFER_FUNCTION,
ENERGETIC_BAND_SPECTRUM,
};
};
//! Data class containing information of loaded HRIR datasets
/**
* Head-related impulse respone (HRIR) data class
*/
class VABASE_API CVAHRIRInfo
{
public:
int iID; //!< ID
int iType;
int iClass;
std::string sName; //!< Name (optional)
std::string sFilename; //!< Filename
std::string sDesc; //!< Description (e.g. resolution)
int iReferences; //!< Number of references
// TODO: More fields?
// TODO: Auflsung usw.
//! Default constructor
inline CVAHRIRInfo()
inline CVADirectivityInfo()
: iID( -1 )
, iReferences( 0 )
{
......@@ -292,16 +269,12 @@ public:
//! Initializing constructor
/**
* \param iID Identifier
* \param sName Name of HRIR
* \param sName Name of directivity
* \param sFilename Path to the data file
* \param sDesc Brief description of the HRIR
* \param iReferences Usage reference count of HRIR data
* \param sDesc Brief description of the directivity
* \param iReferences Usage reference count of directivity data
*/
inline CVAHRIRInfo( int iID,
const std::string& sName,
const std::string& sFilename,
const std::string& sDesc,
int iReferences )
inline CVADirectivityInfo( const int iID, const std::string& sName, const std::string& sFilename, const std::string& sDesc, const int iReferences )
{
this->iID = iID;
this->sName = sName;
......@@ -312,48 +285,6 @@ public:
};
//! Data class containing information of loaded sounds
class VABASE_API CVASoundInfo
{
public:
int iID; //!< ID
std::string sName; //!< Name (optional)
std::string sFilename; //!< Filename
int iLength; //!< Length [Samples]
double dDuration; //!< Duration [s]
//! Default constructor
inline CVASoundInfo()
: iID( -1 )
, iLength( 0 )
, dDuration( 0 )
{
};
//! Initializing constructor
/**
* \param iID Identifier
* \param sName Name of sound
* \param sFilename Path to the data file
* \param iLength Length of track in samples
* \param dDuration Duration of track in seconds
*/
inline CVASoundInfo( int iID,
const std::string& sName,
const std::string& sFilename,
int iLength,
double dDuration )
{
this->iID = iID;
this->sName = sName;
this->sFilename = sFilename;
this->iLength = iLength;
this->dDuration = dDuration;
};
};
/* stienen fragt: ist das nicht berlagernd mit IVAAudioSignalSource? */
//! Data class for signal source information
class VABASE_API CVASignalSourceInfo
{
......@@ -367,6 +298,7 @@ public:
//! Default constructor
inline CVASignalSourceInfo() : iReferences( 0 ) {};
inline ~CVASignalSourceInfo() {};
//! Initializing constructor
/**
......@@ -377,7 +309,7 @@ public:
* \param sState State description of signal source info
* \param iReference Usage reference counter
*/
inline CVASignalSourceInfo( const std::string& sID, const std::string& sType, const std::string& sName, const std::string& sDesc, const std::string& sState, int iReferences )
inline CVASignalSourceInfo( const std::string& sID, const std::string& sType, const std::string& sName, const std::string& sDesc, const std::string& sState, const int iReferences )
{
this->sID = sID;
this->sType = sType;
......@@ -385,17 +317,19 @@ public:
this->sDesc = sDesc;
this->sState = sState;
this->iReferences = iReferences;
}
};
};
//! Data class containing information of a loaded scene
//! Data class containing information of a virtual acoustic scene
class VABASE_API CVASceneInfo
{
public:
//std::string sName; //!< Name (optional)
//std::string sFilename; //!< Scene filename (e.g. RAVEN project file)
// TODO: More fields, num polygons, num portals, num rooms, etc.
std::string sID; //!< Scene identifier
std::string sName; //!< Scene name
CVAStruct oParams; //!< Scene parameters
inline virtual ~CVASceneInfo() {};
};
......@@ -432,29 +366,32 @@ public:
int iID; //!< ID
std::string sName; //!< Displayed name
VAVec3 vPos; //!< Position vector [m]
VAVec3 vVel; //!< Velocity vector [m/s]
VAVec3 vView, vUp; //!< View-/Up vector
VAOrientYPR oOrient; //!< Orientation (Yaw-Pitch-Roll)
VAQuat oOrient; //!< Orientation (quaternion)
double dVolume; //!< Volume
bool bMuted; //!< Muted?
int iSignalSourceID; //!< ID of assigned signal source (-1 => none)
int iDirectivityID; //!< ID of assigned directivity (-1 => none)
int iAuraMode; //!< Auralization mode (flags)
virtual inline ~CVASoundSourceInfo() {};
};
//! Data class containing information of a listener (acoustic receiver)
class VABASE_API CVAListenerInfo
class VABASE_API CVASoundReceiverInfo
{
public:
int iID; //!< ID
std::string sName; //!< Displayed name
VAVec3 vPos; //!< Position vector [m]
VAVec3 vVel; //!< Velocity vector [m/s]
VAVec3 vView, vUp; //!< View-/Up-vector
VAOrientYPR oOrient; //!< Orientation (Yaw-Pitch-Roll)
int iHRIRDatasetID; //!< ID of assigned HRIR dataset (-1 => none)
int iAuraMode; //!< Auralization mode (flags)
int iID; //!< ID
std::string sName; //!< Displayed name
VAVec3 vPos; //!< Position vector [m]
VAVec3 vVel; //!< Velocity vector [m/s]
VAVec3 vView, vUp; //!< View-/Up-vector
VAQuat oOrient; //!< Orientation (quaternion)
int iDirectivityID; //!< ID of assigned directivity (-1 => none)
int iAuraMode; //!< Auralization mode (flags)
virtual inline ~CVASoundReceiverInfo() {};
};
......@@ -462,12 +399,14 @@ public:
class VABASE_API CVAPortalInfo
{
public:
int iID; //!< ID
std::string sName; //!< Displayed name (optional)
VAVec3 vPos; //!< Position vector [m]
VAVec3 vView, vUp; //!< View-/Up-vector
VAOrientYPR oOrient; //!< Orientation (Yaw-Pitch-Roll)
double dState; //!< Portal state [0..1] (0 => fully closed, 1 => fully opened)
int iID; //!< ID
std::string sName; //!< Displayed name (optional)
VAVec3 vPos; //!< Position vector [m]
VAVec3 vView, vUp; //!< View-/Up-vector
VAQuat oOrient; //!< Orientation (quaternion)
double dState; //!< Portal state [0..1] (0 => fully closed, 1 => fully opened)
virtual inline ~CVAPortalInfo() {};
};
......
......@@ -292,20 +292,38 @@ public:
* | | *
* +----------------------------------------------------------+ */
//! Loads a HRIR dataset
//! Loads a HRIR dataset from a file
/**
* Load a dataset of head-related impulse responses (HRIRs) from
* Load a dataset of head-related impulse responses (HRIRs) from a file, i.e. DAFF format.
*
* @param[in] sFilePath File path, relative or absolute, @sa AddSearchPath
* @param[in] sName Name (optional, e.g. "Artificial head")
*
* @return Directivity identifier
*
* @note Slashes and backslashes may safely be used. Paths are automatically converted into the system's convention.
*/
inline int CreateReceiverDirectivityFromFile( const std::string& sFilePath, const std::string& sName = "" )
{
CVAStruct oDirectivityParams;
oDirectivityParams[ "FilePath" ] = sFilePath;
return CreateReceiverDirectivity( oDirectivityParams, sName );
};
//! Creates a receiver directivity, e.g. a HRTF, HRIR, binaural model
/**
* Create any receiver directivity
* a DAFF file.
*
* \param sFilePath Filename
* \param sName Name (optional, e.g. "Artificial head")
* @param[in] oParams Parameters that provide further information, i.e. for HATO hrtfs, generic models, etc.
* @param[in] sName Name (optional, e.g. "Artificial head")
*
* \return HRIR-ID
* @return HRIR-ID
*
* \note Slashes and backslashes may safely be used.
* Paths are automatically converted into the system's convention.
*/
virtual int LoadHRIRDataset( const std::string& sFilePath, const std::string& sName = "" ) = 0;
virtual int CreateReceiverDirectivity( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
//! Frees a HRIR dataset
/**
......@@ -318,66 +336,14 @@ public:
* \return true, if the HRIR dataset was successfully freed.
* false, otherwise
*/
virtual bool FreeHRIRDataset( int iHRIRID ) = 0;
virtual bool RemoveReceiverDirectivity( const int iHRIRID ) = 0;
//! Retrieves information of a loaded HRIR dataset
virtual CVAHRIRInfo GetHRIRInfo( int iHRIRID ) const = 0;
virtual CVAHRIRInfo GetReceiverDirectivityInfo( const int iHRIRID ) const = 0;
//! Retrieves information of all loaded HRIR datasets
virtual void GetHRIRInfos( std::vector< CVAHRIRInfo >& vhiDest ) const = 0;
virtual void GetReceiverDirectivityInfos( std::vector< CVAHRIRInfo >& vhiDest ) const = 0;
/* +----------------------------------------------------------+ *
* | | *
* | Sounds (deprecated, see AmbientSound) | *
* | | *
* +----------------------------------------------------------+ */
//! Loads a sound
/**
* Loads a sound from an audiofile.
*
* \param sFilePath Filename
* \param sName Name (optional, e.g. "door handle")
*
* \return Sound-ID
*
* \note The sound must be mono (single channel only)
* \note Slashes and backslashes may safely be used.
* Paths are automatically converted into the system's convention.
*/
virtual int LoadSound( const std::string& sFilePath, const std::string& sName = "" ) = 0;
//! Frees a sound
/**
* Frees a sound and releases its memory.
* This is only possible if the sound is not in use.
* Otherwise the method will do nothing.
*
* \param iSoundID Sound-ID
*
* \return true, if the sound was successfully freed.
* false, otherwise
*/
virtual bool FreeSound( int iSoundID ) = 0;
//! Retrieves information of a loaded sound
virtual CVASoundInfo GetSoundInfo( int iSoundID ) const = 0;
//! Retrieves information of all loaded sounds
virtual void GetSoundInfos( std::vector< CVASoundInfo >& vsiDest ) const = 0;
//! Plays a sound
/**
* Plays a sound (immediately). This function does not perform any spatialization or audio
* rendering. It can be used to playback warning or information sounds (diffuse).
*
* \param iSoundID Sound-ID
* \param dGain Playback gain (>0) [optional, default: 1]
*
* \return Playback-ID>0, if successful
* -1, otherwise
*/
virtual int PlaySound( int iSoundID, double dVolume = 1.0 ) const = 0;
/* +----------------------------------------------------------+ *
* | | *
......
......@@ -22,8 +22,8 @@ std::ostream& operator<<( std::ostream& os, const VAVec3& oVec )
<< "< " << oVec.x << ", " << oVec.y << ", " << oVec.z << " >";
}
std::ostream& operator<<( std::ostream& os, const VAOrientYPR& oOrient )
std::ostream& operator<<( std::ostream& os, const VAQuat& oOrient )
{
return os << std::fixed << std::setprecision( 2 )
<< "< " << oOrient.yaw << ", " << oOrient.pitch << ", " << oOrient.roll << " >";
<< "< " << oOrient.x << ", " << oOrient.y << ", " << oOrient.z << ", '" << oOrient.w << "' >";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment