Work on making system reset possible.
This commit is contained in:
parent
5f4fd49867
commit
af523475c4
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );}
|
||||
}
|
||||
|
|
|
@ -239,6 +239,9 @@ Track::Track ( const char *L, int channels ) :
|
|||
|
||||
Track::~Track ( )
|
||||
{
|
||||
/* FIXME: why is this necessary? */
|
||||
timeline->remove_track( this );
|
||||
|
||||
log_destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue