Browse Source

Timeline: Fix insertion of control points and copying of all sequence widgets.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
7a5425beca
7 changed files with 20 additions and 14 deletions
  1. +3
    -1
      timeline/src/Annotation_Point.H
  2. +3
    -1
      timeline/src/Annotation_Region.C
  3. +1
    -3
      timeline/src/Annotation_Sequence.H
  4. +3
    -1
      timeline/src/Control_Point.C
  5. +3
    -5
      timeline/src/Control_Sequence.C
  6. +2
    -2
      timeline/src/Cursor_Region.C
  7. +5
    -1
      timeline/src/Sequence_Widget.C

+ 3
- 1
timeline/src/Annotation_Point.H View File

@@ -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();
}



+ 3
- 1
timeline/src/Annotation_Region.C View File

@@ -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();
}



+ 1
- 3
timeline/src/Annotation_Sequence.H View File

@@ -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 );


+ 3
- 1
timeline/src/Control_Point.C View File

@@ -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();
}



+ 3
- 5
timeline/src/Control_Sequence.C View File

@@ -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;
}


+ 2
- 2
timeline/src/Cursor_Region.C View File

@@ -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();
}


+ 5
- 1
timeline/src/Sequence_Widget.C View File

@@ -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…
Cancel
Save