diff --git a/FL/Fl_Blink_Button.H b/FL/Fl_Blink_Button.H index 90f2ed2..629926d 100644 --- a/FL/Fl_Blink_Button.H +++ b/FL/Fl_Blink_Button.H @@ -26,7 +26,7 @@ class Fl_Blink_Button : public Fl_Button { bool _on; - float _blink_interval; + int _blink_interval; bool _blinking; static void @@ -38,7 +38,7 @@ class Fl_Blink_Button : public Fl_Button void update_cb ( void ) { - Fl::repeat_timeout( _blink_interval, update_cb, this ); + Fl::repeat_timeout( _blink_interval / 1000, update_cb, this ); _on = ! _on; @@ -47,10 +47,13 @@ class Fl_Blink_Button : public Fl_Button public: - static const float SLOW = 0.5f; - static const float MEDIUM = 0.3f; - static const float FAST = 0.1f; - static const float DEFAULT = 0.5f; + enum + { + SLOW=500, + MEDIUM=300, + FAST=100, + DEFAULT=500 + }; Fl_Blink_Button ( int X, int Y, int W, int H, const char *L ) : Fl_Button( X, Y, W, H, L ) @@ -85,11 +88,11 @@ public: void blink_interval ( float v ) { - _blink_interval = v; + _blink_interval = v * 1000; if ( value() ) { Fl::remove_timeout( update_cb, this ); - Fl::add_timeout( _blink_interval, update_cb, this ); + Fl::add_timeout( _blink_interval / 1000, update_cb, this ); } } @@ -98,7 +101,7 @@ public: if ( v ) { if ( _blinking ) - Fl::add_timeout( _blink_interval, update_cb, this ); + Fl::add_timeout( _blink_interval / 1000, update_cb, this ); Fl_Button::value( v ); redraw(); } diff --git a/mixer/src/Chain.C b/mixer/src/Chain.C index a0de9bf..d160fb8 100644 --- a/mixer/src/Chain.C +++ b/mixer/src/Chain.C @@ -221,7 +221,7 @@ Chain::set ( Log_Entry &e ) void -Chain::log_children ( void ) +Chain::log_children ( void ) const { log_create(); diff --git a/mixer/src/Chain.H b/mixer/src/Chain.H index 1832749..502964b 100644 --- a/mixer/src/Chain.H +++ b/mixer/src/Chain.H @@ -122,7 +122,7 @@ public: Fl_Callback * configure_outputs_callback ( void ) const { return _configure_outputs_callback; } - void log_children ( void ); + virtual void log_children ( void ) const; static unsigned int maximum_name_length ( void ); diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index 0b2c440..e34fa76 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -160,7 +160,7 @@ Mixer_Strip::set ( Log_Entry &e ) } void -Mixer_Strip::log_children ( void ) +Mixer_Strip::log_children ( void ) const { log_create(); diff --git a/mixer/src/Mixer_Strip.H b/mixer/src/Mixer_Strip.H index 06b9768..7b3f7dc 100644 --- a/mixer/src/Mixer_Strip.H +++ b/mixer/src/Mixer_Strip.H @@ -61,7 +61,7 @@ public: void chain ( Chain *c ); - void log_children ( void ); + virtual void log_children ( void ) const; virtual void color ( Fl_Color c ); virtual Fl_Color color ( void ) const; diff --git a/nonlib/Loggable.C b/nonlib/Loggable.C index 3c6c009..b0edbe5 100644 --- a/nonlib/Loggable.C +++ b/nonlib/Loggable.C @@ -380,7 +380,8 @@ Loggable::do_this ( const char *s, bool reverse ) int found = sscanf( s, "%s %X %s ", classname, &id, command ); - ASSERT( 3 == found, "Invalid journal entry format \"%s\"", s ); + if ( 3 != found ) + FATAL( "Invalid journal entry format \"%s\"", s ); const char *create, *destroy; diff --git a/nonlib/Loggable.H b/nonlib/Loggable.H index 84aa242..e2f379c 100644 --- a/nonlib/Loggable.H +++ b/nonlib/Loggable.H @@ -42,7 +42,7 @@ class Loggable; typedef Loggable *(create_func)(Log_Entry &, unsigned int id); #define LOG_REGISTER_CREATE( class ) \ - Loggable::register_create( #class, & class ::create ); + Loggable::register_create( #class, & class ::create ) #define LOG_NAME_FUNC( class ) \ virtual const char *class_name ( void ) const { return #class ; } @@ -56,7 +56,7 @@ typedef Loggable *(create_func)(Log_Entry &, unsigned int id); r->set( e ); \ return (Loggable *)r; \ } \ - LOG_NAME_FUNC( class ); + LOG_NAME_FUNC( class ) #define LOG_NOT_LOGGABLE_FUNC( class ) \ diff --git a/nonlib/OSC/Endpoint.C b/nonlib/OSC/Endpoint.C index de2e7be..d0af9cc 100644 --- a/nonlib/OSC/Endpoint.C +++ b/nonlib/OSC/Endpoint.C @@ -134,7 +134,7 @@ namespace OSC char * Signal::get_output_connection_peer_name_and_path ( int n ) { - Signal *t; + Signal *t = NULL; int j = 0; for ( std::list::const_iterator i = _outgoing.begin(); @@ -150,10 +150,15 @@ namespace OSC // Signal *s = get_peer_signal_by_id( t->_peer, t->signal_id ); - char *r; - asprintf( &r, "%s:%s", t->_peer->name, t->path() ); + if ( t ) + { + char *r; + asprintf( &r, "%s:%s", t->_peer->name, t->path() ); - return r; + return r; + } + else + return NULL; } diff --git a/nonlib/OSC/Endpoint.H b/nonlib/OSC/Endpoint.H index 3421861..ab2d984 100644 --- a/nonlib/OSC/Endpoint.H +++ b/nonlib/OSC/Endpoint.H @@ -365,7 +365,7 @@ namespace OSC friend void Signal::rename ( const char *name ); }; -}; +} /* helper macros for defining OSC handlers */ /* #define OSC_NAME( name ) osc_ ## name */ diff --git a/nonlib/debug.h b/nonlib/debug.h index ee490eb..d125246 100644 --- a/nonlib/debug.h +++ b/nonlib/debug.h @@ -101,7 +101,7 @@ warnf ( warning_t level, #else #define DMESSAGE( fmt, args... ) #define DWARNING( fmt, args... ) -#define ASSERT( pred, fmt, args... ) +#define ASSERT( pred, fmt, args... ) (void)(pred) #endif /* these are always defined */ diff --git a/timeline/src/Audio_Region.C b/timeline/src/Audio_Region.C index befd05b..aa8b6df 100644 --- a/timeline/src/Audio_Region.C +++ b/timeline/src/Audio_Region.C @@ -515,7 +515,7 @@ Audio_Region::draw ( void ) /* overdraw a little to avoid artifacts when scrolling */ W += 2; - Fl_Color c = selected() ? fl_invert_color( _color ) : _color; +// Fl_Color c = selected() ? fl_invert_color( _color ) : _color; if ( sequence()->damage() & FL_DAMAGE_USER1 && recording() ) @@ -740,7 +740,7 @@ Audio_Region::split ( nframes_t where ) int Audio_Region::handle ( int m ) { - static int ox, oy; + static int ox; static bool copied = false; static nframes_t os; @@ -802,7 +802,6 @@ Audio_Region::handle ( int m ) else { ox = x() - X; - oy = y() - Y; /* for panning */ os = _r->offset; @@ -855,8 +854,6 @@ Audio_Region::handle ( int m ) /* panning */ int d = (ox + X) - x(); - bool negative = d < 0; - if ( d < 0 ) _r->offset = os + timeline->x_to_ts( 0 - d ); else diff --git a/timeline/src/Audio_Region.H b/timeline/src/Audio_Region.H index 07ac34b..8357da5 100644 --- a/timeline/src/Audio_Region.H +++ b/timeline/src/Audio_Region.H @@ -119,13 +119,13 @@ protected: virtual void get ( Log_Entry &e ) const; virtual void set ( Log_Entry &e ); - void draw_label ( const char *label, Fl_Align align ) + virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 ) { Sequence_Widget::draw_label( label, align ); } + virtual void draw_label ( void ); int handle ( int m ); - void draw_label ( void ); void draw_box ( void ); void draw ( void ); void resize ( void ); diff --git a/timeline/src/Control_Sequence.C b/timeline/src/Control_Sequence.C index 7904d89..1cd281d 100644 --- a/timeline/src/Control_Sequence.C +++ b/timeline/src/Control_Sequence.C @@ -305,7 +305,7 @@ Control_Sequence::draw ( void ) bool active = active_r(); const Fl_Color color = active ? this->color() : fl_inactive( this->color() ); - const Fl_Color selection_color = active ? this->selection_color() : fl_inactive( this->selection_color() ); +// const Fl_Color selection_color = active ? this->selection_color() : fl_inactive( this->selection_color() ); fl_rectf( X, Y, W, H, fl_color_average( FL_WHITE, FL_BACKGROUND_COLOR, 0.3 ) ); diff --git a/timeline/src/NSM.C b/timeline/src/NSM.C index af0ee08..8613f84 100644 --- a/timeline/src/NSM.C +++ b/timeline/src/NSM.C @@ -96,7 +96,7 @@ command_session_is_loaded ( void *userdata ) static int command_broadcast ( const char *path, lo_message msg, void *userdata ) { - int argc = lo_message_get_argc( msg ); + lo_message_get_argc( msg ); // lo_arg **argv = lo_message_get_argv( msg ); if ( !strcmp( path, "/non/hello" ) ) diff --git a/timeline/src/Sequence.H b/timeline/src/Sequence.H index 4e6c0ef..efddd92 100644 --- a/timeline/src/Sequence.H +++ b/timeline/src/Sequence.H @@ -126,6 +126,7 @@ public: virtual Sequence * clone ( void ) { assert( 0 ); + return NULL; } virtual Sequence * clone_empty ( void ) diff --git a/timeline/src/Sequence_Region.C b/timeline/src/Sequence_Region.C index 8f8bc5d..371fab7 100644 --- a/timeline/src/Sequence_Region.C +++ b/timeline/src/Sequence_Region.C @@ -145,8 +145,6 @@ Sequence_Region::handle ( int m ) { static enum trim_e trimming; - static bool copied = false; - int X = Fl::event_x(); int Y = Fl::event_y(); @@ -207,7 +205,6 @@ Sequence_Region::handle ( int m ) { Sequence_Widget::handle( m ); - copied = false; if ( trimming != NO ) trimming = NO; @@ -259,7 +256,7 @@ Sequence_Region::draw ( void ) } void -Sequence_Region::draw_label ( const char *label, Fl_Align align ) +Sequence_Region::draw_label ( const char *label, Fl_Align align, Fl_Color color, int xo, int yo ) { fl_color( FL_WHITE ); fl_font( FL_HELVETICA_ITALIC, 10 ); diff --git a/timeline/src/Sequence_Region.H b/timeline/src/Sequence_Region.H index 1c2d818..8be8b81 100644 --- a/timeline/src/Sequence_Region.H +++ b/timeline/src/Sequence_Region.H @@ -41,7 +41,8 @@ protected: virtual int handle ( int m ); virtual void draw_box( void ); virtual void draw ( void ); - virtual void draw_label ( const char *label, Fl_Align align ); + virtual void draw_label ( void ) { Sequence_Widget::draw_label(); } + virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 ); public: diff --git a/timeline/src/Sequence_Widget.H b/timeline/src/Sequence_Widget.H index ff4e335..1f9ee85 100644 --- a/timeline/src/Sequence_Widget.H +++ b/timeline/src/Sequence_Widget.H @@ -309,6 +309,7 @@ public: virtual void draw_box ( void ); virtual void draw ( void ); virtual void draw_label ( void ); + virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 ); bool operator< ( const Sequence_Widget & rhs ) const @@ -322,7 +323,6 @@ public: return _r->start <= rhs._r->start; } - virtual void draw_label ( const char *label, Fl_Align align, Fl_Color color=(Fl_Color)0, int xo=0, int yo=0 ); virtual int handle ( int m ); static bool diff --git a/timeline/src/Timeline.C b/timeline/src/Timeline.C index c12b4ca..033ff13 100644 --- a/timeline/src/Timeline.C +++ b/timeline/src/Timeline.C @@ -155,7 +155,6 @@ protected: void draw_background ( int X, int Y,int W, int H ) { - nframes_t sf = 0; nframes_t ef = timeline->length(); double ty = Y; @@ -311,8 +310,6 @@ Timeline::cb_scroll ( Fl_Widget *w ) _fpp = panzoomer->zoom(); - const int tw = tracks->w() - Track::width(); - panzoomer->x_value( ts_to_x( under_mouse ) ); redraw(); @@ -532,7 +529,7 @@ Timeline::menu_cb ( Fl_Menu_ *m ) { Loggable::block_start(); - Cursor_Region *o = new Cursor_Region( range_start(), range_end() - range_start(), "Punch", NULL ); + new Cursor_Region( range_start(), range_end() - range_start(), "Punch", NULL ); reset_range(); Loggable::block_end(); @@ -553,7 +550,7 @@ Timeline::menu_cb ( Fl_Menu_ *m ) } else { - Cursor_Region *o = new Cursor_Region( range_start(), range_end() - range_start(), "Playback", NULL ); + new Cursor_Region( range_start(), range_end() - range_start(), "Playback", NULL ); } reset_range(); @@ -1373,7 +1370,7 @@ Timeline::draw_playhead ( void ) void Timeline::redraw_playhead ( void ) { - static nframes_t last_playhead = -1; +// static nframes_t last_playhead = -1; static int last_playhead_x = -1; /* FIXME: kind of a hackish way to invoke punch / looping stuff from the UI thread... */ @@ -1439,7 +1436,7 @@ Timeline::redraw_playhead ( void ) if ( last_playhead_x != playhead_x ) { redraw_overlay(); - last_playhead = transport->frame; +// last_playhead = transport->frame; last_playhead_x = playhead_x; if ( follow_playhead ) diff --git a/timeline/src/Timeline.H b/timeline/src/Timeline.H index de66322..976609d 100644 --- a/timeline/src/Timeline.H +++ b/timeline/src/Timeline.H @@ -102,7 +102,7 @@ class Timeline : public Fl_Single_Window, public RWLock static void draw_clip ( void * v, int X, int Y, int W, int H ); - int _old_xposition; + nframes_t _old_xposition; int _old_yposition; Rectangle _selection; diff --git a/timeline/src/Track.C b/timeline/src/Track.C index 78a847f..f5cf191 100644 --- a/timeline/src/Track.C +++ b/timeline/src/Track.C @@ -865,13 +865,10 @@ Track::draw ( void ) fl_clip_box( x(), y(), w(), h(), X, Y, W, H ); - Fl_Color saved_color; + Fl_Color saved_color = color(); if ( ! Track::colored_tracks ) - { - saved_color = color(); color( FL_GRAY ); - } if ( _selected ) { diff --git a/timeline/src/Waveform.C b/timeline/src/Waveform.C index 5a683e9..018c973 100644 --- a/timeline/src/Waveform.C +++ b/timeline/src/Waveform.C @@ -122,8 +122,6 @@ Waveform::draw ( int X, int Y, int W, int H, fl_begin_line(); - unsigned long end = start + W; - j = start; for ( int x = X; x < X + W; x++, j += skip )