WIP

parent 2fb55828
...@@ -1094,8 +1094,6 @@ void CVABinauralFreeFieldAudioRenderer::ResetInternalData() ...@@ -1094,8 +1094,6 @@ void CVABinauralFreeFieldAudioRenderer::ResetInternalData()
void CVABinauralFreeFieldAudioRenderer::UpdateSoundPaths() void CVABinauralFreeFieldAudioRenderer::UpdateSoundPaths()
{ {
const int iGlobalAuralisationMode = m_iCurGlobalAuralizationMode;
// Check for new data // Check for new data
std::list< CVABFFSoundPath* >::iterator it = m_lSoundPaths.begin(); std::list< CVABFFSoundPath* >::iterator it = m_lSoundPaths.begin();
while( it != m_lSoundPaths.end() ) while( it != m_lSoundPaths.end() )
...@@ -1483,7 +1481,7 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs ...@@ -1483,7 +1481,7 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs
CVAConfigInterpreter oConfig( oArgs ); CVAConfigInterpreter oConfig( oArgs );
std::string sCommandOrg; std::string sCommandOrg;
oConfig.ReqNonEmptyString( "Command", sCommandOrg ); oConfig.OptString( "Command", sCommandOrg );
std::string sCommand = toUppercase( sCommandOrg ); std::string sCommand = toUppercase( sCommandOrg );
// Command resolution // Command resolution
...@@ -1502,7 +1500,7 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs ...@@ -1502,7 +1500,7 @@ CVAStruct CVABinauralFreeFieldAudioRenderer::CallObject( const CVAStruct& oArgs
return oReturn; return oReturn;
} }
VA_EXCEPT2( INVALID_PARAMETER, "Invalid command (\"" + sCommandOrg + "\")" ); return oReturn;
} }
void CVABinauralFreeFieldAudioRenderer::SetParameters( const CVAStruct& oParams ) void CVABinauralFreeFieldAudioRenderer::SetParameters( const CVAStruct& oParams )
......
...@@ -575,7 +575,7 @@ void CVACoreImpl::GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) cons ...@@ -575,7 +575,7 @@ void CVACoreImpl::GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) cons
VA_PRINT( "'" << v[ i ].sName << "'\t\t\t" << v[ i ].sDesc ); VA_PRINT( "'" << v[ i ].sName << "'\t\t\t" << v[ i ].sDesc );
viModuleInfos[ i ].sName = v[ i ].sName; viModuleInfos[ i ].sName = v[ i ].sName;
viModuleInfos[ i ].sDesc = v[ i ].sDesc; viModuleInfos[ i ].sDesc = v[ i ].sDesc;
} }
} }
VA_RETHROW; VA_RETHROW;
...@@ -1368,7 +1368,8 @@ int CVACoreImpl::CreateSoundSource( const std::string& sName ) ...@@ -1368,7 +1368,8 @@ int CVACoreImpl::CreateSoundSource( const std::string& sName )
VA_TRY VA_TRY
{ {
if( ( VACORE_MAX_NUM_SOUND_SOURCES != 0 ) && m_pNewSceneState ) int iNumSoundSource = VACORE_MAX_NUM_SOUND_SOURCES;
if( ( iNumSoundSource != 0 ) && m_pNewSceneState )
{ {
int iSourcesRemain = VACORE_MAX_NUM_SOUND_SOURCES - m_pNewSceneState->GetNumSoundSources(); int iSourcesRemain = VACORE_MAX_NUM_SOUND_SOURCES - m_pNewSceneState->GetNumSoundSources();
if( iSourcesRemain <= 0 ) if( iSourcesRemain <= 0 )
...@@ -1430,7 +1431,8 @@ int CVACoreImpl::CreateSoundSourceExplicitRenderer( const std::string& sRenderer ...@@ -1430,7 +1431,8 @@ int CVACoreImpl::CreateSoundSourceExplicitRenderer( const std::string& sRenderer
VA_TRY VA_TRY
{ {
if( ( VACORE_MAX_NUM_SOUND_SOURCES != 0 ) && m_pNewSceneState ) int iNumSoundSource = VACORE_MAX_NUM_SOUND_SOURCES;
if( ( iNumSoundSource != 0 ) && m_pNewSceneState )
{ {
int iSourcesRemain = VACORE_MAX_NUM_SOUND_SOURCES - m_pNewSceneState->GetNumSoundSources(); int iSourcesRemain = VACORE_MAX_NUM_SOUND_SOURCES - m_pNewSceneState->GetNumSoundSources();
if( iSourcesRemain <= 0 ) if( iSourcesRemain <= 0 )
...@@ -2203,7 +2205,8 @@ int CVACoreImpl::CreateSoundReceiver( const std::string& sName ) ...@@ -2203,7 +2205,8 @@ int CVACoreImpl::CreateSoundReceiver( const std::string& sName )
VA_TRY VA_TRY
{ {
if( ( VACORE_MAX_NUM_SOUND_RECEIVERS != 0 ) && m_pNewSceneState ) int iNumSoundReceivers = VACORE_MAX_NUM_SOUND_RECEIVERS;
if( ( iNumSoundReceivers != 0 ) && m_pNewSceneState )
{ {
const int iListenersRemain = VACORE_MAX_NUM_SOUND_RECEIVERS - m_pNewSceneState->GetNumListeners(); const int iListenersRemain = VACORE_MAX_NUM_SOUND_RECEIVERS - m_pNewSceneState->GetNumListeners();
if( iListenersRemain <= 0 ) if( iListenersRemain <= 0 )
...@@ -2317,7 +2320,8 @@ int CVACoreImpl::CreateSoundReceiverExplicitRenderer( const std::string& sRender ...@@ -2317,7 +2320,8 @@ int CVACoreImpl::CreateSoundReceiverExplicitRenderer( const std::string& sRender
VA_TRY VA_TRY
{ {
if( ( VACORE_MAX_NUM_SOUND_RECEIVERS != 0 ) && m_pNewSceneState ) int iNumSoundReceivers = VACORE_MAX_NUM_SOUND_RECEIVERS;
if( ( iNumSoundReceivers != 0 ) && m_pNewSceneState )
{ {
int iListenersRemain = VACORE_MAX_NUM_SOUND_RECEIVERS - m_pNewSceneState->GetNumListeners(); int iListenersRemain = VACORE_MAX_NUM_SOUND_RECEIVERS - m_pNewSceneState->GetNumListeners();
if( iListenersRemain <= 0 ) if( iListenersRemain <= 0 )
...@@ -4237,7 +4241,7 @@ void CVACoreImpl::InitializeReproductionModules() ...@@ -4237,7 +4241,7 @@ void CVACoreImpl::InitializeReproductionModules()
if( oFile.Exists() ) if( oFile.Exists() )
VA_INFO( "Core", "Reproduction input record file '" << oFile.GetName() << "' exists, will overwrite" ); VA_INFO( "Core", "Reproduction input record file '" << oFile.GetName() << "' exists, will overwrite" );
oDesc.pInputRecorder = new ITAStreamProbe( pInputTail, oFile.GetName() ); oDesc.pInputRecorder = new ITAStreamProbe( pInputTail, oFile.GetName() );
pInputTail = oDesc.pInputRecorder; pInputTail = oDesc.pInputRecorder;
VA_TRACE( "Core", "Reproduction will record input to file '" << oFile.GetName() << "'" ); VA_TRACE( "Core", "Reproduction will record input to file '" << oFile.GetName() << "'" );
...@@ -4260,7 +4264,7 @@ void CVACoreImpl::InitializeReproductionModules() ...@@ -4260,7 +4264,7 @@ void CVACoreImpl::InitializeReproductionModules()
if( oFile.Exists() ) if( oFile.Exists() )
VA_INFO( "Core", "Reproduction output record file '" << oFile.GetName() << "' exists, will overwrite" ); VA_INFO( "Core", "Reproduction output record file '" << oFile.GetName() << "' exists, will overwrite" );
oDesc.pOutputRecorder = new ITAStreamProbe( pOutputTail, oFile.GetName() ); oDesc.pOutputRecorder = new ITAStreamProbe( pOutputTail, oFile.GetName() );
pOutputTail = oDesc.pOutputRecorder; pOutputTail = oDesc.pOutputRecorder;
VA_TRACE( "Core", "Reproduction will record output to file '" << oFile.GetName() << "'" ); VA_TRACE( "Core", "Reproduction will record output to file '" << oFile.GetName() << "'" );
...@@ -4626,8 +4630,8 @@ void CVACoreImpl::SendRenderingModuleOutputDetectorsUpdateEvents() ...@@ -4626,8 +4630,8 @@ void CVACoreImpl::SendRenderingModuleOutputDetectorsUpdateEvents()
} }
m_pEventManager->BroadcastEvent( ev ); m_pEventManager->BroadcastEvent( ev );
}
} }
}
void CVACoreImpl::SendReproductionModuleOIDetectorsUpdateEvents() void CVACoreImpl::SendReproductionModuleOIDetectorsUpdateEvents()
{ {
...@@ -4800,7 +4804,7 @@ CVAStruct CVACoreImpl::CallObject( const CVAStruct& oArgs ) ...@@ -4800,7 +4804,7 @@ CVAStruct CVACoreImpl::CallObject( const CVAStruct& oArgs )
{ {
VistaFileSystemFile oFile( m_oCoreConfig.sRecordDeviceInputFileName ); VistaFileSystemFile oFile( m_oCoreConfig.sRecordDeviceInputFileName );
VistaFileSystemDirectory oFolder( m_oCoreConfig.sRecordDeviceInputBaseFolder ); VistaFileSystemDirectory oFolder( m_oCoreConfig.sRecordDeviceInputBaseFolder );
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() ); VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() );
VA_INFO( "Core", "Updating record device input file path to " << oFilePath.GetName() ); VA_INFO( "Core", "Updating record device input file path to " << oFilePath.GetName() );
...@@ -5036,76 +5040,81 @@ void CVACoreImpl::SetReproductionModuleParameters( const std::string& sModuleID, ...@@ -5036,76 +5040,81 @@ void CVACoreImpl::SetReproductionModuleParameters( const std::string& sModuleID,
if( oParams.HasKey( "RecordInputEnabled" ) ) if( oParams.HasKey( "RecordInputEnabled" ) )
VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" ); VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" );
VistaFileSystemFile oFilePath( oRep.pInputRecorder->GetFilePath() ); if( oRep.pInputRecorder )
std::string sFileName = oFilePath.GetLocalName();
std::string sBaseFolder = oFilePath.GetParentDirectory();
bool bUpdateRecordInputPath = false;
if( oParams.HasKey( "RecordInputFileName" ) )
{
sFileName = oParams[ "RecordInputFileName" ];
bUpdateRecordInputPath = true;
}
if( oParams.HasKey( "RecordInputBaseFolder" ) )
{ {
sBaseFolder = oParams[ "RecordInputBaseFolder" ]; VistaFileSystemFile oFilePath( oRep.pInputRecorder->GetFilePath() );
bUpdateRecordInputPath = true; std::string sFileName = oFilePath.GetLocalName();
} std::string sBaseFolder = oFilePath.GetParentDirectory();
if( bUpdateRecordInputPath ) bool bUpdateRecordInputPath = false;
{ if( oParams.HasKey( "RecordInputFileName" ) )
VistaFileSystemFile oFile( sFileName ); {
VistaFileSystemDirectory oFolder( sBaseFolder ); sFileName = oParams[ "RecordInputFileName" ];
bUpdateRecordInputPath = true;
}
if( oParams.HasKey( "RecordInputBaseFolder" ) )
{
sBaseFolder = oParams[ "RecordInputBaseFolder" ];
bUpdateRecordInputPath = true;
}
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() ); if( bUpdateRecordInputPath )
VA_INFO( "Core", "Updating reproduction input recording file path to " << oFilePath.GetName() ); {
VistaFileSystemFile oFile( sFileName );
VistaFileSystemDirectory oFolder( sBaseFolder );
if( oFilePath.Exists() ) VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() );
VA_INFO( "Core", "Record reproduction input recording file path exists, will overwrite" ); VA_INFO( "Core", "Updating reproduction input recording file path to " << oFilePath.GetName() );
if( !oFolder.Exists() ) if( oFilePath.Exists() )
if( !oFolder.CreateWithParentDirectories() ) VA_INFO( "Core", "Record reproduction input recording file path exists, will overwrite" );
VA_EXCEPT2( INVALID_PARAMETER, "Could not create reproduction input recording directory " + oFolder.GetName() );
oRep.pInputRecorder->SetFilePath( oFilePath.GetName() ); if( !oFolder.Exists() )
} if( !oFolder.CreateWithParentDirectories() )
VA_EXCEPT2( INVALID_PARAMETER, "Could not create reproduction input recording directory " + oFolder.GetName() );
oRep.pInputRecorder->SetFilePath( oFilePath.GetName() );
}
}
if( oParams.HasKey( "RecordOutputEnabled" ) ) if( oParams.HasKey( "RecordOutputEnabled" ) )
VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" ); VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" );
oFilePath.SetName( oRep.pOutputRecorder->GetFilePath() ); if( oRep.pOutputRecorder )
sFileName = oFilePath.GetLocalName();
sBaseFolder = oFilePath.GetParentDirectory();
bool bUpdateRecordOutputPath = false;
if( oParams.HasKey( "RecordOutputFileName" ) )
{
sFileName = oParams[ "RecordOutputFileName" ];
bUpdateRecordOutputPath = true;
}
if( oParams.HasKey( "RecordOutputBaseFolder" ) )
{ {
sBaseFolder = oParams[ "RecordOutputBaseFolder" ]; VistaFileSystemFile oFilePath( oRep.pOutputRecorder->GetFilePath() );
bUpdateRecordOutputPath = true; std::string sFileName = oFilePath.GetLocalName();
} std::string sBaseFolder = oFilePath.GetParentDirectory();
if( bUpdateRecordOutputPath ) bool bUpdateRecordOutputPath = false;
{ if( oParams.HasKey( "RecordOutputFileName" ) )
VistaFileSystemFile oFile( sFileName ); {
VistaFileSystemDirectory oFolder( sBaseFolder ); sFileName = oParams[ "RecordOutputFileName" ];
bUpdateRecordOutputPath = true;
}
if( oParams.HasKey( "RecordOutputBaseFolder" ) )
{
sBaseFolder = oParams[ "RecordOutputBaseFolder" ];
bUpdateRecordOutputPath = true;
}
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() ); if( bUpdateRecordOutputPath )
VA_INFO( "Core", "Updating reproduction output recording file path to " << oFilePath.GetName() ); {
VistaFileSystemFile oFile( sFileName );
VistaFileSystemDirectory oFolder( sBaseFolder );
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() );
VA_INFO( "Core", "Updating reproduction output recording file path to " << oFilePath.GetName() );
if( oFilePath.Exists() ) if( oFilePath.Exists() )
VA_INFO( "Core", "Record reproduction output recording file path exists, will overwrite" ); VA_INFO( "Core", "Record reproduction output recording file path exists, will overwrite" );
if( !oFolder.Exists() ) if( !oFolder.Exists() )
if( !oFolder.CreateWithParentDirectories() ) if( !oFolder.CreateWithParentDirectories() )
VA_EXCEPT2( INVALID_PARAMETER, "Could not create reproduction output recording directory " + oFolder.GetName() ); VA_EXCEPT2( INVALID_PARAMETER, "Could not create reproduction output recording directory " + oFolder.GetName() );
oRep.pOutputRecorder->SetFilePath( oFilePath.GetName() ); oRep.pOutputRecorder->SetFilePath( oFilePath.GetName() );
}
} }
// Propagate parameters // Propagate parameters
...@@ -5163,43 +5172,46 @@ void CVACoreImpl::SetRenderingModuleParameters( const std::string& sModuleID, co ...@@ -5163,43 +5172,46 @@ void CVACoreImpl::SetRenderingModuleParameters( const std::string& sModuleID, co
if( oParams.HasKey( "RecordOutputEnabled" ) ) if( oParams.HasKey( "RecordOutputEnabled" ) )
VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" ); VA_EXCEPT2( INVALID_PARAMETER, "Recording has to be enabled before streaming is active" );
VistaFileSystemFile oFilePath( oRend.pOutputRecorder->GetFilePath() ); if( oRend.pOutputRecorder ) // If enabled ...
std::string sFileName = oFilePath.GetLocalName();
std::string sBaseFolder = oFilePath.GetParentDirectory();
bool bUpdateRecordOutputPath = false;
if( oParams.HasKey( "RecordOutputFileName" ) )
{
sFileName = oParams[ "RecordOutputFileName" ];
bUpdateRecordOutputPath = true;
}
if( oParams.HasKey( "RecordOutputBaseFolder" ) )
{ {
sBaseFolder = oParams[ "RecordOutputBaseFolder" ]; VistaFileSystemFile oFilePath( oRend.pOutputRecorder->GetFilePath() );
bUpdateRecordOutputPath = true; std::string sFileName = oFilePath.GetLocalName();
} std::string sBaseFolder = oFilePath.GetParentDirectory();
if( bUpdateRecordOutputPath ) bool bUpdateRecordOutputPath = false;
{ if( oParams.HasKey( "RecordOutputFileName" ) )
VistaFileSystemFile oFile( sFileName ); {
VistaFileSystemDirectory oFolder( sBaseFolder ); sFileName = oParams[ "RecordOutputFileName" ];
bUpdateRecordOutputPath = true;
}
if( oParams.HasKey( "RecordOutputBaseFolder" ) )
{
sBaseFolder = oParams[ "RecordOutputBaseFolder" ];
bUpdateRecordOutputPath = true;
}
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() ); if( bUpdateRecordOutputPath )
VA_INFO( "Core", "Updating rendering output recording file path to " << oFilePath.GetName() ); {
VistaFileSystemFile oFile( sFileName );
VistaFileSystemDirectory oFolder( sBaseFolder );
VistaFileSystemFile oFilePath( oFolder.GetName() + "/" + oFile.GetLocalName() );
VA_INFO( "Core", "Updating rendering output recording file path to " << oFilePath.GetName() );
if( oFilePath.Exists() ) if( oFilePath.Exists() )
VA_INFO( "Core", "Record rendering output recording file path exists, will overwrite" ); VA_INFO( "Core", "Record rendering output recording file path exists, will overwrite" );
if( !oFolder.Exists() ) if( !oFolder.Exists() )
if( !oFolder.CreateWithParentDirectories() ) if( !oFolder.CreateWithParentDirectories() )
VA_EXCEPT2( INVALID_PARAMETER, "Could not create rendering output recording directory " + oFolder.GetName() ); VA_EXCEPT2( INVALID_PARAMETER, "Could not create rendering output recording directory " + oFolder.GetName() );
oRend.pOutputRecorder->SetFilePath( oFilePath.GetName() ); oRend.pOutputRecorder->SetFilePath( oFilePath.GetName() );
}
} }
// Propagate parameters // Propagate parameters
oRend.pInstance->SetParameters( oParams ); oRend.pInstance->SetParameters( oParams );
return; return;
} }
} }
......
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