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

Refactoring reproduction

parent 597deb7c
......@@ -17,32 +17,18 @@
@section core_intro_sec Introduction
The Virtual Acoustics project is free, open source real-time auralization framework. It is distributed under the terms of the Apache License Version 2.0.
The official website can be found at http://www.virtualacoustics.org
VACore provides the entire functionality of real-time auralization and reproduction. It includes scene management and a lot of extra functionality to display and export audio.
@section core_license_sec License
Copyright 2015-2017 Institute of Technical Acoustics (ITA), RWTH Aachen University
Licensed under the Apache License, Version 2.0 (the "License");
you may not use the OpenDAFF software package except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@section core_getting_started_sec Getting started
You should also have received a copy of the License with the VA software package.
If you are a C++ developer and you want to integrate VA into your application, the first contact point should be the interface represented by the #IVAInterface class in the VABase project.
If you are planning to create a new binding for any other programming and/or scripting language, also have a look at VANet and the #IVANetClient class.
@section core_getting_started_sec Getting started
@section core_developer_sec Developers
If you are a C++ developer and want to integrate VA into your application, the first contact point should be the VABase interface representad by the #IVAInterface class.
If you are planning to create a binding for any other programming and/or scripting language, also have a look at VANet and the #IVANetClient class.
If you want to
If you want to create your own auralization module, you will have to
- implement a rendering module that is compatible with #IVAAudioRenderer
- implement a reproduction module that is compatible with #IVAAudioReproduction
*/
......
......@@ -25,7 +25,7 @@
#include <xutility>
CVAAmbisonicsReproduction::CVAAmbisonicsReproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVAAmbisonicsReproduction::CVAAmbisonicsReproduction( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
{
CVAConfigInterpreter conf( *(m_oParams.pConfig) );
......
......@@ -16,18 +16,18 @@
#ifdef VACORE_WITH_REPRODUCTION_AMBISONICS
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include "../../VACoreImpl.h"
#include <ITASampleFrame.h>
class ITAStreamPatchbay;
class CVAAmbisonicsReproduction : public IVAAudioReproductionModule
class CVAAmbisonicsReproduction : public IVAAudioReproduction
{
public:
CVAAmbisonicsReproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVAAmbisonicsReproduction( const CVAAudioReproductionInitParams& oParams );
~CVAAmbisonicsReproduction();
void SetInputDatasource( ITADatasource* );
......@@ -39,7 +39,7 @@ public:
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
int m_iAmbisonicsTruncationOrder;
std::vector< const CVAHardwareOutput* > m_vpTargetOutputs;
ITAStreamPatchbay* m_pDecoderMatrixPatchBay;
......
......@@ -54,7 +54,7 @@ public:
void PostIncrementBlockPointer();
};
CVAAmbisonicsBinauralMixdownReproduction::CVAAmbisonicsBinauralMixdownReproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVAAmbisonicsBinauralMixdownReproduction::CVAAmbisonicsBinauralMixdownReproduction( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
, m_pdsStreamFilter( NULL )
, m_iListenerID( -1 )
......
......@@ -16,8 +16,8 @@
#ifdef VACORE_WITH_REPRODUCTION_AMBISONICS_BINAURAL_MIXDOWN
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include "../../VACoreImpl.h"
#include <ITASampleFrame.h>
......@@ -26,10 +26,10 @@ class ITADatasource;
class ITAStreamPatchbay;
class CMixdownStreamFilter;
class CVAAmbisonicsBinauralMixdownReproduction : public IVAAudioReproductionModule
class CVAAmbisonicsBinauralMixdownReproduction : public IVAAudioReproduction
{
public:
CVAAmbisonicsBinauralMixdownReproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVAAmbisonicsBinauralMixdownReproduction( const CVAAudioReproductionInitParams& oParams );
~CVAAmbisonicsBinauralMixdownReproduction();
void SetInputDatasource( ITADatasource* );
......@@ -53,7 +53,7 @@ public:
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
int m_iHRIRFilterLength;
int m_iAmbisonicsTruncationOrder;
......
......@@ -54,7 +54,7 @@ public:
void PostIncrementBlockPointer();
};
CVABinauralMixdownReproduction::CVABinauralMixdownReproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVABinauralMixdownReproduction::CVABinauralMixdownReproduction( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
, m_pdsStreamFilter( NULL )
, m_pVirtualOutput( NULL )
......
......@@ -16,8 +16,8 @@
#ifdef VACORE_WITH_REPRODUCTION_BINAURAL_MIXDOWN
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include "../../VACoreImpl.h"
#include "../../Scene/VAMotionState.h"
......@@ -26,10 +26,10 @@
class ITADatasource;
class StreamFilter;
class CVABinauralMixdownReproduction : public IVAAudioReproductionModule
class CVABinauralMixdownReproduction : public IVAAudioReproduction
{
public:
CVABinauralMixdownReproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVABinauralMixdownReproduction( const CVAAudioReproductionInitParams& oParams );
~CVABinauralMixdownReproduction();
void SetInputDatasource( ITADatasource* );
......@@ -53,7 +53,7 @@ public:
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
int m_iHRIRFilterLength;
......
......@@ -31,7 +31,7 @@
#include <DAFF.h>
#include <cassert>
CVACTC4Reproduction::CVACTC4Reproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVACTC4Reproduction::CVACTC4Reproduction( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
, m_pCTC(NULL)
, m_pHRIR(NULL)
......
......@@ -28,9 +28,10 @@ class CVACoreConfig;
* dynamischer 4-Kanal bersprechkompensation (virtueller Kopfhrer).
*/
class CVACTC4Reproduction : public IVAAudioReproductionModule {
class CVACTC4Reproduction : public IVAAudioReproduction
{
public:
CVACTC4Reproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVACTC4Reproduction( const CVAAudioReproductionInitParams& oParams );
virtual ~CVACTC4Reproduction();
void SetInputDatasource( ITADatasource* );
......@@ -49,7 +50,7 @@ protected:
CVADirectivityDAFFHRIR* m_pHRIR;
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
std::vector< const CVAHardwareOutput* > m_vpTargetOutputs;
int m_iListenerID;
};
......
......@@ -50,7 +50,7 @@ public:
bool ExchangeFilter( const ITASampleFrame& sfHpIRinv );
};
CVAHeadphonesReproduction::CVAHeadphonesReproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVAHeadphonesReproduction::CVAHeadphonesReproduction( const CVAAudioReproductionInitParams& oParams )
: CVAObject( oParams.sClass + ":" + oParams.sID )
, m_oParams( oParams )
, m_pHPEQStreamFilter( NULL )
......
......@@ -16,8 +16,8 @@
#ifdef VACORE_WITH_REPRODUCTION_HEADPHONES
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include "../../Scene/VAMotionState.h"
#include "../../VACoreImpl.h"
#include <VAObject.h>
......@@ -33,10 +33,10 @@ class HPEQStreamFilter;
/**
* This class implements two-channel static equalization for the perpose of individualized headphone playback
*/
class CVAHeadphonesReproduction : public IVAAudioReproductionModule, public CVAObject
class CVAHeadphonesReproduction : public IVAAudioReproduction, public CVAObject
{
public:
CVAHeadphonesReproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVAHeadphonesReproduction( const CVAAudioReproductionInitParams& oParams );
~CVAHeadphonesReproduction();
void SetInputDatasource( ITADatasource* );
......@@ -52,7 +52,7 @@ public:
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
HPEQStreamFilter* m_pHPEQStreamFilter;
ITASampleFrame m_sfHpIRInv;
};
......
......@@ -36,7 +36,7 @@
#include <VistaBase/VistaVector3D.h>
CVANCTCReproduction::CVANCTCReproduction( const CVAAudioReproductionModuleInitParams& oParams )
CVANCTCReproduction::CVANCTCReproduction( const CVAAudioReproductionInitParams& oParams )
: CVAObject( oParams.sClass + ":" + oParams.sID )
, m_oParams( oParams )
, m_pdsStreamFilter( NULL )
......
......@@ -16,8 +16,8 @@
#ifdef VACORE_WITH_REPRODUCTION_BINAURAL_NCTC
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include "../../Scene/VAMotionState.h"
#include "../../VACoreImpl.h"
#include <VAObject.h>
......@@ -27,10 +27,10 @@ class ITANCTCStreamFilter;
class ITAHDFTSpectra;
class CVADirectivityDAFFHRIR;
class CVANCTCReproduction : public IVAAudioReproductionModule, public CVAObject
class CVANCTCReproduction : public IVAAudioReproduction, public CVAObject
{
public:
CVANCTCReproduction( const CVAAudioReproductionModuleInitParams& oParams );
CVANCTCReproduction( const CVAAudioReproductionInitParams& oParams );
~CVANCTCReproduction();
void SetInputDatasource( ITADatasource* );
......@@ -58,7 +58,7 @@ public:
private:
std::string m_sName;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
std::vector< const CVAHardwareOutput* > m_vpTargetOutputs;
......
......@@ -22,7 +22,7 @@
#include <ITAFastMath.h>
#include <ITAStringUtils.h>
CVAReproductionLowFrequencyMixer::CVAReproductionLowFrequencyMixer( const CVAAudioReproductionModuleInitParams& oParams )
CVAReproductionLowFrequencyMixer::CVAReproductionLowFrequencyMixer( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
, m_pdsInputDataSource( NULL )
, m_pdsOutputDataSource( NULL )
......
......@@ -17,17 +17,17 @@
#ifdef VACORE_WITH_REPRODUCTION_MIXER_LOW_FREQUENCY
#include "../../VACoreConfig.h"
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include <ITADataSourceRealization.h>
#include <vector>
class CVAReproductionLowFrequencyMixer : public IVAAudioReproductionModule, public ITADatasourceRealizationEventHandler
class CVAReproductionLowFrequencyMixer : public IVAAudioReproduction, public ITADatasourceRealizationEventHandler
{
public:
CVAReproductionLowFrequencyMixer( const CVAAudioReproductionModuleInitParams& oParams );
CVAReproductionLowFrequencyMixer( const CVAAudioReproductionInitParams& oParams );
~CVAReproductionLowFrequencyMixer();
void SetInputDatasource( ITADatasource* pDatasource);
ITADatasource* GetOutputDatasource();
......@@ -39,7 +39,7 @@ public:
private:
ITADatasource* m_pdsInputDataSource;
ITADatasourceRealization* m_pdsOutputDataSource;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
std::vector< int > m_viMixingChannels; // Logical mixing channel numbers, so first channel = 1 and so on
};
......
......@@ -18,7 +18,7 @@
#include "../../VACoreImpl.h"
#include <ITAFastMath.h>
CVAReproductionTalkthrough::CVAReproductionTalkthrough( const CVAAudioReproductionModuleInitParams& oParams )
CVAReproductionTalkthrough::CVAReproductionTalkthrough( const CVAAudioReproductionInitParams& oParams )
: m_oParams( oParams )
, m_pdsInputDatasource( NULL )
, m_pdsOutputDatasource( NULL )
......
......@@ -17,15 +17,15 @@
#ifdef VACORE_WITH_REPRODUCTION_TALKTHROUGH
#include "../../VACoreConfig.h"
#include "../VAAudioReproductionModule.h"
#include "../VAAudioReproductionModuleRegistry.h"
#include "../VAAudioReproduction.h"
#include "../VAAudioReproductionRegistry.h"
#include <ITADataSourceRealization.h>
class CVAReproductionTalkthrough : public IVAAudioReproductionModule, public ITADatasourceRealizationEventHandler
class CVAReproductionTalkthrough : public IVAAudioReproduction, public ITADatasourceRealizationEventHandler
{
public:
CVAReproductionTalkthrough( const CVAAudioReproductionModuleInitParams& oParams );
CVAReproductionTalkthrough( const CVAAudioReproductionInitParams& oParams );
~CVAReproductionTalkthrough();
void SetInputDatasource( ITADatasource* pDatasource);
ITADatasource* GetOutputDatasource();
......@@ -37,7 +37,7 @@ public:
private:
ITADatasource* m_pdsInputDatasource;
ITADatasourceRealization* m_pdsOutputDatasource;
CVAAudioReproductionModuleInitParams m_oParams;
CVAAudioReproductionInitParams m_oParams;
};
#endif // VACORE_WITH_REPRODUCTION_TALKTHROUGH
......
......@@ -24,7 +24,7 @@ class CVASceneState;
class CVAStruct;
class ITADatasource;
class CVAAudioReproductionModuleInitParams
class CVAAudioReproductionInitParams
{
public:
std::string sID; //!< ID (right-hand side of declaration CLASS:ID)
......@@ -56,10 +56,10 @@ public:
* if the user moves in real world coordinates (in the lab).
*
*/
class IVAAudioReproductionModule
class IVAAudioReproduction
{
public:
virtual ~IVAAudioReproductionModule() {};
virtual ~IVAAudioReproduction() {};
virtual void SetInputDatasource( ITADatasource* pdsInput )=0;
virtual ITADatasource* GetOutputDatasource()=0;
......@@ -72,7 +72,7 @@ public:
virtual inline CVAStruct GetParameters( const CVAStruct& ) const { return CVAStruct(); };
protected:
IVAAudioReproductionModule() {};
IVAAudioReproduction() {};
};
#endif // IW_VACORE_REPRODUCTIONMODULE
#endif // IW_VACORE_AUDIO_REPRODUCTION
......@@ -11,7 +11,7 @@
* --------------------------------------------------------------------------------------------
*/
#include "VAAudioReproductionModuleRegistry.h"
#include "VAAudioReproductionRegistry.h"
#include "Ambisonics/VAAmbisonicsReproduction.h"
#include "Binaural/VAAmbisonicsBinauralMixdownReproduction.h"
......@@ -25,21 +25,21 @@
#include <ITAStringUtils.h>
static CVAAudioReproductionModuleRegistry* g_pReproductionRegistryInstance;
static CVAAudioReproductionRegistry* g_pReproductionRegistryInstance;
CVAAudioReproductionModuleRegistry* CVAAudioReproductionModuleRegistry::GetInstance()
CVAAudioReproductionRegistry* CVAAudioReproductionRegistry::GetInstance()
{
if( !g_pReproductionRegistryInstance )
g_pReproductionRegistryInstance = new CVAAudioReproductionModuleRegistry();
g_pReproductionRegistryInstance = new CVAAudioReproductionRegistry();
return g_pReproductionRegistryInstance;
}
CVAAudioReproductionModuleRegistry::CVAAudioReproductionModuleRegistry()
CVAAudioReproductionRegistry::CVAAudioReproductionRegistry()
: m_bInternalCoreFactoriesRegistered( false )
{
}
void CVAAudioReproductionModuleRegistry::RegisterFactory( IVAAudioReproductionModuleFactory* pFactory )
void CVAAudioReproductionRegistry::RegisterFactory( IVAAudioReproductionFactory* pFactory )
{
assert( pFactory );
m_pFactories.push_back( pFactory );
......@@ -47,10 +47,10 @@ void CVAAudioReproductionModuleRegistry::RegisterFactory( IVAAudioReproductionMo
VA_TRACE( "AudioReproductionModuleRegistry", "Registering reproduction factory '" + pFactory->GetClassIdentifier() + "'" );
}
IVAAudioReproductionModuleFactory* CVAAudioReproductionModuleRegistry::FindFactory( const std::string& sClassName )
IVAAudioReproductionFactory* CVAAudioReproductionRegistry::FindFactory( const std::string& sClassName )
{
std::string s = toUppercase( sClassName );
for( std::vector<IVAAudioReproductionModuleFactory*>::iterator it = m_pFactories.begin(); it != m_pFactories.end(); ++it )
for( std::vector<IVAAudioReproductionFactory*>::iterator it = m_pFactories.begin(); it != m_pFactories.end(); ++it )
{
if( toUppercase( ( *it )->GetClassIdentifier() ) == s )
return *it;
......@@ -58,7 +58,7 @@ IVAAudioReproductionModuleFactory* CVAAudioReproductionModuleRegistry::FindFacto
return nullptr;
}
void CVAAudioReproductionModuleRegistry::RegisterInternalCoreFactoryMethods()
void CVAAudioReproductionRegistry::RegisterInternalCoreFactoryMethods()
{
// A little protection against double factory creation
if( m_bInternalCoreFactoriesRegistered )
......
......@@ -14,27 +14,27 @@
#ifndef IW_VACORE_AUDIOREPRODUCTIONMODULEREGISTRY
#define IW_VACORE_AUDIOREPRODUCTIONMODULEREGISTRY
#include "VAAudioReproductionModule.h"
#include "VAAudioReproduction.h"
#include <cassert>
#include <vector>
#include <VAStruct.h>
class CVACoreImpl;
class IVAAudioReproductionModule;
class IVAAudioReproductionModuleFactory;
class IVAAudioReproduction;
class IVAAudioReproductionFactory;
//! Factory method interface
class IVAAudioReproductionModuleFactory
class IVAAudioReproductionFactory
{
public:
virtual std::string GetClassIdentifier() const = 0;
virtual IVAAudioReproductionModule* Create( const CVAAudioReproductionModuleInitParams& oParams ) = 0;
virtual IVAAudioReproduction* Create( const CVAAudioReproductionInitParams& oParams ) = 0;
};
//! Default factory (template)
template < class TReproduction >
class CVAAudioReproductionModuleDefaultFactory : public IVAAudioReproductionModuleFactory
class CVAAudioReproductionModuleDefaultFactory : public IVAAudioReproductionFactory
{
public:
inline CVAAudioReproductionModuleDefaultFactory( const std::string& sClassIdentifier )
......@@ -47,7 +47,7 @@ public:
return this->m_sClassIdentifier;
};
inline IVAAudioReproductionModule* Create( const CVAAudioReproductionModuleInitParams& oParams )
inline IVAAudioReproduction* Create( const CVAAudioReproductionInitParams& oParams )
{
return new TReproduction( oParams );
};
......@@ -57,13 +57,13 @@ private:
};
//! Module registry (singleton)
class CVAAudioReproductionModuleRegistry
class CVAAudioReproductionRegistry
{
public:
static CVAAudioReproductionModuleRegistry* GetInstance();
static CVAAudioReproductionRegistry* GetInstance();
CVAAudioReproductionModuleRegistry();
inline virtual ~CVAAudioReproductionModuleRegistry() {};
CVAAudioReproductionRegistry();
inline virtual ~CVAAudioReproductionRegistry() {};
template< typename TReproduction >
inline void RegisterReproductionDefaultFactory( const std::string& sClassIdentifier )
......@@ -71,8 +71,8 @@ public:
this->RegisterFactory( new CVAAudioReproductionModuleDefaultFactory< TReproduction >( sClassIdentifier ) );
};
void RegisterFactory( IVAAudioReproductionModuleFactory* pFactory );
IVAAudioReproductionModuleFactory* FindFactory( const std::string& sClassIdentifier );
void RegisterFactory( IVAAudioReproductionFactory* pFactory );
IVAAudioReproductionFactory* FindFactory( const std::string& sClassIdentifier );
protected:
//! Registers core-internal audio reproduction factories (only call once)
......@@ -85,7 +85,7 @@ protected:
friend class CVACoreImpl;
private:
std::vector< IVAAudioReproductionModuleFactory* > m_pFactories;
std::vector< IVAAudioReproductionFactory* > m_pFactories;
bool m_bInternalCoreFactoriesRegistered;
};
......
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