Browse Source

Work on making system reset possible.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
af523475c4
5 changed files with 34 additions and 3 deletions
  1. +24
    -0
      Timeline/Loggable.C
  2. +1
    -0
      Timeline/Loggable.H
  3. +5
    -2
      Timeline/TLE.fl
  4. +3
    -0
      Timeline/Track.C
  5. +1
    -1
      Timeline/Track.H

+ 24
- 0
Timeline/Loggable.C View File

@@ -69,6 +69,30 @@ Loggable::open ( const char *filename )
return true;
}

/** close journal and delete all loggable objects */
bool
Loggable::close ( void )
{

DMESSAGE( "closing journal and destroying all journaled objects" );

fclose( _fp );

_fp = NULL;

for ( int i = _log_id; i--; )
{
Loggable ** l = &_loggables[ i ];

if ( *l )
delete *l;

*l = NULL;
}

return true;
}

/** sigh. parse a string of ":name value :name value" pairs into an
* array of strings, one per pair */
// FIXME: doesn't handle the case of :name ":foo bar", nested quotes


+ 1
- 0
Timeline/Loggable.H View File

@@ -100,6 +100,7 @@ private:
public:

static bool open ( const char *filename );
static bool close ( void );
static void undo ( void );
static int undo_index ( void ) { return _undo_index; }
static void compact ( void );


+ 5
- 2
Timeline/TLE.fl View File

@@ -126,7 +126,10 @@ free( path );} {}
} {
MenuItem {} {
label {&New}
xywh {0 0 40 25} deactivate
callback {Loggable::close();
// timeline->reset();
main_window->redraw();} selected
xywh {0 0 40 25}
}
MenuItem {} {
label {&Open}
@@ -536,7 +539,7 @@ delete win;}
class Timeline
}
Fl_Box {} {
label {<session name>} selected
label {<session name>}
xywh {450 0 475 22} labeltype SHADOW_LABEL labelfont 2
code0 {o->label( session_display_name );}
}


+ 3
- 0
Timeline/Track.C View File

@@ -239,6 +239,9 @@ Track::Track ( const char *L, int channels ) :

Track::~Track ( )
{
/* FIXME: why is this necessary? */
timeline->remove_track( this );

log_destroy();
}



+ 1
- 1
Timeline/Track.H View File

@@ -53,7 +53,7 @@ class Track : public Fl_Group, public Loggable
public:

Track ( const char *L, int channels=1 );
~Track ( );
virtual ~Track ( );

static bool soloing ( void ) { return _soloing; }



Loading…
Cancel
Save