diff --git a/Timeline/LASH.C b/Timeline/LASH.C index 050d058..82625ca 100644 --- a/Timeline/LASH.C +++ b/Timeline/LASH.C @@ -80,7 +80,7 @@ LASH::handle_save_file ( const char *path ) fclose( fp ); - return true; + return Project::save(); } bool diff --git a/Timeline/Loggable.H b/Timeline/Loggable.H index 9e4a9cd..9edfabc 100644 --- a/Timeline/Loggable.H +++ b/Timeline/Loggable.H @@ -104,7 +104,6 @@ private: static bool snapshot ( FILE * fp ); static bool snapshot ( const char *name ); - static bool save_unjournaled_state ( void ); static bool replay ( FILE *fp ); void init ( bool loggable=true ) @@ -138,6 +137,7 @@ public: unsigned int id ( void ) const { return _id; } + static bool save_unjournaled_state ( void ); static bool open ( const char *filename ); static bool close ( void ); static void undo ( void ); diff --git a/Timeline/Project.C b/Timeline/Project.C index fe56016..b668241 100644 --- a/Timeline/Project.C +++ b/Timeline/Project.C @@ -166,6 +166,19 @@ Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date /* Public */ /**********/ +/** Save out any settings and unjournaled state... */ +bool +Project::save ( void ) +{ + if ( ! open() ) + return true; + + tle->save_timeline_settings(); + + return Loggable::save_unjournaled_state(); +} + + /** Close the project (reclaiming all memory) */ bool Project::close ( void ) @@ -173,7 +186,8 @@ Project::close ( void ) if ( ! open() ) return true; - tle->save_timeline_settings(); + if ( ! save() ) + return false; Loggable::close(); // write_info(); diff --git a/Timeline/Project.H b/Timeline/Project.H index 5bc54cc..da14b67 100644 --- a/Timeline/Project.H +++ b/Timeline/Project.H @@ -52,6 +52,7 @@ public: static const char *name ( void ) { return Project::_name; } static void compact ( void ); static bool close ( void ); + static bool save ( void ); static bool validate ( const char *name ); static int open ( const char *name ); static bool open ( void ) { return _is_open; }