Play with push stuff.
This commit is contained in:
parent
16772b7e3b
commit
3d74d59d4a
|
@ -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;
|
||||
|
||||
|
|
|
@ -109,9 +109,12 @@ Track::draw ( void )
|
|||
/* draw crossfades */
|
||||
for ( list <Track_Widget *>::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 <Track_Widget *>::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 );
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue