Browse Source

Make sequence jumping and duplication work for all sequence widgets.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
622a4a68dc
2 changed files with 25 additions and 30 deletions
  1. +0
    -30
      Timeline/Sequence_Region.C
  2. +25
    -0
      Timeline/Sequence_Widget.C

+ 0
- 30
Timeline/Sequence_Region.C View File

@@ -219,36 +219,6 @@ Sequence_Region::handle ( int m )
else else
return 0; return 0;
} }
else if ( Fl::event_button1() )
{
if ( Fl::event_state() & FL_CTRL )
{
/* duplication */
if ( _drag->state == 0 )
{
// sequence()->add( new Audio_Region( *this ) );
sequence()->add( this->clone() );

_drag->state = 1;
return 1;
}
}
else if ( test_press( FL_BUTTON1 ) && ! selected() )
{
/* track jumping */
if ( Y > y() + h() || Y < y() )
{
Track *t = timeline->track_under( Y );

fl_cursor( (Fl_Cursor)1 );

if ( t )
t->handle( FL_ENTER );

return 0;
}
}
}


return Sequence_Widget::handle( m ); return Sequence_Widget::handle( m );
} }


+ 25
- 0
Timeline/Sequence_Widget.C View File

@@ -20,6 +20,7 @@
#include <FL/fl_draw.H> #include <FL/fl_draw.H>


#include "Sequence_Widget.H" #include "Sequence_Widget.H"
#include "Track.H"


using namespace std; using namespace std;


@@ -339,6 +340,14 @@ Sequence_Widget::handle ( int m )
_log.hold(); _log.hold();
} }


if ( test_press( FL_BUTTON1 + FL_CTRL ) && ! _drag->state )
{
/* duplication */
sequence()->add( this->clone() );

_drag->state = 1;
return 1;
}
else if ( test_press( FL_BUTTON1 ) || test_press( FL_BUTTON1 + FL_CTRL ) ) else if ( test_press( FL_BUTTON1 ) || test_press( FL_BUTTON1 + FL_CTRL ) )
{ {
redraw(); redraw();
@@ -380,6 +389,22 @@ Sequence_Widget::handle ( int m )
timeline->redraw(); timeline->redraw();
} }


if ( ! selected() )
{
/* track jumping */
if ( Y > y() + h() || Y < y() )
{
Track *t = timeline->track_under( Y );

fl_cursor( (Fl_Cursor)1 );

if ( t )
t->handle( FL_ENTER );

return 0;
}
}

return 1; return 1;
} }
else else


Loading…
Cancel
Save