Add locking for sequence widget drags.

This commit is contained in:
Jonathan Moore Liles 2008-05-22 14:20:15 -05:00
parent 98507e60bd
commit 6c9e2c8c07
2 changed files with 28 additions and 15 deletions

View File

@ -78,6 +78,32 @@ Sequence_Widget::set ( Log_Entry &e )
} }
void
Sequence_Widget::begin_drag ( const Drag &d )
{
_drag = new Drag( d );
_r = new Range( _range );
}
void
Sequence_Widget::end_drag ( void )
{
timeline->wrlock();
/* swap in the new value */
_range = *_r;
timeline->unlock();
/* TODO: perhaps trigger rebuffer here? */
delete _r;
_r = &_range;
delete _drag;
_drag = NULL;
}
/** set position of widget on the timeline. */ /** set position of widget on the timeline. */
void void
Sequence_Widget::start ( nframes_t where ) Sequence_Widget::start ( nframes_t where )

View File

@ -263,21 +263,8 @@ public:
// static void pushed ( Sequence_Widget *w ) { Sequence_Widget::_pushed = w; } // static void pushed ( Sequence_Widget *w ) { Sequence_Widget::_pushed = w; }
void begin_drag ( const Drag &d ) void begin_drag ( const Drag &d );
{ void end_drag ( void );
_drag = new Drag( d );
_r = new Range( _range );
}
void end_drag ( void )
{
_range = *_r;
delete _r;
_r = &_range;
delete _drag;
_drag = NULL;
}
int dispatch ( int m ); int dispatch ( int m );