Commit a76ac753 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding homogeneous medium methods

parent 986f0acf
......@@ -311,11 +311,11 @@ public:
*
* \return Signal source ID
*/
inline std::string CreateSignalSourceBufferFromFile(const std::string& sFilePath, const std::string& sName = "")
inline std::string CreateSignalSourceBufferFromFile( const std::string& sFilePath, const std::string& sName = "" )
{
CVAStruct oParams;
oParams["filepath"] = sFilePath;
return CreateSignalSourceBufferFromParameters(oParams, sName);
oParams[ "filepath" ] = sFilePath;
return CreateSignalSourceBufferFromParameters( oParams, sName );
};
//! Creates an audiofile signal source
......@@ -329,20 +329,20 @@ public:
*
* \return Signal source ID
*/
virtual std::string CreateSignalSourceBufferFromSamples(const CVASampleBuffer& oSamples, const std::string& sName = "")
virtual std::string CreateSignalSourceBufferFromSamples( const CVASampleBuffer& oSamples, const std::string& sName = "" )
{
CVAStruct oParams;
oParams["samples"]["ch1"] = oSamples;
return CreateSignalSourceBufferFromParameters(oParams, sName);
oParams[ "samples" ][ "ch1" ] = oSamples;
return CreateSignalSourceBufferFromParameters( oParams, sName );
};
virtual std::string CreateSignalSourceBufferMultichannelFromSamples( const std::vector< CVASampleBuffer >& voSamples, const std::string& sName = "")
virtual std::string CreateSignalSourceBufferMultichannelFromSamples( const std::vector< CVASampleBuffer >& voSamples, const std::string& sName = "" )
{
CVAStruct oParams;
for (size_t i = 0; i < voSamples.size(); i++)
oParams["samples"]["ch" + std::to_string(long(i+1))] = voSamples[i];
return CreateSignalSourceBufferFromParameters(oParams, sName);
for( size_t i = 0; i < voSamples.size(); i++ )
oParams[ "samples" ][ "ch" + std::to_string( long( i + 1 ) ) ] = voSamples[ i ];
return CreateSignalSourceBufferFromParameters( oParams, sName );
};
virtual std::string CreateSignalSourceBufferFromParameters(const CVAStruct& oParams, const std::string& sName = "") = 0;
virtual std::string CreateSignalSourceBufferFromParameters( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
//! Creates a text-to-speech (TTS) signal source
/**
......@@ -390,7 +390,7 @@ public:
/**
* \param sName Name of the machine
*/
virtual std::string CreateSignalSourceMachine(const CVAStruct& oParams, const std::string& sName = "" ) = 0;
virtual std::string CreateSignalSourceMachine( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
//! Deletes a signal source
/**
......@@ -469,24 +469,24 @@ public:
/**
* \param sSignalSourceID Signal source ID
*/
inline void SetSignalSourceMachineStartMachine(const std::string& sSignalSourceID)
inline void SetSignalSourceMachineStartMachine( const std::string& sSignalSourceID )
{
CVAStruct oParams;
oParams["set"] = "action";
oParams["value"] = "start";
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "action";
oParams[ "value" ] = "start";
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Halts the signal of a machine source
/**
* \param sSignalSourceID Signal source ID
*/
inline void SetSignalSourceMachineHaltMachine(const std::string& sSignalSourceID)
inline void SetSignalSourceMachineHaltMachine( const std::string& sSignalSourceID )
{
CVAStruct oParams;
oParams["set"] = "action";
oParams["value"] = "stop";
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "action";
oParams[ "value" ] = "stop";
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Returns the state of a machine signal source
......@@ -494,14 +494,14 @@ public:
* \param sSignalSourceID Signal source ID
* \return Machine state
*/
inline std::string GetSignalSourceMachineStateStr(const std::string& sSignalSourceID) const
inline std::string GetSignalSourceMachineStateStr( const std::string& sSignalSourceID ) const
{
CVAStruct oParams, oRet;
oParams["get"] = "state";
oRet = GetSignalSourceParameters(sSignalSourceID, oParams);
if (oRet.HasKey("state"))
if (oRet["state"].IsString())
return oRet["state"].ToString();
oParams[ "get" ] = "state";
oRet = GetSignalSourceParameters( sSignalSourceID, oParams );
if( oRet.HasKey( "state" ) )
if( oRet[ "state" ].IsString() )
return oRet[ "state" ].ToString();
else
return "error";
else
......@@ -513,12 +513,12 @@ public:
* \param sSignalSourceID Signal source ID
* \param dSpeed Machine speed (0 .. not-too-large)
*/
inline void SetSignalSourceMachineSpeed(const std::string& sSignalSourceID, double dSpeed)
inline void SetSignalSourceMachineSpeed( const std::string& sSignalSourceID, double dSpeed )
{
CVAStruct oParams;
oParams["set"] = "S";
oParams["value"] = dSpeed;
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "S";
oParams[ "value" ] = dSpeed;
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Sets the speed of a machine signal source
......@@ -526,14 +526,14 @@ public:
* \param sSignalSourceID Signal source ID
* \return Machine speed
*/
inline double GetSignalSourceMachineSpeed(const std::string& sSignalSourceID) const
inline double GetSignalSourceMachineSpeed( const std::string& sSignalSourceID ) const
{
CVAStruct oParams, oRet;
oParams["get"] = "speed";
oRet = GetSignalSourceParameters(sSignalSourceID, oParams);
if (oRet.HasKey("speed"))
if (oRet["speed"].IsNumeric())
return double(oRet["speed"]);
oParams[ "get" ] = "speed";
oRet = GetSignalSourceParameters( sSignalSourceID, oParams );
if( oRet.HasKey( "speed" ) )
if( oRet[ "speed" ].IsNumeric() )
return double( oRet[ "speed" ] );
return 1.0f;
};
......@@ -543,12 +543,12 @@ public:
* \param sSignalSourceID Signal source ID
* \param sFilePath Path to audio file
*/
inline void SetSignalSourceMachineStartFile(const std::string& sSignalSourceID, const std::string& sFilePath)
inline void SetSignalSourceMachineStartFile( const std::string& sSignalSourceID, const std::string& sFilePath )
{
CVAStruct oParams;
oParams["set"] = "StartSoundFilePath";
oParams["value"] = sFilePath;
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "StartSoundFilePath";
oParams[ "value" ] = sFilePath;
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Set idle file sample of machine signal source
......@@ -559,9 +559,9 @@ public:
inline void SetSignalSourceMachineIdleFile( const std::string& sSignalSourceID, const std::string& sFilePath )
{
CVAStruct oParams;
oParams["set"] = "IdleSoundFilePath";
oParams["value"] = sFilePath;
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "IdleSoundFilePath";
oParams[ "value" ] = sFilePath;
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Set stop file sample of machine signal source
......@@ -569,12 +569,12 @@ public:
* \param sSignalSourceID Signal source ID
* \param sFilePath Path to audio file
*/
inline void SetSignalSourceMachineStopFile(const std::string& sSignalSourceID, const std::string& sFilePath)
inline void SetSignalSourceMachineStopFile( const std::string& sSignalSourceID, const std::string& sFilePath )
{
CVAStruct oParams;
oParams["set"] = "StopSoundFilePath";
oParams["value"] = sFilePath;
SetSignalSourceParameters(sSignalSourceID, oParams);
oParams[ "set" ] = "StopSoundFilePath";
oParams[ "value" ] = sFilePath;
SetSignalSourceParameters( sSignalSourceID, oParams );
};
//! Adds a sound playback for a sequencer signal source
......@@ -713,7 +713,7 @@ public:
//! Signalquelle einer Schallquelle zurückgeben
virtual std::string GetSoundSourceSignalSource( const int iID ) const = 0;
virtual int GetSoundSourceGeometryMesh( const int iID ) const = 0;
virtual void SetSoundSourceGeometryMesh( const int iSoundReceiverID, const int iGeometryMeshID ) = 0;
......@@ -736,9 +736,9 @@ public:
*
* \param Sound source identifier
*/
inline void RemoveSoundSourceSignalSource(const int iID)
inline void RemoveSoundSourceSignalSource( const int iID )
{
SetSoundSourceSignalSource(iID, "");
SetSoundSourceSignalSource( iID, "" );
};
//! Auralisierungsmodus einer Schallquelle zurückgeben (Bitvektor)
......@@ -881,7 +881,7 @@ public:
* @sa SetListenerEnabled()
*/
virtual bool GetSoundReceiverEnabled( const int iID ) const = 0;
//! Name eines Hörers zurückgeben
virtual std::string GetSoundReceiverName( const int iID ) const = 0;
......@@ -990,6 +990,43 @@ public:
virtual void SetSoundReceiverRealWorldHeadAboveTorsoOrientation( const int iID, const VAQuat& qOrient ) const = 0;
//! Set homogeneous medium sound speed in m/s
virtual void SetHomogeneousMediumSoundSpeed( const double dSoundSpeed ) = 0;
//! Get homogeneous medium sound speed in m/s
virtual double GetHomogeneousMediumSoundSpeed() const = 0;
//! Set homogeneous medium temperature in degree Celsius (0 is freezing point of water)
virtual void SetHomogeneousMediumTemperature( const double dDegreesCentigrade ) = 0;
//! Get homogeneous medium temperature in degree Celsius (0 is freezing point of water)
virtual double GetHomogeneousMediumTemperature() const = 0;
//! Set homogeneous medium static pressure in Pascal
virtual void SetHomogeneousMediumStaticPressure( const double dPressurePascal ) = 0;
//! Get homogeneous medium static pressure in Pascal
virtual double GetHomogeneousMediumStaticPressure() const = 0;
//! Set homogeneous medium relative humidity in percent (0.0 = no vapor, 50.0 = 50%, ... )
virtual void SetHomogeneousMediumRelativeHumidity( const double dRelativeHumidityPercent ) = 0;
//! Get homogeneous medium relative humidity in percent (0.0 = no vapor, 50.0 = 50%, ... )
virtual double GetHomogeneousMediumRelativeHumidity() = 0;
//! Set homogeneous medium shift speed as 3-dim direction vector in m/s
virtual void SetHomogeneousMediumShiftSpeed( const VAVec3& v3TranslationSpeed ) = 0;
//! Get homogeneous medium shift speed as 3-dim direction vector in m/s
virtual VAVec3 GetHomogeneousMediumShiftSpeed() const = 0;
//! Set homogeneous medium special parameters
virtual void SetHomogeneousMediumParameters( const CVAStruct& oParams ) = 0;
//! Get homogeneous medium special parameters
virtual CVAStruct GetHomogeneousMediumParameters() = 0;
//! Loads a scene from a file (e.g. RAVEN project file)
virtual std::string CreateScene( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
......
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