From 3e1a32c8be3965dd8a892686841c4dbc14b54052 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 18 May 2008 00:09:18 -0500 Subject: [PATCH] Cleanup. --- Timeline/Annotation_Region.C | 1 + Timeline/Control_Point.C | 2 ++ Timeline/Peaks.C | 4 ++++ Timeline/Sequence_Point.C | 2 ++ Timeline/Sequence_Widget.C | 23 +++++++++++++++-------- Timeline/Sequence_Widget.H | 19 +++++-------------- Timeline/Timeline.C | 9 +++++++++ Timeline/Timeline.H | 18 +++++++++--------- Timeline/Waveform.C | 3 +++ 9 files changed, 50 insertions(+), 31 deletions(-) diff --git a/Timeline/Annotation_Region.C b/Timeline/Annotation_Region.C index e3f34fa..e4edb41 100644 --- a/Timeline/Annotation_Region.C +++ b/Timeline/Annotation_Region.C @@ -19,6 +19,7 @@ #include #include +#include #include "Annotation_Region.H" diff --git a/Timeline/Control_Point.C b/Timeline/Control_Point.C index 757a537..bb9331c 100644 --- a/Timeline/Control_Point.C +++ b/Timeline/Control_Point.C @@ -19,6 +19,8 @@ #include "Control_Point.H" +#include + Control_Point::Control_Point ( Sequence *t, nframes_t when, float y ) { _sequence = t; diff --git a/Timeline/Peaks.C b/Timeline/Peaks.C index d09d1a5..30b5b20 100644 --- a/Timeline/Peaks.C +++ b/Timeline/Peaks.C @@ -44,6 +44,10 @@ #include "Transport.H" // for .recording #include +#include +using std::min; +using std::max; + /* whether to cache peaks at multiple resolutions on disk to * drastically improve performance */ diff --git a/Timeline/Sequence_Point.C b/Timeline/Sequence_Point.C index 7f56763..dd3746a 100644 --- a/Timeline/Sequence_Point.C +++ b/Timeline/Sequence_Point.C @@ -19,6 +19,8 @@ #include "Sequence_Point.H" +#include + void Sequence_Point::get ( Log_Entry &e ) const { diff --git a/Timeline/Sequence_Widget.C b/Timeline/Sequence_Widget.C index 9e9c33c..4574248 100644 --- a/Timeline/Sequence_Widget.C +++ b/Timeline/Sequence_Widget.C @@ -17,16 +17,10 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ -/* TODO: - - What if we solve the continuous-modification/sync issue by making a - copy of the 'pushed' widget, and operating on that instead (hiding - the original), then when the widget is released, copy its data into - the original? - - */ #include "Sequence_Widget.H" +#include + list Sequence_Widget::_selection; Sequence_Widget * Sequence_Widget::_current = NULL; Sequence_Widget * Sequence_Widget::_pushed = NULL; @@ -188,6 +182,19 @@ Sequence_Widget::dispatch ( int m ) return handle( m ); } +void +Sequence_Widget::draw ( void ) +{ + draw_box(); +} + +void +Sequence_Widget::draw_box ( void ) +{ + fl_draw_box( box(), x(), y(), w(), h(), selected() ? FL_MAGENTA : _box_color ); +} + + /* base hanlde just does basic dragging */ int Sequence_Widget::handle ( int m ) diff --git a/Timeline/Sequence_Widget.H b/Timeline/Sequence_Widget.H index 91e0711..42e21db 100644 --- a/Timeline/Sequence_Widget.H +++ b/Timeline/Sequence_Widget.H @@ -24,7 +24,8 @@ #include "Timeline.H" #include #include -using namespace std; +using std::min; +using std::max; class Sequence_Widget; @@ -113,7 +114,7 @@ struct position_info class Sequence_Widget : public Loggable { - static list _selection; /* all the widgets making up the selection */ + static std::list _selection; /* all the widgets making up the selection */ /* FIXME: is this not the same as /pushed/? */ static Sequence_Widget * _current; /* the widget initiating events that affect the selection */ @@ -355,18 +356,8 @@ public: _sequence->damage( FL_DAMAGE_EXPOSE, x(), y(), w(), h() ); } - /* just draw a simple box */ - virtual void - draw_box ( void ) - { - fl_draw_box( box(), x(), y(), w(), h(), selected() ? FL_MAGENTA : _box_color ); - } - - virtual void - draw ( void ) - { - draw_box(); - } + virtual void draw_box ( void ); + virtual void draw ( void ); bool operator< ( const Sequence_Widget & rhs ) const diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index a9181a7..6ee19fb 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -17,6 +17,14 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ + +#include +#include +#include +#include +#include + + #include "Timeline.H" #include "Tempo_Sequence.H" #include "Time_Sequence.H" @@ -24,6 +32,7 @@ #include "Control_Sequence.H" #include #include "Scalebar.H" +#include "Sequence.H" #include "Annotation_Sequence.H" // #include diff --git a/Timeline/Timeline.H b/Timeline/Timeline.H index 1a46b79..8ca8349 100644 --- a/Timeline/Timeline.H +++ b/Timeline/Timeline.H @@ -19,13 +19,6 @@ #pragma once -#include -#include -#include -#include -#include - -#include "Scalebar.H" /* FIXME: this class needs a lot of cleaning up. Too many public * members etc. */ @@ -36,17 +29,24 @@ #include #include +#include + +class Fl_Scroll; +class Fl_Pack; +class Fl_Scrollbar; +class Fl_Widget; class Timeline; extern Timeline *timeline; -#include "Sequence.H" - struct BBT; class Tempo_Sequence; class Time_Sequence; class Annotation_Sequence; class Track; +class Scalebar; +class Sequence; +class Sequence_Widget; // disables double-buffering to make unnecessary redrawing more apparent // #define DEBUG_TIMELINE_DRAWING diff --git a/Timeline/Waveform.C b/Timeline/Waveform.C index 8c470e4..b2804f8 100644 --- a/Timeline/Waveform.C +++ b/Timeline/Waveform.C @@ -29,6 +29,9 @@ #include +#include +using std::min; +using std::max; bool Waveform::fill = true; bool Waveform::outline = true;