diff --git a/conf/VACore.ini.proto b/conf/VACore.ini.proto index 60252dbeae4fc2836ac03a56f155c32acfdff7d8..607809c9550a7c6b46037e4c0be25e464d0a3e53 100644 --- a/conf/VACore.ini.proto +++ b/conf/VACore.ini.proto @@ -66,14 +66,6 @@ ProjectName = MyVirtualAcousticsProject [Debug] -# Record device input and store to hard drive (will record every input channel) -InputRecordEnabled = false -InputRecordFileName = $(ProjectName)_in.wav - -# Record device output and store to hard drive (will record every output channel) -OutputRecordEnabled = false -OutputRecordFilePath = $(ProjectName)_out.wav - # Set log level: 0 = quiet; 1 = errors; 2 = warnings (default); 3 = info; 4 = verbose; 5 = trace; LogLevel = @ITA_VACORE_DEFAULT_DEBUG_LEVEL@ @@ -109,6 +101,16 @@ BufferSize = AUTO # Define number of output channels manually (e.g. for virtual device) OutputChannels = AUTO +# Record device input and store to hard drive (will record every input channel) +RecordInputEnabled = false +RecordInputFileName = device_in.wav +RecordInputBaseFolder = recordings/$(ProjectName)/device + +# Record device output and store to hard drive (will record every output channel) +RecordOutputEnabled = false +RecordOutputFileName = device_out.wav +RecordOutputBaseFolder = recordings/$(ProjectName)/device + [Calibration] @@ -233,7 +235,8 @@ NumChannels = 2 IRFilterLengthSamples = 88200 OutputMonitoring = true RecordOutputEnabled = false -RecordOutputFilePath = $(ProjectName)_Renderer_MyGenericRenderer_Output.wav +RecordOutputFileName = renderer_out.wav +RecordOutputBaseFolder = recordings/$(ProjectName)/renderer/MyGenericRenderer [Renderer:MyAirTrafficNoiseRenderer] Class = BinauralAirTrafficNoise diff --git a/src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.h b/src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.h index 207aaf0fb8ebd76fd9cbb6a5425741f6240d8dcd..1f44eae90b93158646aca181ad945235e2dc1419 100644 --- a/src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.h +++ b/src/Rendering/Ambisonics/Freefield/VAAmbisonicsFreefieldAudioRenderer.h @@ -221,7 +221,7 @@ protected: bool bValidTrajectoryPresent; //!< Estimation possible -> valid trajectory present ITASampleFrame* psfOutput; //!< Accumulated listener output signals - ITAAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals + ITABufferedAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals void PreRequest() { @@ -261,7 +261,8 @@ protected: props.eQuantization = ITAQuantization::ITA_FLOAT; props.iChannels = 2; props.iLength = 0; - pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( sOutput, props ); + pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props ); + pListenerOutputAudioFileWriter->SetFilePath( sOutput ); } void FinalizeDump() diff --git a/src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h b/src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h index 1c85277b9e681507c10c237d0f1f41b110802cf0..30e8e46e35769b40aaa063ab78b59ea3b7745877 100644 --- a/src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h +++ b/src/Rendering/Binaural/FreeField/VABinauralFreefieldAudioRenderer.h @@ -220,7 +220,7 @@ protected: bool bValidTrajectoryPresent; //!< Estimation possible -> valid trajectory present ITASampleFrame* psfOutput; //!< Accumulated listener output signals - ITAAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals + ITABufferedAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals inline void PreRequest() { @@ -261,7 +261,8 @@ protected: props.eQuantization = ITAQuantization::ITA_FLOAT; props.iChannels = 2; props.iLength = 0; - pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( sOutput, props ); + pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props ); + pListenerOutputAudioFileWriter->SetFilePath( sOutput ); }; inline void FinalizeDump() diff --git a/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp b/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp index b75ade141f1a94e24cef1a1743ae5feb58cadc3b..d754f630d2289f298f5848b45a3a68c15ab2c046 100644 --- a/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp +++ b/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.cpp @@ -920,7 +920,8 @@ CVAPrototypeFreeFieldAudioRenderer::CVAPFFReceiver* CVAPrototypeFreeFieldAudioRe props.eQuantization = ITAQuantization::ITA_FLOAT; props.iChannels = m_iRecordSoundReceiversNumChannels; props.iLength = 0; - pListener->pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( sFileBaseName, props ); + pListener->pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props ); + pListener->pListenerOutputAudioFileWriter->SetFilePath( sFileBaseName ); VA_INFO( "PrototypeFreeFieldAudioRenderer", "Will record listener output signal and export to file '" << sFileBaseName << "' using " << m_iRecordSoundReceiversNumChannels << " channels after deletion" ); } diff --git a/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.h b/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.h index 9ca79873b88f5d23aec2fa792c597c912fcbfe6b..ed5a2321b9ab6351a1a88415a7986c6edc9d66eb 100644 --- a/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.h +++ b/src/Rendering/Prototyping/FreeField/VAPrototypeFreeFieldAudioRenderer.h @@ -212,7 +212,7 @@ protected: bool bValidTrajectoryPresent; //!< Estimation possible -> valid trajectory present ITASampleFrame* psfOutput; //!< Accumulated listener output signals - ITAAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals + ITABufferedAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals void PreRequest() { diff --git a/src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.h b/src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.h index 97f29e5c2a9ea8c487fbe500eb5b7e7b60710bd4..81890e8e72feeb96c66c14c9dce438411ce908c1 100644 --- a/src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.h +++ b/src/Rendering/Prototyping/HearingAid/VAPTHearingAidRenderer.h @@ -58,7 +58,7 @@ class CVAPTHASoundPathFactory; * The prototype hearing aid audio renderer implements sound propagation for * virtual hearing aids, based on the concept of binaural synthesis. * - * It accounts for + * It accounts for * - multichannel receiver directivity (HARTF), n-channel filters possible * - source directivity * - medium propagation delay @@ -68,7 +68,7 @@ class CVAPTHASoundPathFactory; * - Doppler shifts (source and listener movement in medium of finite speed of sound) * */ -class CVAPTHearingAidRenderer : public IVAAudioRenderer, public ITADatasourceRealization, public CVAObject +class CVAPTHearingAidRenderer : public IVAAudioRenderer, public ITADatasourceRealization, public CVAObject { public: CVAPTHearingAidRenderer( const CVAAudioRendererInitParams& oParams ); @@ -81,13 +81,13 @@ public: * scene. This call should be blocking until reset is done. */ void Reset(); - + //! Load a user requested scene /** * This method loads a scene, usually a file path to geometry data. */ inline void LoadScene( const std::string& ) {}; - + //! Handle a scene state change /** * This method updates the internal representation of the VA Scene @@ -104,7 +104,7 @@ public: * of the sound path entities */ void UpdateGlobalAuralizationMode( int iGlobalAuralizationMode ); - + //! Render output sample blocks /** * This method renders the sound propagation based on the binaural approach @@ -121,13 +121,13 @@ public: CVAStruct CallObject( const CVAStruct& oArgs ); - void onStartDumpListeners(const std::string& sFilenameFormat); + void onStartDumpListeners( const std::string& sFilenameFormat ); void onStopDumpListeners(); protected: //! Internal source representation - class Source : public CVAPoolObject + class Source : public CVAPoolObject { public: class Config @@ -176,8 +176,8 @@ protected: }; double GetCreationTimestamp() const - { - return m_dCreationTimeStamp; + { + return m_dCreationTimeStamp; }; private: @@ -186,7 +186,7 @@ protected: //! Internal listener representation - class Listener : public CVAPoolObject + class Listener : public CVAPoolObject { public: class Config @@ -202,7 +202,7 @@ protected: }; Listener( CVACoreImpl* pCore, const Config& oConf ) - : m_pCore( pCore ), m_oConf( oConf ) + : m_pCore( pCore ), m_oConf( oConf ) {}; CVACoreImpl* m_pCore; @@ -216,10 +216,10 @@ protected: VAVec3 vPredUp; //!< Estimated Orientation (Up-Vektor) ITASampleFrame* psfOutput; //!< Accumulated listener output signals - ITAAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals - - void PreRequest() - { + ITABufferedAudiofileWriter* pListenerOutputAudioFileWriter; //!< File writer used for dumping the listener signals + + void PreRequest() + { pData = nullptr; CVABasicMotionModel::Config oListenerMotionConfig; @@ -234,7 +234,7 @@ protected: psfOutput = nullptr; }; - void PreRelease() + void PreRelease() { delete pMotionModel; pMotionModel = nullptr; @@ -243,18 +243,19 @@ protected: FinalizeDump(); }; - void InitDump(const std::string& sFilename) { - std::string sOutput(sFilename); - sOutput = SubstituteMacro(sOutput, "ListenerName", pData->sName); - sOutput = SubstituteMacro(sOutput, "ListenerID", IntToString(pData->iID)); - + void InitDump( const std::string& sFilename ) { + std::string sOutput( sFilename ); + sOutput = SubstituteMacro( sOutput, "ListenerName", pData->sName ); + sOutput = SubstituteMacro( sOutput, "ListenerID", IntToString( pData->iID ) ); + ITAAudiofileProperties props; props.dSampleRate = m_pCore->GetCoreConfig()->oAudioDriverConfig.dSampleRate; props.eDomain = ITADomain::ITA_TIME_DOMAIN; props.eQuantization = ITAQuantization::ITA_FLOAT; props.iChannels = 2; props.iLength = 0; - pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create(sOutput, props); + pListenerOutputAudioFileWriter = ITABufferedAudiofileWriter::create( props ); + pListenerOutputAudioFileWriter->SetFilePath( sOutput ); } void FinalizeDump() { @@ -273,7 +274,7 @@ private: CVASceneState* m_pNewSceneState; int m_iCurGlobalAuralizationMode; - + IVAObjectPool* m_pSoundPathPool; CVAPTHASoundPathFactory* m_pSoundPathFactory; std::list< CVAPTHASoundPath* > m_lSoundPaths; //!< List of sound paths in user context (VACore calls) @@ -298,7 +299,7 @@ private: //std::string m_sDumpListenersFilenameFormat; double m_dDumpListenersGain; ITAAtomicInt m_iDumpListenersFlag; - + int m_iHRIRFilterLength; //!< Length of the HRIR filter DSP module int m_iDefaultVDLSwitchingAlgorithm; @@ -351,8 +352,8 @@ private: void Init( const CVAStruct& oArgs ); void ManageSoundPaths( const CVASceneState* pCurScene, - const CVASceneState* pNewScene, - const CVASceneStateDiff* pDiff ); + const CVASceneState* pNewScene, + const CVASceneStateDiff* pDiff ); void UpdateSources(); CVAPTHearingAidRenderer::Listener* CreateListener( int iID, const CVAReceiverState* pListenerState ); void DeleteListener( int iID ); @@ -360,7 +361,7 @@ private: void DeleteSource( int iID ); CVAPTHASoundPath* CreateSoundPath( Source* pSource, Listener* pListener ); void DeleteSoundPath( CVAPTHASoundPath* pPath ); - + void UpdateTrajectories(); void UpdateSoundPaths(); diff --git a/src/VACoreConfig.cpp b/src/VACoreConfig.cpp index 1769494307a117b4f9bec1ed57ccfc0f4ee1551d..e3c6dd34499b2999284821925f963bee3c3533dc 100644 --- a/src/VACoreConfig.cpp +++ b/src/VACoreConfig.cpp @@ -116,13 +116,17 @@ void CVACoreConfig::Init( const CVAStruct& oData ) oHardwareSetup.Init( oData ); - conf.OptBool( "Debug/InputRecordEnabled", bRecordDeviceInputEnabled, false ); - conf.OptString( "Debug/InputRecordFilePath", sRecordDeviceInputFilePath ); - sRecordDeviceInputFilePath = mMacros.SubstituteMacros( sRecordDeviceInputFilePath ); - - conf.OptBool( "Debug/OutputRecordEnabled", bRecordDeviceOutputEnabled, false ); - conf.OptString( "Debug/OutputRecordFilePath", sRecordFinalOutputFilePath ); - sRecordFinalOutputFilePath = mMacros.SubstituteMacros( sRecordFinalOutputFilePath ); + conf.OptBool( "Audio device/RecordInputEnabled", bRecordDeviceInputEnabled, false ); + conf.OptString( "Audio device/RecordInputFileName", sRecordDeviceInputFileName, "device_in.wav" ); + sRecordDeviceInputFileName = mMacros.SubstituteMacros( sRecordDeviceInputFileName ); + conf.OptString( "Audio device/RecordInputBaseFolder", sRecordDeviceInputBaseFolder, "recordings/device" ); + sRecordDeviceInputBaseFolder = mMacros.SubstituteMacros( sRecordDeviceInputBaseFolder ); + + conf.OptBool( "Audio device/RecordOutputEnabled", bRecordDeviceOutputEnabled, false ); + conf.OptString( "Audio device/RecordOutputFileName", sRecordDeviceOutputFileName, "device_out.wav" ); + sRecordDeviceOutputFileName = mMacros.SubstituteMacros( sRecordDeviceOutputFileName ); + conf.OptString( "Audio device/RecordOutputBaseFolder", sRecordDeviceOutputBaseFolder, "recordings/device" ); + sRecordDeviceOutputBaseFolder = mMacros.SubstituteMacros( sRecordDeviceOutputBaseFolder ); conf.OptNumber( "HomogeneousMedium/DefaultRelativeHumidity", oInitialHomogeneousMedium.dRelativeHumidityPercent, g_dDefaultRelativeHumidity ); conf.OptNumber( "HomogeneousMedium/DefaultSoundSpeed", oInitialHomogeneousMedium.dSoundSpeed, g_dDefaultSpeedOfSound ); @@ -135,7 +139,7 @@ void CVACoreConfig::Init( const CVAStruct& oData ) if( sDefaultAmplitudeCalibrationMode == "124dB" ) dDefaultAmplitudeCalibration = g_dSoundPower_128dB_SPL_1m; - conf.OptNumber( "Calibration/DefaultMinimumDistance", dDefaultMinimumDistance, 0.25f ); // translates +12 dB SPL + conf.OptNumber( "Calibration/DefaultMinimumDistance", dDefaultMinimumDistance, 0.25f ); // translates to max +12 dB SPL conf.OptNumber( "Calibration/DefaultDistance", dDefaultDistance, 2.0f ); // translates to -6 dB SPL diff --git a/src/VACoreConfig.h b/src/VACoreConfig.h index bd0a2d7fe8bea52ff6598666acc2d4d1a821d827..fd635397a93bdd28117e054a7653c99c219741b3 100644 --- a/src/VACoreConfig.h +++ b/src/VACoreConfig.h @@ -39,10 +39,12 @@ public: std::vector< std::string > vsSearchPaths; //!< Search paths (existing directories only) bool bRecordDeviceInputEnabled; //!< Switch to store entire device input stream record to hard drive - std::string sRecordDeviceInputFilePath; //!< File path where to store the input stream record to hard drive + std::string sRecordDeviceInputFileName; //!< File path where to store the input stream record to hard drive + std::string sRecordDeviceInputBaseFolder; //!< File base path of stream record bool bRecordDeviceOutputEnabled; //!< Switch to store entire device output stream record to hard drive - std::string sRecordFinalOutputFilePath; //!< File path where to store the output stream record to hard drive + std::string sRecordDeviceOutputFileName; //!< File path where to store the output stream record to hard drive + std::string sRecordDeviceOutputBaseFolder; //!< File base path of stream record int iTriggerUpdateMilliseconds; diff --git a/src/VACoreImpl.cpp b/src/VACoreImpl.cpp index 970bfcf25db797cce1a444344b5dc8ae704c1034..07eff69b775c09917e0d11041cca6648a8a5695e 100644 --- a/src/VACoreImpl.cpp +++ b/src/VACoreImpl.cpp @@ -492,7 +492,26 @@ void CVACoreImpl::Initialize() { if( m_oCoreConfig.bRecordDeviceInputEnabled ) { - m_pStreamProbeDeviceInput = new ITAStreamProbe( pInputTail, m_oCoreConfig.sRecordDeviceInputFilePath ); + VistaFileSystemFile oRecordFile( m_oCoreConfig.sRecordDeviceInputFileName ); + VistaFileSystemDirectory oRecordBaseFolder( m_oCoreConfig.sRecordDeviceInputBaseFolder ); + + if( !oRecordBaseFolder.Exists() ) + { + if( oRecordBaseFolder.CreateWithParentDirectories() ) + { + VA_INFO( "Core", "Created device input record base folder " << oRecordBaseFolder.GetName() << " with parent directories" ); + } + else + { + VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent device input record base folder '" + oRecordBaseFolder.GetName() + "'" ); + } + } + + std::string sFilePath = oRecordBaseFolder.GetName() + "/" + oRecordFile.GetLocalName(); + if( VistaFileSystemFile( sFilePath ).Exists() ) + VA_INFO( "Core", "Device input record file '" << sFilePath << "' exists, will overwrite" ); + + m_pStreamProbeDeviceInput = new ITAStreamProbe( pInputTail, sFilePath ); pInputTail = m_pStreamProbeDeviceInput; } } @@ -560,7 +579,26 @@ void CVACoreImpl::Initialize() { ITADatasource* pOutputTail = m_pOutputStreamDetector; if( m_oCoreConfig.bRecordDeviceOutputEnabled ) { - m_pStreamProbeFinal = new ITAStreamProbe( pOutputTail, m_oCoreConfig.sRecordFinalOutputFilePath ); + VistaFileSystemFile oRecordFile( m_oCoreConfig.sRecordDeviceOutputFileName ); + VistaFileSystemDirectory oRecordBaseFolder( m_oCoreConfig.sRecordDeviceOutputBaseFolder ); + + if( !oRecordBaseFolder.Exists() ) + { + if( oRecordBaseFolder.CreateWithParentDirectories() ) + { + VA_INFO( "Core", "Created device output record base folder " << oRecordBaseFolder.GetName() << " with parent directories" ); + } + else + { + VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent device output record base folder '" + oRecordBaseFolder.GetName() + "'" ); + } + } + + std::string sFilePath = oRecordBaseFolder.GetName() + "/" + oRecordFile.GetLocalName(); + if( VistaFileSystemFile( sFilePath ).Exists() ) + VA_INFO( "Core", "Device output record file '" << sFilePath << "' exists, will overwrite" ); + + m_pStreamProbeFinal = new ITAStreamProbe( pOutputTail, sFilePath ); pOutputTail = m_pStreamProbeFinal; } @@ -902,7 +940,7 @@ void CVACoreImpl::GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) cons VA_PRINT( "'" << v[ i ].sName << "'\t\t\t" << v[ i ].sDesc ); viModuleInfos[ i ].sName = v[ i ].sName; viModuleInfos[ i ].sDesc = v[ i ].sDesc; - } + } } VA_RETHROW; @@ -4504,7 +4542,6 @@ void CVACoreImpl::InitializeAudioRenderers() conf.ReqString( "RecordOutputBaseFolder", sBaseFolderRAW ); std::string sBaseFolder = m_oCoreConfig.mMacros.SubstituteMacros( sBaseFolderRAW ); oRecordOutputBaseFolder.SetName( sBaseFolder ); - } if( !oRecordOutputBaseFolder.Exists() ) @@ -4517,16 +4554,10 @@ void CVACoreImpl::InitializeAudioRenderers() { VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent renderer record base folder '" + oRecordOutputBaseFolder.GetName() + "'" ); } - - } - - if( oRecordOutputFile.Exists() ) - { - VA_INFO( "Core", "Rendering record file '" << oRecordOutputFile.GetName() << "' exists, will overwrite" ); } oParams.sRecordOutputFileName = oRecordOutputFile.GetLocalName(); - oParams.sRecordOutputBaseFolder = oRecordOutputFile.GetParentDirectory(); + oParams.sRecordOutputBaseFolder = oRecordOutputBaseFolder.GetName(); } @@ -4547,6 +4578,10 @@ void CVACoreImpl::InitializeAudioRenderers() if( oParams.bRecordOutputEnabled ) { std::string sFilePath = oParams.sRecordOutputBaseFolder + "/" + oParams.sRecordOutputFileName; + + if( VistaFileSystemFile( sFilePath ).Exists() ) + VA_INFO( "Core", "Rendering record file '" << sFilePath << "' exists, will overwrite" ); + VistaFileSystemFile oFile( sFilePath ); oRendererDesc.pOutputRecorder = new ITAStreamProbe( pRendererOutputTail, oFile.GetName() ); pRendererOutputTail = oRendererDesc.pOutputRecorder; @@ -4675,7 +4710,6 @@ void CVACoreImpl::InitializeReproductionModules() conf.ReqString( "RecordInputBaseFolder", sBaseFolderRAW ); std::string sBaseFolder = m_oCoreConfig.mMacros.SubstituteMacros( sBaseFolderRAW ); oRecordInputFolder.SetName( sBaseFolder ); - } if( !oRecordInputFolder.Exists() ) @@ -4688,16 +4722,10 @@ void CVACoreImpl::InitializeReproductionModules() { VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent reproduction input record base folder '" + oRecordInputFolder.GetName() + "'" ); } - - } - - if( oRecordInputFile.Exists() ) - { - VA_INFO( "Core", "Reproduction input record file '" << oRecordInputFile.GetName() << "' exists, will overwrite" ); } oParams.sRecordInputFileName = oRecordInputFile.GetLocalName(); - oParams.sRecordInputBaseFolder = oRecordInputFile.GetParentDirectory(); + oParams.sRecordInputBaseFolder = oRecordInputFolder.GetName(); } @@ -4707,7 +4735,7 @@ void CVACoreImpl::InitializeReproductionModules() if( oParams.bRecordOutputEnabled ) { VistaFileSystemFile oRecordOutputFile( "reproduction.wav" ); - VistaFileSystemDirectory oRecordOutputFolder( "./" ); + VistaFileSystemDirectory oRecordOutputBaseFolder( "./" ); std::string sFilePathRAWDeprecated; conf.OptString( "RecordOutputFilePath", sFilePathRAWDeprecated ); @@ -4721,7 +4749,7 @@ void CVACoreImpl::InitializeReproductionModules() std::string sRecordOutputFilePath = m_oCoreConfig.mMacros.SubstituteMacros( sFilePathRAWDeprecated ); oRecordOutputFile.SetName( sRecordOutputFilePath ); - oRecordOutputFolder.SetName( oRecordOutputFile.GetParentDirectory() ); + oRecordOutputBaseFolder.SetName( oRecordOutputFile.GetParentDirectory() ); } else { @@ -4733,30 +4761,23 @@ void CVACoreImpl::InitializeReproductionModules() std::string sBaseFolderRAW; conf.ReqString( "RecordOutputBaseFolder", sBaseFolderRAW ); std::string sBaseFolder = m_oCoreConfig.mMacros.SubstituteMacros( sBaseFolderRAW ); - oRecordOutputFolder.SetName( sBaseFolder ); - + oRecordOutputBaseFolder.SetName( sBaseFolder ); } - if( !oRecordOutputFolder.Exists() ) + if( !oRecordOutputBaseFolder.Exists() ) { - if( oRecordOutputFolder.CreateWithParentDirectories() ) + if( oRecordOutputBaseFolder.CreateWithParentDirectories() ) { - VA_INFO( "Core", "Created reproduction output record base folder " << oRecordOutputFolder.GetName() << " with parent directories" ); + VA_INFO( "Core", "Created reproduction output record base folder " << oRecordOutputBaseFolder.GetName() << " with parent directories" ); } else { - VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent reproduction output record base folder '" + oRecordOutputFolder.GetName() + "'" ); + VA_EXCEPT2( INVALID_PARAMETER, "Could not create non-existent reproduction output record base folder '" + oRecordOutputBaseFolder.GetName() + "'" ); } - - } - - if( oRecordOutputFile.Exists() ) - { - VA_INFO( "Core", "Reproduction output record file '" << oRecordOutputFile.GetName() << "' exists, will overwrite" ); } oParams.sRecordOutputFileName = oRecordOutputFile.GetLocalName(); - oParams.sRecordOutputBaseFolder = oRecordOutputFile.GetParentDirectory(); + oParams.sRecordOutputBaseFolder = oRecordOutputBaseFolder.GetName(); } @@ -4803,6 +4824,10 @@ void CVACoreImpl::InitializeReproductionModules() { std::string sFilePath = oParams.sRecordInputBaseFolder + "/" + oParams.sRecordInputFileName; VistaFileSystemFile oFile( sFilePath ); + + if( oFile.Exists() ) + VA_INFO( "Core", "Reproduction input record file '" << oFile.GetName() << "' exists, will overwrite" ); + oDesc.pInputRecorder = new ITAStreamProbe( pInputTail, oFile.GetName() ); pInputTail = oDesc.pInputRecorder; VA_TRACE( "Core", "Reproduction will record input to file '" << oFile.GetName() << "'" ); @@ -4822,6 +4847,10 @@ void CVACoreImpl::InitializeReproductionModules() { std::string sFilePath = oParams.sRecordOutputBaseFolder + "/" + oParams.sRecordOutputFileName; VistaFileSystemFile oFile( sFilePath ); + + if( oFile.Exists() ) + VA_INFO( "Core", "Reproduction output record file '" << oFile.GetName() << "' exists, will overwrite" ); + oDesc.pOutputRecorder = new ITAStreamProbe( pOutputTail, oFile.GetName() ); pOutputTail = oDesc.pOutputRecorder; VA_TRACE( "Core", "Reproduction will record output to file '" << oFile.GetName() << "'" ); @@ -5187,8 +5216,8 @@ void CVACoreImpl::SendRenderingModuleOutputDetectorsUpdateEvents() } m_pEventManager->BroadcastEvent( ev ); + } } -} void CVACoreImpl::SendReproductionModuleOIDetectorsUpdateEvents() { @@ -5345,6 +5374,11 @@ CVAStruct CVACoreImpl::CallObject( const CVAStruct& oArgs ) } } + if( oArgs.HasKey( "Audio device/RecordInputFileName" ) ) + { + VA_EXCEPT_NOT_IMPLEMENTED; + } + VA_VERBOSE( "Core", "Core module will transmit answer now" ); return oReturn; }