Applying ITABase namespaces

parent 84382c02
......@@ -35,7 +35,7 @@ const float DEF_CENTER_FREQUENCY_THIRDS[ 31 ] =
1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000, 20000
};
void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dPressure, double dHumidity )
void GetAirAbsorptionMagnitudes( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dPressure, double dHumidity )
{
// ISO 9613-1 Acoustics - Attenuation of sound during propagation outdoors
......@@ -108,7 +108,7 @@ void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags,
}
void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity )
void CalculateAirAbsorptionAttenuation( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity )
{
std::vector< float > vfGains( oAirAbsMags.GetNumBands() );
GetAirAbsorptionMagnitudesThirdOctave( &vfGains[ 0 ], dDistance, dTemperature, dStaticPressure, dHumidity );
......
......@@ -43,7 +43,7 @@ void GetAirAbsorptionAttenuationThirdOctaveDecibel( float* pfAirAbsCoeffs, // A
* \param fStaticPressure Statischer Luftdruck [Pa]
* \param fHumidity Luftfeuchtigkeit [%]
*/
void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
void CalculateAirAbsorptionAttenuation( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oAirAbsMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
//! Berechnung der Luftschall-Dmpfung in Terzen als Faktoren (von Jonas implementiert)
/**
......@@ -57,6 +57,6 @@ void CalculateAirAbsorptionAttenuation( CITAThirdOctaveFactorMagnitudeSpectrum&
* \param fStaticPressure Statischer Luftdruck [Pa]
* \param fHumidity Luftfeuchtigkeit [%]
*/
void GetAirAbsorptionMagnitudes( CITAThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
void GetAirAbsorptionMagnitudes( ITABase::CThirdOctaveFactorMagnitudeSpectrum& oMags, double dDistance, double dTemperature, double dStaticPressure, double dHumidity );
#endif // IW_VACORE_ATMOSPHERE
......@@ -989,26 +989,31 @@ const float VA_TEMPORALNOISE_DATA[ VA_TEMPORALNOISE_NUM_BANDS ][ VA_TEMPORALNOIS
0.3668F, 0.2105F, 0.0884F, -0.0217F, -0.1162F, -0.2177F, -0.3251F, -0.3734F, -0.3437F, -0.2901F }
};
class CVAAtmosphericTemporalVariantions {
class CVAAtmosphericTemporalVariantions
{
public:
CVAAtmosphericTemporalVariantions() {
inline CVAAtmosphericTemporalVariantions()
{
m_fOffsetDecibel = 4.0;
m_fStrengthDecibel = 3.0;
m_iCursor = 0;
}
};
double getSamplerate() const { return VA_TEMPORALNOISE_SAMPLINGRATE; }
inline double getSamplerate() const
{
return VA_TEMPORALNOISE_SAMPLINGRATE;
};
inline void getNoiseMagnitudes( CITAThirdOctaveMagnitudeSpectrum& oDest )
inline void getNoiseMagnitudes( ITABase::CThirdOctaveMagnitudeSpectrum& oDest )
{
assert( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() == VA_TEMPORALNOISE_NUM_BANDS );
assert( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() == VA_TEMPORALNOISE_NUM_BANDS );
for( int i = 0; i < VA_TEMPORALNOISE_NUM_BANDS; i++ ) {
oDest[ i ] = ( float ) db10_to_ratio( m_fStrengthDecibel*VA_TEMPORALNOISE_DATA[ i ][ m_iCursor ] );
}
m_iCursor = ( ++m_iCursor ) % VA_TEMPORALNOISE_NUM_SAMPLES;
}
};
private:
float m_fOffsetDecibel;
......
......@@ -1155,9 +1155,9 @@ void CVAAFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......
......@@ -135,17 +135,17 @@ public:
CSoundSourceDirectivityState oDirectivityStateCur; //!< Aktueller Status der Richtcharakteristik
CSoundSourceDirectivityState oDirectivityStateNew; //!< Neuer Status der Richtcharakteristik
CITAThirdOctaveGainMagnitudeSpectrum oSoundSourceDirectivityMagnitudes; //!< Magnitudes for directivity
ITABase::CThirdOctaveGainMagnitudeSpectrum oSoundSourceDirectivityMagnitudes; //!< Magnitudes for directivity
CVAAtmosphericTemporalVariantions oATVGenerator; //!< Generator for temporal variation magnitudes of the time signal by medium shifts during propagation
CITAThirdOctaveGainMagnitudeSpectrum oTemporalVariationMagnitudes; //!< Magnitudes for temporal variation of the time signal by medium shifts during propagation
ITABase::CThirdOctaveGainMagnitudeSpectrum oTemporalVariationMagnitudes; //!< Magnitudes for temporal variation of the time signal by medium shifts during propagation
CITAThirdOctaveGainMagnitudeSpectrum oAirAttenuationMagnitudes; //!< Magnitudes for air attenuation (damping)
ITABase::CThirdOctaveGainMagnitudeSpectrum oAirAttenuationMagnitudes; //!< Magnitudes for air attenuation (damping)
CITAThirdOctaveGainMagnitudeSpectrum oGroundReflectionMagnitudes; //!< Ground reflection parameters (only for reflection paths)
ITABase::CThirdOctaveGainMagnitudeSpectrum oGroundReflectionMagnitudes; //!< Ground reflection parameters (only for reflection paths)
CITAThirdOctaveFilterbank* pThirdOctaveFilterBank; //!< DSP-Element zur Filterung von Third-Octave Datenstzen der Richtcharakteristik
CITAThirdOctaveGainMagnitudeSpectrum oThirdOctaveFilterMagnitudes; //!< DSP magnitudes (third octave band resolution)
ITABase::CThirdOctaveGainMagnitudeSpectrum oThirdOctaveFilterMagnitudes; //!< DSP magnitudes (third octave band resolution)
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateCur; //!< Aktueller Status der HRIR
CSoundReceiverDirectivityState oSoundReceiverDirectivityStateNew; //!< Neuer Status der HRIR
......@@ -1344,10 +1344,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord );
if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord )
{
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains );
oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......@@ -1379,10 +1379,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord );
if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord )
{
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains );
oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......@@ -1603,7 +1603,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "directivity_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -1615,7 +1615,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "air_attenuation_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -1627,7 +1627,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "temporal_variation_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -1639,7 +1639,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "ground_reflection_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......
......@@ -1225,9 +1225,9 @@ void CVABFFSoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->GetDAFFContent()->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->GetDAFFContent()->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......
......@@ -161,7 +161,7 @@ protected:
pData = nullptr;
CVABasicMotionModel::Config oDefaultConfig;
oDefaultConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;;
oDefaultConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;
oDefaultConfig.bLogInputEnabled = oConf.bMotionModelLogInputEnabled;
oDefaultConfig.dWindowDelay = oConf.dMotionModelWindowDelay;
oDefaultConfig.dWindowSize = oConf.dMotionModelWindowSize;
......
......@@ -577,10 +577,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oDirSoundPath.oRelations.dAzimuthS2L ), float( oDirSoundPath.oRelations.dElevationS2L ), oDirSoundPath.oDirectivityStateNew.iRecord );
if( oDirSoundPath.oDirectivityStateCur.iRecord != oDirSoundPath.oDirectivityStateNew.iRecord )
{
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains );
oDirSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......@@ -612,10 +612,10 @@ void CVABATNSoundPath::UpdateSoundSourceDirectivity()
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRefSoundPath.oRelations.dAzimuthS2L ), float( oRefSoundPath.oRelations.dElevationS2L ), oRefSoundPath.oDirectivityStateNew.iRecord );
if( oRefSoundPath.oDirectivityStateCur.iRecord != oRefSoundPath.oDirectivityStateNew.iRecord )
{
std::vector< float > vfGains( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfGains( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oRefSoundPath.oDirectivityStateNew.iRecord, 0, &vfGains[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfGains );
oRefSoundPath.pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......@@ -836,7 +836,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "directivity_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "directivity_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oSoundSourceDirectivityMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -848,7 +848,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "air_attenuation_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "air_attenuation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oAirAttenuationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -860,7 +860,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "temporal_variation_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "temporal_variation_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oTemporalVariationMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......@@ -872,7 +872,7 @@ void ExternalSimulationUpdate( CVABATNSoundPath::PropPath& oPathProperties, cons
if( oUpdate.HasKey( "ground_reflection_third_octaves" ) )
{
const CVAStruct& oFilterUpdate( oUpdate[ "ground_reflection_third_octaves" ] );
CITAThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
ITABase::CThirdOctaveGainMagnitudeSpectrum& oMagnitudeSpectrum( oPathProperties.oGroundReflectionMagnitudes );
for( int i = 0; i < oMagnitudeSpectrum.GetNumBands(); i++ )
{
std::string sBandValueKey = "band_" + std::to_string( long( i + 1 ) );
......
......@@ -475,9 +475,9 @@ public:
HRIRState oHRIRStateCur; //!< Aktueller Status der HRIR
HRIRState oHRIRStateNew; //!< Neuer Status der HRIR
CITAThirdOctaveGainMagnitudeSpectrum oMagsSumCur; //!< Aktuelle Zusammensetzung des zusammengesetzten TO-Datensatzes (DIR, AA)
CITAThirdOctaveGainMagnitudeSpectrum oAirAbsMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
CITAThirdOctaveGainMagnitudeSpectrum oDirMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
ITABase::CThirdOctaveGainMagnitudeSpectrum oMagsSumCur; //!< Aktuelle Zusammensetzung des zusammengesetzten TO-Datensatzes (DIR, AA)
ITABase::CThirdOctaveGainMagnitudeSpectrum oAirAbsMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirMags; //!< Aktualle Zusammensetzung des TO-Datensatzes fr Luftschallabsorption
unsigned long int uiID; //!< Unique Identifier fr diesen Task
......@@ -658,7 +658,7 @@ void ComplexSoundPath::UpdateDirectSound( const bool bDirectSoundAudible )
// Neue Luftschallabsorption Mags holen (oAirAbsMags)
UpdateAirAbsorption();
CITAThirdOctaveGainMagnitudeSpectrum oMagsSumNew;
ITABase::CThirdOctaveGainMagnitudeSpectrum oMagsSumNew;
oMagsSumNew.SetIdentity();
if( iPathAuralizationMode & IVAInterface::VA_AURAMODE_SOURCE_DIRECTIVITY )
......@@ -2253,7 +2253,7 @@ int CVARoomAcousticsAudioRenderer::PostTaskDiscarded( IRavenSimulationSchedulerI
}
}
void CVARoomAcousticsAudioRenderer::GenerateIRFromTOMags( const CITAThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter )
void CVARoomAcousticsAudioRenderer::GenerateIRFromTOMags( const ITABase::CThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter )
{
float* pfData = sbFilter.data();
m_csFilterGenerator.enter();
......
......@@ -165,7 +165,7 @@ public:
* Die lnge der Impulsantwort entspricht der Lnge des ITASampleFrame.
* \note Reentrant (blocking wait)
*/
void GenerateIRFromTOMags( const CITAThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter );
void GenerateIRFromTOMags( const ITABase::CThirdOctaveGainMagnitudeSpectrum& oMags, ITASampleBuffer& sbFilter );
//! Gibt die Schallmediumsgeschwindigkeit zurck [m/s]
float GetSpeedOfSound() const;
......
......@@ -1207,7 +1207,7 @@ void CVAPFFSoundPath::UpdateSoundSourceDirectivity( const bool bDIRAuraModeEnabl
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
std::vector< float > vfMags( oDirectivityMagnitudes.GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
oDirectivityMagnitudes.SetMagnitudes( vfMags );
......
......@@ -1298,10 +1298,10 @@ void CVAPTHASoundPath::UpdateDir( bool bDIRAuraModeEnabled )
pDirectivityDataNew->getNearestNeighbour( DAFF_OBJECT_VIEW, float( oRelations.dAzimuthS2L ), float( oRelations.dElevationS2L ), oDirectivityStateNew.iRecord );
if( oDirectivityStateCur.iRecord != oDirectivityStateNew.iRecord )
{
std::vector< float > vfMags( CITAThirdOctaveMagnitudeSpectrum::GetNumBands() );
std::vector< float > vfMags( ITABase::CThirdOctaveMagnitudeSpectrum::GetNumBands() );
pDirectivityDataNew->getMagnitudes( oDirectivityStateNew.iRecord, 0, &vfMags[ 0 ] );
CITAThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
ITABase::CThirdOctaveGainMagnitudeSpectrum oDirectivityMagnitudes;
oDirectivityMagnitudes.SetMagnitudes( vfMags );
pThirdOctaveFilterBank->SetMagnitudes( oDirectivityMagnitudes );
}
......
......@@ -121,43 +121,15 @@ CVAObjectInfo CVAHeadphonesReproduction::GetObjectInfo() const
CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
{
CVAStruct oReturn;
SetParameters( oArgs );
return GetParameters( oArgs );
}
void CVAHeadphonesReproduction::SetParameters( const CVAStruct& oArgs )
{
const CVAStructValue* pStruct;
// Commands: print, get, set
if( ( pStruct = oArgs.GetValue( "PRINT" ) ) != nullptr )
{
VA_PRINT( "Available commands for " +CVAObject::GetObjectName()+ ": print, set, get" );
VA_PRINT( "PRINT:" );
VA_PRINT( "\t'print', 'help'" );
VA_PRINT( "GET:" );
VA_PRINT( "\t'get', 'gain'" );
VA_PRINT( "SET:" );
VA_PRINT( "\t'set', 'gain', 'value', <number>" );
VA_PRINT( "\t'set', 'hpirinv', 'value', <path> (use something like '$(VADataDir)/path/to/ir.wav' )" );
oReturn["Return"] = true; // dummy return value, otherwise Problem with MATLAB
return oReturn;
}
else if( ( pStruct = oArgs.GetValue( "GET" ) ) != nullptr )
{
if( pStruct->GetDatatype() != CVAStructValue::STRING )
VA_EXCEPT2( INVALID_PARAMETER, "GET command must be a string" );
std::string sGetCommand = toUppercase( *pStruct );
if( sGetCommand == "GAIN" )
{
oReturn["RETURN"] = m_pHPEQStreamFilter->fGain;
return oReturn;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Unrecognized GET command " + sGetCommand );
}
}
else if( ( pStruct = oArgs.GetValue( "HpIRInvFile" ) ) != nullptr )
if( ( pStruct = oArgs.GetValue( "HpIRInvFile" ) ) != nullptr )
{
if( pStruct->GetDatatype() != CVAStructValue::STRING )
VA_EXCEPT2( INVALID_PARAMETER, "File path value must be a string" );
......@@ -170,7 +142,7 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
VA_EXCEPT2( INVALID_PARAMETER, "Path to inverse impulse response file must be a string" );
std::string sFilePathRaw = std::string( *pHpIRinvPathValue );
std::string sFilePath = m_oParams.pCore->GetCoreConfig()->mMacros.SubstituteMacros( sFilePathRaw );
std::string sFilePath = m_oParams.pCore->FindFilePath( sFilePathRaw );
if( !doesPathExist( sFilePath ) )
VA_ERROR( GetObjectName(), "Path '" << sFilePath << "' does not exist" );
......@@ -207,10 +179,6 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
double dGain = double( *pGainValue );
m_pHPEQStreamFilter->fGain = float( dGain );
oReturn[ "HPIRInvCalibrationGain" ] = dGain;
oReturn[ "HPIRInvCalibrationGainDecibel" ] = ratio_to_db20( dGain );
return oReturn;
}
}
......@@ -224,29 +192,60 @@ CVAStruct CVAHeadphonesReproduction::CallObject( const CVAStruct& oArgs )
double dGainDecibel = double( *pGainValue );
m_pHPEQStreamFilter->fGain = float( db20_to_ratio( dGainDecibel ) );
oReturn[ "HPIRInvCalibrationGain" ] = db20_to_ratio( dGainDecibel );
oReturn[ "HPIRInvCalibrationGainDecibel" ] = dGainDecibel;
return oReturn;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Gain value missing" );
}
}
oReturn["hpirinv"] = "updated"; // dummy return value, otherwise Problem with MATLAB
return oReturn;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Unrecognized SET value, use 'print' 'help' for further information" );
}
}
else
}
CVAStruct CVAHeadphonesReproduction::GetParameters( const CVAStruct& oArgs ) const
{
CVAStruct oReturn;
const CVAStructValue* pStruct;
if( ( pStruct = oArgs.GetValue( "PRINT" ) ) != nullptr )
{
VA_PRINT( "Available commands for " + CVAObject::GetObjectName() + ": print, set, get" );
VA_PRINT( "PRINT:" );
VA_PRINT( "\t'print', 'help'" );
VA_PRINT( "GET:" );
VA_PRINT( "\t'get', 'gain'" );
VA_PRINT( "SET:" );
VA_PRINT( "\t'set', 'gain', 'value', <number>" );
VA_PRINT( "\t'set', 'hpirinv', 'value', <path> (use something like '$(VADataDir)/path/to/ir.wav' )" );
oReturn[ "Return" ] = true; // dummy return value, otherwise Problem with MATLAB
return oReturn;
}
if( ( pStruct = oArgs.GetValue( "GET" ) ) != nullptr )
{
VA_EXCEPT2( INVALID_PARAMETER, "Unrecognized command called, use 'PRINT' 'HELP' for more information" );
if( pStruct->GetDatatype() != CVAStructValue::STRING )
VA_EXCEPT2( INVALID_PARAMETER, "GET command must be a string" );
std::string sGetCommand = toUppercase( *pStruct );
if( sGetCommand == "GAIN" )
{
oReturn[ "RETURN" ] = m_pHPEQStreamFilter->fGain;
return oReturn;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Unrecognized GET command " + sGetCommand );
}
}
return oReturn;
}
void CVAHeadphonesReproduction::SetInputDatasource( ITADatasource* p )
......
......@@ -49,6 +49,9 @@ public:
CVAObjectInfo GetObjectInfo() const;
CVAStruct CallObject( const CVAStruct& oArgs );
void SetParameters( const CVAStruct& );
CVAStruct GetParameters( const CVAStruct& ) const;
private:
std::string m_sName;
......
......@@ -106,7 +106,7 @@ CVANCTCReproduction::CVANCTCReproduction( const CVAAudioReproductionInitParams&
}
}
m_vpSpectra.push_back( new ITAHDFTSpectra( oNCTCConf.fSampleRate, 2, oNCTCConf.iCTCFilterLength + 1, true ) );
m_vpSpectra.push_back( new ITABase::CHDFTSpectra( oNCTCConf.fSampleRate, 2, oNCTCConf.iCTCFilterLength + 1, true ) );
}
#ifdef VACORE_REPRODUCTION_NCTC_WITH_SWEET_SPOT_WIDENING
......@@ -301,7 +301,7 @@ CVAStruct CVANCTCReproduction::CallObject( const CVAStruct& oArgs )
if( sExportFileBaseName.empty() )
sExportFileBaseName = "VANCTC_HRIR_";
std::vector< ITAHDFTSpectra* > vpHRTFs;
std::vector< ITABase::CHDFTSpectra* > vpHRTFs;
if( m_pNCTC->GetHRTF( vpHRTFs ) )
for( size_t n = 0; n < vpHRTFs.size(); n++ )
ITAFFTUtils::Export( vpHRTFs[ n ], sExportFileBaseName + IntToString( int( n + 1 ) ) );
......
......@@ -22,9 +22,10 @@
#include "../../VACoreImpl.h"
#include <VAObject.h>
#include <ITAHDFTSpectra.h>
class ITANCTC;
class ITANCTCStreamFilter;
class ITAHDFTSpectra;
class CVADirectivityDAFFHRIR;
class CVANCTCReproduction : public IVAAudioReproduction, public CVAObject
......@@ -68,7 +69,7 @@ private:
ITANCTC* m_pNCTC;
ITANCTCStreamFilter* m_pdsStreamFilter;
std::vector< ITAHDFTSpectra* > m_vpSpectra;
std::vector< ITABase::CHDFTSpectra* > m_vpSpectra;
double m_dGain;
mutable int m_iDebugExportCTCFilters; //! Exports given number of filters during streaming
......
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