Browse Source

Prevent Timeline and Mixer from attempting to open each other's project formats.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
b222abc4e1
4 changed files with 20 additions and 6 deletions
  1. +9
    -2
      Mixer/Project.C
  2. +1
    -1
      Mixer/Project.H
  3. +9
    -2
      Timeline/Project.C
  4. +1
    -1
      Timeline/Project.H

+ 9
- 2
Mixer/Project.C View File

@@ -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 )


+ 1
- 1
Mixer/Project.H View File

@@ -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[];



+ 9
- 2
Timeline/Project.C View File

@@ -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 )


+ 1
- 1
Timeline/Project.H View File

@@ -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[];



Loading…
Cancel
Save