# HG changeset patch # User tomwalters # Date 1288051409 0 # Node ID b6d5c0cc1849a6caed6c0091726408ca7390f082 # Parent b0f4daed182bde24a926647014938f73f2fb435e - Support (hopefully) both movie writing and HTK file output. diff -r b0f4daed182b -r b6d5c0cc1849 trunk/experiments/scripts/cnbh-syllables/feature_generation/ssi_profile_features.aimcopycfg --- a/trunk/experiments/scripts/cnbh-syllables/feature_generation/ssi_profile_features.aimcopycfg Mon Oct 25 03:33:59 2010 +0000 +++ b/trunk/experiments/scripts/cnbh-syllables/feature_generation/ssi_profile_features.aimcopycfg Tue Oct 26 00:03:29 2010 +0000 @@ -35,7 +35,7 @@ module7.name = SmoothNAPOutput module7.id = htk_out module7.parameters = << %s"), script_[i].first.c_str(), script_[i].second.c_str()); tree_.Process(); - tree_.Reset(); } + // A final call to Reset() is required to close any open files. + global_parameters_.SetString("input_filename", ""); + global_parameters_.SetString("output_filename_base", ""); + tree_.Reset(); return true; } diff -r b0f4daed182b -r b6d5c0cc1849 trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h --- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h Mon Oct 25 03:33:59 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDevice.h Tue Oct 26 00:03:29 2010 +0000 @@ -182,6 +182,9 @@ //! \brief Called when animation stops virtual void Stop() { m_bRunning = false; } + + virtual void Reset(Parameters* global_parameters) = 0; + protected: //! \brief True when animation is running diff -r b0f4daed182b -r b6d5c0cc1849 trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc --- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Mon Oct 25 03:33:59 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.cc Tue Oct 26 00:03:29 2010 +0000 @@ -133,6 +133,11 @@ gRelease(); } +void GraphicsOutputDeviceMovie::Reset(Parameters* global_parameters) { + Stop(); + Initialize(global_parameters); +} + void GraphicsOutputDeviceMovie::Stop() { GraphicsOutputDeviceCairo::Stop(); CloseFile(); diff -r b0f4daed182b -r b6d5c0cc1849 trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h --- a/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h Mon Oct 25 03:33:59 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceMovie.h Tue Oct 26 00:03:29 2010 +0000 @@ -55,6 +55,9 @@ void Start(); //! \brief This function now also generates the output movie. void Stop(); + + void Reset(Parameters* global_parameters); + protected: /*! \brief Plots a summary of relevant parameters on the output diff -r b0f4daed182b -r b6d5c0cc1849 trunk/src/Modules/Output/Graphics/GraphicsView.cc --- a/trunk/src/Modules/Output/Graphics/GraphicsView.cc Mon Oct 25 03:33:59 2010 +0000 +++ b/trunk/src/Modules/Output/Graphics/GraphicsView.cc Tue Oct 26 00:03:29 2010 +0000 @@ -82,7 +82,7 @@ void GraphicsView::ResetInternal() { if (m_pDev != NULL) { - m_pDev->Stop(); + m_pDev->Reset(global_parameters_); } }