From feafd916db530d7b0ba3f205705cae33bd34b95e Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 1 Aug 2008 00:19:21 -0500 Subject: [PATCH] Add option to remove all but the current take. --- Timeline/Track.C | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Timeline/Track.C b/Timeline/Track.C index b2f334f..0e6e406 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -366,7 +366,7 @@ Track::cb_button ( Fl_Widget *w ) { Loggable::block_start(); - Sequence *s = sequence(); + Audio_Sequence *s = sequence(); sequence( (Audio_Sequence*)takes->child( 0 ) ); @@ -375,6 +375,16 @@ Track::cb_button ( Fl_Widget *w ) Loggable::block_end(); } break; + case 3: + if ( takes->children() ) + { + Loggable::block_start(); + + takes->clear(); + + Loggable::block_end(); + } + break; default: sequence( (Audio_Sequence*)take_menu->menu()[ v ].user_data() ); } @@ -456,13 +466,18 @@ Track::update_take_menu ( void ) take_menu->add( "Show all takes", 0, 0, 0, FL_MENU_TOGGLE ); take_menu->add( "New", 0, 0, 0 ); - take_menu->add( "Remove", 0, 0, 0, FL_MENU_DIVIDER ); - for ( int i = 0; i < takes->children(); ++i ) + if ( takes->children() ) { - Sequence *s = (Sequence *)takes->child( i ); + take_menu->add( "Remove", 0, 0, 0 ); + take_menu->add( "Remove others", 0, 0, 0, FL_MENU_DIVIDER ); - take_menu->add( s->name(), 0, 0, s ); + for ( int i = 0; i < takes->children(); ++i ) + { + Sequence *s = (Sequence *)takes->child( i ); + + take_menu->add( s->name(), 0, 0, s ); + } } }