Save unjournaled state on LASH save file event.

This commit is contained in:
Jonathan Moore Liles 2009-01-19 22:45:39 -06:00
parent cece0d5e0a
commit 18eba0d14b
4 changed files with 18 additions and 3 deletions

View File

@ -80,7 +80,7 @@ LASH::handle_save_file ( const char *path )
fclose( fp ); fclose( fp );
return true; return Project::save();
} }
bool bool

View File

@ -104,7 +104,6 @@ private:
static bool snapshot ( FILE * fp ); static bool snapshot ( FILE * fp );
static bool snapshot ( const char *name ); static bool snapshot ( const char *name );
static bool save_unjournaled_state ( void );
static bool replay ( FILE *fp ); static bool replay ( FILE *fp );
void init ( bool loggable=true ) void init ( bool loggable=true )
@ -138,6 +137,7 @@ public:
unsigned int id ( void ) const { return _id; } unsigned int id ( void ) const { return _id; }
static bool save_unjournaled_state ( void );
static bool open ( const char *filename ); static bool open ( const char *filename );
static bool close ( void ); static bool close ( void );
static void undo ( void ); static void undo ( void );

View File

@ -166,6 +166,19 @@ Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date
/* Public */ /* 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) */ /** Close the project (reclaiming all memory) */
bool bool
Project::close ( void ) Project::close ( void )
@ -173,7 +186,8 @@ Project::close ( void )
if ( ! open() ) if ( ! open() )
return true; return true;
tle->save_timeline_settings(); if ( ! save() )
return false;
Loggable::close(); Loggable::close();
// write_info(); // write_info();

View File

@ -52,6 +52,7 @@ public:
static const char *name ( void ) { return Project::_name; } static const char *name ( void ) { return Project::_name; }
static void compact ( void ); static void compact ( void );
static bool close ( void ); static bool close ( void );
static bool save ( void );
static bool validate ( const char *name ); static bool validate ( const char *name );
static int open ( const char *name ); static int open ( const char *name );
static bool open ( void ) { return _is_open; } static bool open ( void ) { return _is_open; }