Timeline: Fix insertion of control points and copying of all sequence widgets.
This commit is contained in:
parent
f0757a09c8
commit
7a5425beca
|
@ -69,12 +69,14 @@ public:
|
|||
|
||||
Annotation_Point ( Sequence *sequence, nframes_t when, const char *label )
|
||||
{
|
||||
_sequence = sequence;
|
||||
_sequence = NULL;
|
||||
|
||||
_r->start = when;
|
||||
|
||||
_label = strdup( label );
|
||||
|
||||
sequence->add( this );
|
||||
|
||||
log_create();
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ Annotation_Region::set ( Log_Entry &e )
|
|||
|
||||
Annotation_Region::Annotation_Region ( Sequence *sequence, nframes_t when, const char *label )
|
||||
{
|
||||
_sequence = sequence;
|
||||
_sequence = NULL;
|
||||
|
||||
_r->start = when;
|
||||
|
||||
|
@ -62,6 +62,8 @@ Annotation_Region::Annotation_Region ( Sequence *sequence, nframes_t when, const
|
|||
|
||||
_label = strdup( label );
|
||||
|
||||
sequence->add( this );
|
||||
|
||||
log_create();
|
||||
}
|
||||
|
||||
|
|
|
@ -107,15 +107,13 @@ public:
|
|||
|
||||
if ( Fl::event_button1() )
|
||||
{
|
||||
add( new Annotation_Point( this, x_to_offset( Fl::event_x() - drawable_x() ), "mark" ) );
|
||||
new Annotation_Point( this, x_to_offset( Fl::event_x() - drawable_x() ), "mark" );
|
||||
redraw();
|
||||
}
|
||||
if ( Fl::event_button3() && Fl::event_shift() )
|
||||
{
|
||||
Annotation_Region *r = new Annotation_Region( this, x_to_offset( Fl::event_x() - drawable_x() ), "mark" );
|
||||
|
||||
add( r );
|
||||
|
||||
Sequence_Widget::pushed( r );
|
||||
|
||||
r->handle( m );
|
||||
|
|
|
@ -25,11 +25,13 @@
|
|||
|
||||
Control_Point::Control_Point ( Sequence *t, nframes_t when, float y )
|
||||
{
|
||||
_sequence = t;
|
||||
_sequence = NULL;
|
||||
_y = y;
|
||||
_r->start = when;
|
||||
_box_color = FL_WHITE;
|
||||
|
||||
t->add( this );
|
||||
|
||||
log_create();
|
||||
}
|
||||
|
||||
|
|
|
@ -756,11 +756,9 @@ Control_Sequence::handle ( int m )
|
|||
/* insert new control point */
|
||||
timeline->wrlock();
|
||||
|
||||
Control_Point *r = new Control_Point( this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - drawable_x() ), (float)(Fl::event_y() - y()) / h() );
|
||||
new Control_Point( this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - drawable_x() ), (float)(Fl::event_y() - y()) / h() );
|
||||
|
||||
add( r );
|
||||
|
||||
timeline->unlock();
|
||||
timeline->unlock();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -89,8 +89,8 @@ Cursor_Region::Cursor_Region ( nframes_t when, nframes_t length, const char *typ
|
|||
|
||||
Cursor_Region::Cursor_Region ( const Cursor_Region &rhs ) : Sequence_Region( rhs )
|
||||
{
|
||||
_label = strdup( rhs._label );
|
||||
_type = strdup( rhs._type );
|
||||
_label = rhs._label ? strdup( rhs._label ) : NULL;
|
||||
_type = rhs._type ? strdup( rhs._type ) : NULL;
|
||||
|
||||
log_create();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ Sequence_Widget::Sequence_Widget ( const Sequence_Widget &rhs ) : Loggable( rhs
|
|||
else
|
||||
_label = 0;
|
||||
|
||||
_sequence = rhs._sequence;
|
||||
|
||||
_range = rhs._range;
|
||||
_dragging_range = rhs._dragging_range;
|
||||
|
@ -70,6 +69,11 @@ Sequence_Widget::Sequence_Widget ( const Sequence_Widget &rhs ) : Loggable( rhs
|
|||
|
||||
_color = rhs._color;
|
||||
_box_color = rhs._box_color;
|
||||
|
||||
_sequence = NULL;
|
||||
|
||||
if ( rhs._sequence )
|
||||
rhs._sequence->add( this );
|
||||
};
|
||||
|
||||
const Sequence_Widget &
|
||||
|
|
Loading…
Reference in New Issue