Browse Source

Begin to make tracks removable.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
783ba38120
3 changed files with 29 additions and 5 deletions
  1. +12
    -3
      Timeline/Loggable.C
  2. +13
    -2
      Timeline/Track.C
  3. +4
    -0
      Timeline/main.C

+ 12
- 3
Timeline/Loggable.C View File

@@ -180,9 +180,18 @@ Loggable::do_this ( const char *s, bool reverse )

if ( ! strcmp( command, destroy ) )
{
int id = l->id();
delete l;
_loggables[ id ] = NULL;
/* deleting eg. a track, which contains a list of other
widgets, causes destroy messages to be emitted for all those
widgets, but when replaying the journal the destroy message
causes the children to be deleted also... This is a temporary
hack. Would it be better to queue up objects for deletion
(when?) */
if ( l )
{
int id = l->id();
delete l;
_loggables[ id ] = NULL;
}
}
else if ( ! strcmp( command, "set" ) )
{


+ 13
- 2
Timeline/Track.C View File

@@ -417,6 +417,7 @@ Track::handle ( int m )
{ "Quad", 0, 0, 0, FL_MENU_RADIO | ( c == 4 ? FL_MENU_VALUE : 0 ) },
{ "...", 0, 0, 0, FL_MENU_RADIO | ( c == 3 || c > 4 ? FL_MENU_VALUE : 0 ) },
{ 0 },
{ "Remove", 0, 0, 0, transport->rolling ? FL_MENU_INACTIVE : 0 },
{ 0 },
};

@@ -448,12 +449,22 @@ Track::handle ( int m )
configure_outputs( c );
}
}
else if ( r == &menu[ 6 ] )
{
int r = fl_choice( "Are you certain you want to remove track \"%s\"?", "Cancel", NULL, "Remove", name() );

if ( r == 2 )
{
timeline->remove_track( this );
/* FIXME: need to queue deletion. in a way that won't crash the playback. */
// delete this;
Fl::delete_widget( this );
}
}
}
}

}
}

default:
return Fl_Group::handle( m );



+ 4
- 0
Timeline/main.C View File

@@ -105,6 +105,10 @@ main ( int argc, char **argv )
engine = new Engine;
engine->init();

/* always start stopped (please imagine for me a realistic
* scenario requiring otherwise */
transport->stop();

Loggable::open( "history" );

// Fl::add_timeout( UPDATE_FREQ, clock_update_cb, o );


Loading…
Cancel
Save