diff --git a/Mixer/Project.C b/Mixer/Project.C index e58e5e9..8836803 100644 --- a/Mixer/Project.C +++ b/Mixer/Project.C @@ -117,7 +117,7 @@ Project::write_info ( void ) } bool -Project::read_info ( int *version, char **creation_date ) +Project::read_info ( int *version, char **creation_date, char **created_by ) { FILE *fp; @@ -129,6 +129,7 @@ Project::read_info ( int *version, char **creation_date ) *version = 0; *creation_date = 0; + *created_by = 0; char *name, *value; @@ -140,6 +141,8 @@ Project::read_info ( int *version, char **creation_date ) *version = atoi( value ); else if ( ! strcmp( name, "created on" ) ) *creation_date = strdup( value ); + else if ( ! strcmp( name, "created by" ) ) + *created_by = strdup( value ); free( name ); free( value ); @@ -237,8 +240,12 @@ Project::open ( const char *name ) int version; char *creation_date; + char *created_by; - if ( ! read_info( &version, &creation_date ) ) + if ( ! read_info( &version, &creation_date, &created_by ) ) + return E_INVALID; + + if ( strncmp( created_by, APP_TITLE, strlen( APP_TITLE ) ) ) return E_INVALID; if ( version != PROJECT_VERSION ) diff --git a/Mixer/Project.H b/Mixer/Project.H index 2ea2b24..2fed316 100644 --- a/Mixer/Project.H +++ b/Mixer/Project.H @@ -32,7 +32,7 @@ class Project static char _created_on[40]; static bool write_info ( void ); - static bool read_info ( int *version, char **creation_date ); + static bool read_info ( int *version, char **creation_date, char **created_by ); static void set_name ( const char *name ); static const char *_errstr[]; diff --git a/Timeline/Project.C b/Timeline/Project.C index d2f5b7c..72e5ea5 100644 --- a/Timeline/Project.C +++ b/Timeline/Project.C @@ -124,7 +124,7 @@ Project::write_info ( void ) } bool -Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date ) +Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date, char **created_by ) { FILE *fp; @@ -137,6 +137,7 @@ Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date *version = 0; *sample_rate = 0; *creation_date = 0; + *created_by = 0; char *name, *value; @@ -150,6 +151,8 @@ Project::read_info ( int *version, nframes_t *sample_rate, char **creation_date *version = atoi( value ); else if ( ! strcmp( name, "created on" ) ) *creation_date = strdup( value ); + else if ( ! strcmp( name, "created by" ) ) + *created_by = strdup( value ); free( name ); free( value ); @@ -248,8 +251,12 @@ Project::open ( const char *name ) int version; nframes_t rate; char *creation_date; + char *created_by; - if ( ! read_info( &version, &rate, &creation_date ) ) + if ( ! read_info( &version, &rate, &creation_date, &created_by ) ) + return E_INVALID; + + if ( strncmp( created_by, APP_TITLE, strlen( APP_TITLE ) ) ) return E_INVALID; if ( version != PROJECT_VERSION ) diff --git a/Timeline/Project.H b/Timeline/Project.H index da14b67..b3860db 100644 --- a/Timeline/Project.H +++ b/Timeline/Project.H @@ -32,7 +32,7 @@ class Project static char _created_on[40]; static bool write_info ( void ); - static bool read_info ( int *version, nframes_t *sample_rate, char **creation_date ); + static bool read_info ( int *version, nframes_t *sample_rate, char **creation_date, char **created_by ); static void set_name ( const char *name ); static const char *_errstr[];