diff --git a/timeline/src/Annotation_Point.H b/timeline/src/Annotation_Point.H index 028732b..aaec594 100644 --- a/timeline/src/Annotation_Point.H +++ b/timeline/src/Annotation_Point.H @@ -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(); } diff --git a/timeline/src/Annotation_Region.C b/timeline/src/Annotation_Region.C index 80c3e22..83c374c 100644 --- a/timeline/src/Annotation_Region.C +++ b/timeline/src/Annotation_Region.C @@ -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(); } diff --git a/timeline/src/Annotation_Sequence.H b/timeline/src/Annotation_Sequence.H index dde2fd8..8c4d117 100644 --- a/timeline/src/Annotation_Sequence.H +++ b/timeline/src/Annotation_Sequence.H @@ -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 ); diff --git a/timeline/src/Control_Point.C b/timeline/src/Control_Point.C index ef7b513..ccb8f04 100644 --- a/timeline/src/Control_Point.C +++ b/timeline/src/Control_Point.C @@ -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(); } diff --git a/timeline/src/Control_Sequence.C b/timeline/src/Control_Sequence.C index 45b5252..39fd776 100644 --- a/timeline/src/Control_Sequence.C +++ b/timeline/src/Control_Sequence.C @@ -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() ); - - add( r ); - - timeline->unlock(); + new Control_Point( this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - drawable_x() ), (float)(Fl::event_y() - y()) / h() ); + + timeline->unlock(); return 1; } diff --git a/timeline/src/Cursor_Region.C b/timeline/src/Cursor_Region.C index ed7151a..3c1be5c 100644 --- a/timeline/src/Cursor_Region.C +++ b/timeline/src/Cursor_Region.C @@ -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(); } diff --git a/timeline/src/Sequence_Widget.C b/timeline/src/Sequence_Widget.C index 2880cc7..6bbfd33 100644 --- a/timeline/src/Sequence_Widget.C +++ b/timeline/src/Sequence_Widget.C @@ -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 &