Refactoring, renaming all listeners to receivers

parent 2ee68918
......@@ -212,7 +212,7 @@ protected:
CVACoreImpl* pCore;
const Config oConf;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
CVASharedMotionModel* pMotionModel;
bool bDeleted;
VAVec3 vPredPos; //!< Estimated position
......
......@@ -56,7 +56,7 @@ public:
CVACoreImpl* pCore;
const Config oConf;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
CVASharedMotionModel* pMotionModel;
bool bDeleted;
VAVec3 vPredPos; //!< Estimated position
......
......@@ -106,7 +106,7 @@ protected:
class Listener : public CVAPoolObject
{
public:
CVAListenerDesc* pData; //!< Unversioned data, referenceable
CVASoundReceiverDesc* pData; //!< Unversioned data, referenceable
CVASharedMotionModel* pMotionModel; //!< Motion descriptor
bool bDeleted; //!< Deletion marker
VAVec3 vPredPos; //!< Estimated position
......
......@@ -44,7 +44,7 @@ public:
bool bHasValidTrajectory;
CVAListenerDesc* pData;
CVASoundReceiverDesc* pData;
CVASharedMotionModel* pMotionModel;
IVADirectivity* pDirectivity;
......
......@@ -63,7 +63,7 @@ class CVABFFSoundPathFactory;
* - medium absorption over distance
* - distance gain / 1-by-r law / spherical spreading attenuation
* - two channel binaural receiver directivity (HRTF)
* - Doppler shifts (source and listener movement in medium of finite speed of sound)
* - Doppler shifts (source and receiver movement in medium of finite speed of sound)
*
*/
class CVABinauralFreeFieldAudioRenderer : public IVAAudioRenderer, public ITADatasourceRealization, public CVAObject
......@@ -121,8 +121,8 @@ public:
void SetParameters( const CVAStruct& oParams );
CVAStruct GetParameters( const CVAStruct& );
void onStartDumpListeners( const std::string& sFilenameFormat );
void onStopDumpListeners();
void onStartDumpReceivers( const std::string& sFilenameFormat );
void onStopDumpReceivers();
protected:
......@@ -187,8 +187,8 @@ protected:
};
//! Internal listener representation
class CVABFFListener : public CVAPoolObject
//! Internal receiver representation
class CVABFFReceiver : public CVAPoolObject
{
public:
class Config
......@@ -203,7 +203,7 @@ protected:
int iMotionModelNumHistoryKeys;
};
inline CVABFFListener( CVACoreImpl* pCore, const Config& oConf )
inline CVABFFReceiver( CVACoreImpl* pCore, const Config& oConf )
: pCore( pCore )
, oConf( oConf )
{};
......@@ -211,7 +211,7 @@ protected:
CVACoreImpl* pCore;
const Config oConf;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Receiver description
CVASharedMotionModel* pMotionModel;
bool bDeleted;
VAVec3 vPredPos; //!< Estimated position
......@@ -219,24 +219,24 @@ protected:
VAVec3 vPredUp; //!< Estimated Orientation (Up-Vektor)
bool bValidTrajectoryPresent; //!< Estimation possible -> valid trajectory present
ITASampleFrame* psfOutput; //!< Accumulated listener output signals
ITABufferedAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals
ITASampleFrame* psfOutput; //!< Accumulated receiver output signals
ITABufferedAudiofileWriter* pReceiverOutputAudioFileWriter; //!< File writer used for dumping the receiver signals
inline void PreRequest()
{
pData = nullptr;
CVABasicMotionModel::Config oListenerMotionConfig;
oListenerMotionConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;
oListenerMotionConfig.bLogInputEnabled = oConf.bMotionModelLogInputEnabled;
oListenerMotionConfig.dWindowDelay = oConf.dMotionModelWindowDelay;
oListenerMotionConfig.dWindowSize = oConf.dMotionModelWindowSize;
oListenerMotionConfig.iNumHistoryKeys = oConf.iMotionModelNumHistoryKeys;
pMotionModel = new CVASharedMotionModel( new CVABasicMotionModel( oListenerMotionConfig ), true );
CVABasicMotionModel::Config oReceiverMotionConfig;
oReceiverMotionConfig.bLogEstimatedOutputEnabled = oConf.bMotionModelLogEstimatedEnabled;
oReceiverMotionConfig.bLogInputEnabled = oConf.bMotionModelLogInputEnabled;
oReceiverMotionConfig.dWindowDelay = oConf.dMotionModelWindowDelay;
oReceiverMotionConfig.dWindowSize = oConf.dMotionModelWindowSize;
oReceiverMotionConfig.iNumHistoryKeys = oConf.iMotionModelNumHistoryKeys;
pMotionModel = new CVASharedMotionModel( new CVABasicMotionModel( oReceiverMotionConfig ), true );
bValidTrajectoryPresent = false;
pListenerOutputAudioFileWriter = nullptr;
pReceiverOutputAudioFileWriter = nullptr;
psfOutput = nullptr;
};
......@@ -252,8 +252,8 @@ protected:
inline void InitDump( const std::string& sFilename )
{
std::string sOutput( sFilename );
sOutput = SubstituteMacro( sOutput, "ListenerName", pData->sName );
sOutput = SubstituteMacro( sOutput, "ListenerID", IntToString( pData->iID ) );
sOutput = SubstituteMacro( sOutput, "ReceiverName", pData->sName );
sOutput = SubstituteMacro( sOutput, "ReceiverID", IntToString( pData->iID ) );
ITAAudiofileProperties props;
props.dSampleRate = pCore->GetCoreConfig()->oAudioDriverConfig.dSampleRate;
......@@ -261,14 +261,14 @@ protected:
props.eQuantization = ITAQuantization::ITA_FLOAT;
props.iChannels = 2;
props.iLength = 0;
pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props );
pListenerOutputAudioFileWriter->SetFilePath( sOutput );
pReceiverOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props );
pReceiverOutputAudioFileWriter->SetFilePath( sOutput );
};
inline void FinalizeDump()
{
delete pListenerOutputAudioFileWriter;
pListenerOutputAudioFileWriter = nullptr;
delete pReceiverOutputAudioFileWriter;
pReceiverOutputAudioFileWriter = nullptr;
};
};
......@@ -288,14 +288,14 @@ private:
std::list< CVABFFSoundPath* > m_lSoundPaths; //!< List of sound paths in user context (VACore calls)
IVAObjectPool* m_pSourcePool;
IVAObjectPool* m_pListenerPool;
IVAObjectPool* m_pReceiverPool;
std::map< int, CVABFFSource* > m_mSources; //!< Internal list of sources
std::map< int, CVABFFListener* > m_mListeners; //!< Internal list of listener
std::map< int, CVABFFReceiver* > m_mReceivers; //!< Internal list of receiver
bool m_bDumpListeners;
double m_dDumpListenersGain;
std::atomic< int > m_iDumpListenersFlag;
bool m_bDumpReceivers;
double m_dDumpReceiversGain;
std::atomic< int > m_iDumpReceiversFlag;
int m_iHRIRFilterLength; //!< Length of the HRIR filter DSP module
......@@ -303,7 +303,7 @@ private:
double m_dAdditionalStaticDelaySeconds; //!< Additional delay in seconds for delay compensation
int m_iFilterBankType; //<! IIR or FIR
CVABFFListener::Config m_oDefaultListenerConf; //!< Default listener config for factory object creation
CVABFFReceiver::Config m_oDefaultReceiverConf; //!< Default receiver config for factory object creation
CVABFFSource::Config m_oDefaultSourceConf; //!< Default source config for factory object creation
class CVABFFUpdateMessage : public CVAPoolObject
......@@ -311,8 +311,8 @@ private:
public:
std::list< CVABFFSource* > vNewSources;
std::list< CVABFFSource* > vDelSources;
std::list< CVABFFListener* > vNewListeners;
std::list< CVABFFListener* > vDelListeners;
std::list< CVABFFReceiver* > vNewReceivers;
std::list< CVABFFReceiver* > vDelReceivers;
std::list< CVABFFSoundPath* > vNewPaths;
std::list< CVABFFSoundPath* > vDelPaths;
......@@ -320,8 +320,8 @@ private:
{
vNewSources.clear();
vDelSources.clear();
vNewListeners.clear();
vDelListeners.clear();
vNewReceivers.clear();
vDelReceivers.clear();
vNewPaths.clear();
vDelPaths.clear();
}
......@@ -336,7 +336,7 @@ private:
tbb::concurrent_queue< CVABFFUpdateMessage* > m_qpUpdateMessages; //!< Update messages list
std::list< CVABFFSoundPath* > m_lSoundPaths; //!< List of sound paths
std::list< CVABFFSource* > m_lSources; //!< List of sources
std::list< CVABFFListener* > m_lListeners; //!< List of listeners
std::list< CVABFFReceiver* > m_lReceivers; //!< List of receivers
ITASampleBuffer m_sbTempL; //!< Temporally used buffer to store a block of samples during processing (left ear)
ITASampleBuffer m_sbTempR; //!< Temporally used buffer to store a block of samples during processing (right ear)
std::atomic< int > m_iResetFlag; //!< Reset status flag: 0=normal_op, 1=reset_request, 2=reset_ack
......@@ -347,11 +347,11 @@ private:
void ManageSoundPaths( const CVASceneState* pCurScene, const CVASceneState* pNewScene, const CVASceneStateDiff* pDiff );
void UpdateSources();
CVABFFListener* CreateListener( int iID, const CVAReceiverState* );
void DeleteListener( int iID );
CVABFFReceiver* CreateReceiver( int iID, const CVAReceiverState* );
void DeleteReceiver( int iID );
CVABFFSource* CreateSource( int iID, const CVASoundSourceState* );
void DeleteSource( int iID );
CVABFFSoundPath* CreateSoundPath( CVABFFSource*, CVABFFListener* );
CVABFFSoundPath* CreateSoundPath( CVABFFSource*, CVABFFReceiver* );
void DeleteSoundPath( CVABFFSoundPath* );
void UpdateTrajectories();
......@@ -363,7 +363,7 @@ private:
void ResetInternalData();
friend class CVABFFSoundPath;
friend class CVABFFListenerPoolFactory;
friend class CVABFFReceiverPoolFactory;
friend class CVABFFSourcePoolFactory;
//! Not for use, avoid C4512
......
......@@ -98,7 +98,7 @@ public:
//! Interne Beschreibung eines Hrers
class Listener : public CVAPoolObject {
public:
CVAListenerDesc* pData; // (Unversionierte) Daten der Schallquelle
CVASoundReceiverDesc* pData; // (Unversionierte) Daten der Schallquelle
CVASharedMotionModel* pMotionModel; // Bewegungsbeschreibung der Schallquelle
bool bDeleted; // Marker fr ein gelschtes Objekt (fade out)
VAVec3 vPredPos; // Estimated position
......
......@@ -203,7 +203,7 @@ protected:
CVACoreImpl* pCore;
const Config oConf;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
CVASharedMotionModel* pMotionModel;
bool bDeleted;
VAVec3 vPredPos; //!< Estimated position
......
......@@ -92,7 +92,7 @@ protected:
{
public:
CVACoreImpl* pCore;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
bool bDeleted;
ITASampleFrame* psfOutput;
};
......
......@@ -208,7 +208,7 @@ protected:
CVACoreImpl* m_pCore;
const Config m_oConf;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
CVASharedMotionModel* pMotionModel;
bool bDeleted;
VAVec3 vPredPos; //!< Estimated position
......
......@@ -93,7 +93,7 @@ protected:
{
public:
CVACoreImpl* pCore;
CVAListenerDesc* pData; //!< (Unversioned) Listener description
CVASoundReceiverDesc* pData; //!< (Unversioned) Listener description
bool bDeleted;
ITASampleFrame* psfOutput;
};
......
......@@ -68,7 +68,7 @@ void CVASceneManager::Initialize() {
m_pPoolSourceDesc = IVAObjectPool::Create( 64, 16, new CVAPoolObjectDefaultFactory<CVASoundSourceDesc>, true );
m_pPoolSourceDesc->SetName( "SourceDesc" );
m_pPoolListenerDesc = IVAObjectPool::Create( 64, 16, new CVAPoolObjectDefaultFactory<CVAListenerDesc>, true );
m_pPoolListenerDesc = IVAObjectPool::Create( 64, 16, new CVAPoolObjectDefaultFactory<CVASoundReceiverDesc>, true );
m_pPoolListenerDesc->SetName( "ListenerDesc" );
m_pPoolPortalDesc = IVAObjectPool::Create( 64, 16, new CVAPoolObjectDefaultFactory<CVAPortalDesc>, true );
......@@ -367,7 +367,7 @@ CVASoundSourceDesc* CVASceneManager::GetSoundSourceDesc( int iSoundSourceID ) co
return pDesc;
}
CVAListenerDesc* CVASceneManager::CreateListenerDesc( int iListenerID )
CVASoundReceiverDesc* CVASceneManager::CreateListenerDesc( int iListenerID )
{
m_csDesc.enter();
......@@ -378,10 +378,10 @@ CVAListenerDesc* CVASceneManager::CreateListenerDesc( int iListenerID )
assert( false );
}
CVAListenerDesc* pDesc = dynamic_cast< CVAListenerDesc* >( m_pPoolListenerDesc->RequestObject() );
CVASoundReceiverDesc* pDesc = dynamic_cast< CVASoundReceiverDesc* >( m_pPoolListenerDesc->RequestObject() );
pDesc->iID = iListenerID;
m_mListenerDesc.insert( std::pair<int, CVAListenerDesc*>( iListenerID, pDesc ) );
m_mListenerDesc.insert( std::pair<int, CVASoundReceiverDesc*>( iListenerID, pDesc ) );
m_csDesc.leave();
......@@ -407,7 +407,7 @@ void CVASceneManager::DeleteListenerDesc( int iListenerID )
m_csDesc.leave();
}
CVAListenerDesc* CVASceneManager::GetListenerDesc( int iListenerID ) const
CVASoundReceiverDesc* CVASceneManager::GetListenerDesc( int iListenerID ) const
{
m_csDesc.enter();
......@@ -421,7 +421,7 @@ CVAListenerDesc* CVASceneManager::GetListenerDesc( int iListenerID ) const
VA_EXCEPT2( INVALID_PARAMETER, "Invalid listener ID" );
}
CVAListenerDesc* pDesc = it->second;
CVASoundReceiverDesc* pDesc = it->second;
m_csDesc.leave();
......
......@@ -24,7 +24,7 @@
class CVASceneState;
class CVASoundSourceDesc;
class CVASoundSourceState;
class CVAListenerDesc;
class CVASoundReceiverDesc;
class CVAReceiverState;
class CVAContainerState;
class CVAMotionState;
......@@ -142,9 +142,9 @@ public:
void DeleteSoundSourceDesc( int iSoundSourceID );
CVASoundSourceDesc* GetSoundSourceDesc( int iSoundSourceID ) const;
CVAListenerDesc* CreateListenerDesc( int iListenerID );
CVASoundReceiverDesc* CreateListenerDesc( int iListenerID );
void DeleteListenerDesc( int iListenerID );
CVAListenerDesc* GetListenerDesc( int iListenerID ) const;
CVASoundReceiverDesc* GetListenerDesc( int iListenerID ) const;
CVAPortalDesc* CreatePortalDesc( int iPortalID );
void DeletePortalDesc( int iPortalID );
......@@ -190,7 +190,7 @@ private:
SourceDescMap m_mSourceDesc;
IVAObjectPool* m_pPoolSourceDesc;
typedef std::map<int, CVAListenerDesc*> ListenerDescMap;
typedef std::map<int, CVASoundReceiverDesc*> ListenerDescMap;
ListenerDescMap m_mListenerDesc;
IVAObjectPool* m_pPoolListenerDesc;
......
......@@ -11,15 +11,15 @@
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_VA_LISTENERDESC
#define IW_VA_LISTENERDESC
#ifndef IW_VA_SOUND_RECEIVER_DESC
#define IW_VA_SOUND_RECEIVER_DESC
//! This class describes static (unversioned) sound source information
// @todo jst: renamve to CVASoundReceiverDesc
class CVAListenerDesc : public CVAPoolObject
class CVASoundReceiverDesc : public CVAPoolObject
{
public:
int iID; //!< Sound source identifier
int iID; //!< Sound receiver identifier
std::string sName; //!< Versatile name
std::atomic< bool > bEnabled; //!< Enabled/disabled for rendering
std::string sExplicitRendererID; //!< Explicit renderer identifier, or empty
......@@ -33,4 +33,4 @@ public:
};
};
#endif // IW_VA_LISTENERDESC
#endif // IW_VA_SOUND_RECEIVER_DESC
......@@ -126,7 +126,7 @@ CVASoundReceiverInfo CVACoreImpl::GetSoundReceiverInfo( const int iID ) const
VA_TRY
{
const CVAListenerDesc* oDesc = m_pSceneManager->GetListenerDesc( iID );
const CVASoundReceiverDesc* oDesc = m_pSceneManager->GetListenerDesc( iID );
CVASoundReceiverInfo oInfo;
oInfo.iID = oDesc->iID;
oInfo.sName = oDesc->sName;
......@@ -162,7 +162,7 @@ int CVACoreImpl::CreateSoundReceiverExplicitRenderer( const std::string& sRender
int iListenerID = m_pNewSceneState->AddListener();
assert( iListenerID != -1 );
CVAListenerDesc* pDesc = m_pSceneManager->CreateListenerDesc( iListenerID );
CVASoundReceiverDesc* pDesc = m_pSceneManager->CreateListenerDesc( iListenerID );
pDesc->sExplicitRendererID = sRendererID;
m_pSceneManager->SetListenerName( iListenerID, sName );
......@@ -200,7 +200,7 @@ void CVACoreImpl::SetSoundReceiverEnabled( const int iID, const bool bEnabled )
VA_TRY
{
CVAListenerDesc* pDesc = m_pSceneManager->GetListenerDesc( iID );
CVASoundReceiverDesc* pDesc = m_pSceneManager->GetListenerDesc( iID );
if( pDesc->bEnabled != bEnabled )
{
......@@ -226,7 +226,7 @@ bool CVACoreImpl::GetSoundReceiverEnabled( const int iSoundReceiverID ) const
VA_TRY
{
const CVAListenerDesc* pDesc = m_pSceneManager->GetListenerDesc( iSoundReceiverID );
const CVASoundReceiverDesc* pDesc = m_pSceneManager->GetListenerDesc( iSoundReceiverID );
return pDesc->bEnabled;
}
VA_RETHROW;
......
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