diff --git a/Timeline/Region.C b/Timeline/Region.C index e73aeee..61bc08d 100644 --- a/Timeline/Region.C +++ b/Timeline/Region.C @@ -95,8 +95,8 @@ Region::init ( void ) Region::Region ( const Region & rhs ) { _offset = rhs._offset; -// _track = rhs._track; - _track = NULL; + _track = rhs._track; +// _track = NULL; _clip = rhs._clip; _start = rhs._start; _end = rhs._end; @@ -410,6 +410,9 @@ changed: void Region::draw_box( int X, int Y, int W, int H ) { + if ( ! shown() ) + return; + /* dirty hack to keep the box from flipping to vertical at small sizes */ fl_push_clip( x(), Y, w(), H ); @@ -429,6 +432,9 @@ Region::draw_box( int X, int Y, int W, int H ) void Region::draw ( int X, int Y, int W, int H ) { + if ( ! shown() ) + return; + if ( ! ( W > 0 && H > 0 ) ) return; diff --git a/Timeline/Track.C b/Timeline/Track.C index 85950f1..dc5650f 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -103,15 +103,18 @@ Track::draw ( void ) for ( list ::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) - (*r)->draw( X, Y, W, H ); + (*r)->draw( X, Y, W, H ); /* draw crossfades */ for ( list ::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) { + if ( ! (*r)->shown() ) + continue; + Track_Widget *o = overlaps( *r ); - if ( o ) + if ( o && o->shown() ) { if ( *o <= **r ) { @@ -150,9 +153,12 @@ Track::draw ( void ) for ( list ::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ ) { + if ( ! (*r)->shown() ) + continue; + Track_Widget *o = overlaps( *r ); - if ( o ) + if ( o && o->shown() ) { if ( *o <= **r ) { @@ -371,11 +377,14 @@ Track::handle ( int m ) { Track_Widget::original( r ); Track_Widget::pushed( r->clone( r ) ); + r->hide(); } if ( retval && m == FL_RELEASE ) { - /* FIXME: copy here */ + *Track_Widget::original() = *Track_Widget::pushed(); + delete Track_Widget::pushed(); + Track_Widget::pushed( NULL ); Track_Widget::original( NULL ); } diff --git a/Timeline/Track_Widget.H b/Timeline/Track_Widget.H index efa0a9c..caada8a 100644 --- a/Timeline/Track_Widget.H +++ b/Timeline/Track_Widget.H @@ -61,6 +61,7 @@ protected: Fl_Color _color; /* color of waveform */ Fl_Color _box_color; /* color of background (box) */ + bool _shown; Drag *_drag; @@ -72,6 +73,8 @@ public: _offset = _start = _end = 0; + _shown = true; + _drag = NULL; } @@ -135,6 +138,10 @@ public: // static void pushed ( Track_Widget *w ) { Track_Widget::_pushed = w; } + bool shown ( void ) const { return _shown; } + void show ( void ) { _shown = true; } + void hide ( void ) { _shown = false; } + void offset ( nframes_t where ) {