Browse Source

Adapt other classes to the new handle_widget_change() method.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
33c646109f
9 changed files with 28 additions and 34 deletions
  1. +0
    -2
      Timeline/Audio_Region.C
  2. +4
    -2
      Timeline/Sequence.C
  3. +2
    -0
      Timeline/Sequence_Widget.C
  4. +2
    -14
      Timeline/Tempo_Point.C
  5. +8
    -0
      Timeline/Tempo_Sequence.C
  6. +1
    -0
      Timeline/Tempo_Sequence.H
  7. +2
    -16
      Timeline/Time_Point.C
  8. +8
    -0
      Timeline/Time_Sequence.C
  9. +1
    -0
      Timeline/Time_Sequence.H

+ 0
- 2
Timeline/Audio_Region.C View File

@@ -359,8 +359,6 @@ Audio_Region::handle ( int m )

copied = false;

sequence()->handle_widget_change( _r->start, _r->length );

return 1;
}
case FL_DRAG:


+ 4
- 2
Timeline/Sequence.C View File

@@ -149,9 +149,9 @@ Sequence::draw ( void )
void
Sequence::remove ( Sequence_Widget *r )
{
// Logger _log( this );

_widgets.remove( r );

handle_widget_change( r->start(), r->length() );
}


@@ -213,6 +213,8 @@ Sequence::add ( Sequence_Widget *r )
_widgets.push_back( r );

sort();

handle_widget_change( r->start(), r->length() );
}

static nframes_t


+ 2
- 0
Timeline/Sequence_Widget.C View File

@@ -313,6 +313,8 @@ Sequence_Widget::handle ( int m )
_log.release();
}

sequence()->handle_widget_change( _r->start, _r->length );

fl_cursor( FL_CURSOR_HAND );

return 1;


+ 2
- 14
Timeline/Tempo_Point.C View File

@@ -52,8 +52,7 @@ Tempo_Point::set ( Log_Entry &e )

}

timeline->update_tempomap();
timeline->redraw();
sequence()->handle_widget_change( start(), length() );

_make_label();
}
@@ -62,7 +61,6 @@ Tempo_Point::set ( Log_Entry &e )
Tempo_Point::Tempo_Point ( )
{
timeline->tempo_track->add( this );
timeline->update_tempomap();
}

Tempo_Point::Tempo_Point ( nframes_t when, float bpm )
@@ -72,7 +70,6 @@ Tempo_Point::Tempo_Point ( nframes_t when, float bpm )
_make_label();

timeline->tempo_track->add( this );
timeline->update_tempomap();

start( when );

@@ -84,7 +81,6 @@ Tempo_Point::Tempo_Point ( nframes_t when, float bpm )
Tempo_Point::~Tempo_Point ( )
{
timeline->tempo_track->remove( this );
timeline->update_tempomap();
log_destroy();
}

@@ -101,15 +97,7 @@ Tempo_Point::handle ( int m )
return 0;
}

int r = Sequence_Widget::handle( m );

if ( m == FL_RELEASE )
{
sequence()->sort();
timeline->update_tempomap();
timeline->redraw();
}
return r;
return Sequence_Point::handle( m );
}




+ 8
- 0
Timeline/Tempo_Sequence.C View File

@@ -19,6 +19,14 @@

#include "Tempo_Sequence.H"

void
Tempo_Sequence::handle_widget_change ( nframes_t, nframes_t )
{
sort();
timeline->update_tempomap();
timeline->redraw();
}

int
Tempo_Sequence::handle ( int m )
{


+ 1
- 0
Timeline/Tempo_Sequence.H View File

@@ -40,6 +40,7 @@ public:
// box( FL_DOWN_BOX );
}

void handle_widget_change ( nframes_t start, nframes_t length );
int handle ( int m );

};

+ 2
- 16
Timeline/Time_Point.C View File

@@ -54,8 +54,7 @@ Time_Point::set ( Log_Entry &e )

}

timeline->update_tempomap();
timeline->redraw();
sequence()->handle_widget_change( start(), length() );

_make_label();
}
@@ -64,7 +63,6 @@ Time_Point::set ( Log_Entry &e )
Time_Point::Time_Point ( ) : _time( 4, 4 )
{
timeline->time_track->add( this );
timeline->update_tempomap();
}

Time_Point::Time_Point ( nframes_t when, int bpb, int note ) : _time( bpb, note )
@@ -72,7 +70,6 @@ Time_Point::Time_Point ( nframes_t when, int bpb, int note ) : _time( bpb, note
_make_label();

timeline->time_track->add( this );
timeline->update_tempomap();

start( when );

@@ -83,7 +80,6 @@ Time_Point::Time_Point ( const Time_Point &rhs ) : Sequence_Point( rhs )
{
_time = rhs._time;

timeline->update_tempomap();
log_create();

}
@@ -91,7 +87,6 @@ Time_Point::Time_Point ( const Time_Point &rhs ) : Sequence_Point( rhs )
Time_Point::~Time_Point ( )
{
timeline->time_track->remove( this );
timeline->update_tempomap();

log_destroy();
}
@@ -114,16 +109,7 @@ Time_Point::handle ( int m )

}

int r = Sequence_Widget::handle( m );

if ( m == FL_RELEASE )
{
sequence()->sort();
timeline->update_tempomap();
timeline->redraw();
}
return r;

return Sequence_Point::handle( m );
}




+ 8
- 0
Timeline/Time_Sequence.C View File

@@ -19,6 +19,14 @@

#include "Time_Sequence.H"

void
Time_Sequence::handle_widget_change ( nframes_t, nframes_t )
{
sort();
timeline->update_tempomap();
timeline->redraw();
}

int
Time_Sequence::handle ( int m )
{


+ 1
- 0
Timeline/Time_Sequence.H View File

@@ -63,5 +63,6 @@ public:
add( new Time_Point( when, bpb, note ) );
}

void handle_widget_change ( nframes_t start, nframes_t length );
int handle ( int m );
};

Loading…
Cancel
Save