diff --git a/Makefile b/Makefile index a18c0d2..7b4c48a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ FLTK_LIBS := `fltk-config --ldflags` JACK_LIBS := `pkg-config --libs jack` SNDFILE_LIBS := `pkg-config --libs sndfile` -CXXFLAGS := -DVERSION=\"$(VERSION)\" -ggdb -Wall -O0 -fno-rtti -fno-exceptions +CXXFLAGS := -DVERSION=\"$(VERSION)\" -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions all: makedepend FL Timeline Mixer diff --git a/Timeline/Annotation_Point.H b/Timeline/Annotation_Point.H index c60ee62..b674754 100644 --- a/Timeline/Annotation_Point.H +++ b/Timeline/Annotation_Point.H @@ -77,10 +77,9 @@ public: log_create(); } - Annotation_Point ( const Annotation_Point &rhs ) + Annotation_Point ( const Annotation_Point &rhs ) : Sequence_Point( rhs ) { - _r->start = rhs._r->start; - _label = strdup( rhs._label ); + log_create(); } ~Annotation_Point ( ) diff --git a/Timeline/Annotation_Region.C b/Timeline/Annotation_Region.C index 243e619..e3f34fa 100644 --- a/Timeline/Annotation_Region.C +++ b/Timeline/Annotation_Region.C @@ -62,12 +62,11 @@ Annotation_Region::Annotation_Region ( Sequence *sequence, nframes_t when, const log_create(); } -Annotation_Region::Annotation_Region ( const Annotation_Region &rhs ) +Annotation_Region::Annotation_Region ( const Annotation_Region &rhs ) : Sequence_Region( rhs ) { - _r->start = rhs._r->start; - _r->length = rhs._r->length; - _label = strdup( rhs._label ); + + log_create(); } diff --git a/Timeline/Annotation_Region.H b/Timeline/Annotation_Region.H index 0197c9d..1ad9975 100644 --- a/Timeline/Annotation_Region.H +++ b/Timeline/Annotation_Region.H @@ -49,6 +49,8 @@ protected: _label = NULL; } + Annotation_Region ( const Annotation_Region &rhs ); + public: /* for loggable */ @@ -56,7 +58,6 @@ public: SEQUENCE_WIDGET_CLONE_FUNC( Annotation_Region ); Annotation_Region ( Sequence *track, nframes_t when, const char *name ); - Annotation_Region ( const Annotation_Region &rhs ); virtual ~Annotation_Region ( ); void draw_box ( void ); diff --git a/Timeline/Audio_Region.C b/Timeline/Audio_Region.C index 8bddddd..8cc0ac7 100644 --- a/Timeline/Audio_Region.C +++ b/Timeline/Audio_Region.C @@ -127,9 +127,9 @@ Audio_Region::init ( void ) } /* copy constructor */ -Audio_Region::Audio_Region ( const Audio_Region & rhs ) +Audio_Region::Audio_Region ( const Audio_Region & rhs ) : Sequence_Region( rhs ) { - *((Sequence_Region*)this) = (Sequence_Region &)rhs; +// *((Sequence_Region*)this) = (Sequence_Region &)rhs; _clip = rhs._clip; _scale = rhs._scale; diff --git a/Timeline/Control_Point.C b/Timeline/Control_Point.C index a9572c4..757a537 100644 --- a/Timeline/Control_Point.C +++ b/Timeline/Control_Point.C @@ -29,10 +29,11 @@ Control_Point::Control_Point ( Sequence *t, nframes_t when, float y ) log_create(); } -Control_Point::Control_Point ( const Control_Point &rhs ) +Control_Point::Control_Point ( const Control_Point &rhs ) : Sequence_Point( rhs ) { - _r->start = rhs._r->start; _y = rhs._y; + + log_create(); } void diff --git a/Timeline/Control_Point.H b/Timeline/Control_Point.H index 1816543..2eff4eb 100644 --- a/Timeline/Control_Point.H +++ b/Timeline/Control_Point.H @@ -36,6 +36,8 @@ protected: virtual void get ( Log_Entry &e ) const; virtual void set ( Log_Entry &e ); + Control_Point ( const Control_Point &rhs ); + public: @@ -44,7 +46,6 @@ public: SEQUENCE_WIDGET_CLONE_FUNC( Control_Point ); Control_Point ( Sequence *t, nframes_t when, float y ); - Control_Point ( const Control_Point &rhs ); ~Control_Point ( ) { diff --git a/Timeline/Loggable.H b/Timeline/Loggable.H index 80c1f58..c6e8fee 100644 --- a/Timeline/Loggable.H +++ b/Timeline/Loggable.H @@ -223,6 +223,13 @@ protected: void log_create ( void ) const; void log_destroy ( void ) const; + /* leaf subclasses *must* call log_create() at the end of their copy contructors */ + Loggable ( const Loggable &rhs ) + { + /* FIXME: get a real id here!!! */ + _id = 0; + } + public: // virtual const char *class_name ( void ) const = 0; diff --git a/Timeline/Sequence_Point.C b/Timeline/Sequence_Point.C index 7f56763..1b1e052 100644 --- a/Timeline/Sequence_Point.C +++ b/Timeline/Sequence_Point.C @@ -28,8 +28,6 @@ Sequence_Point::get ( Log_Entry &e ) const void Sequence_Point::set ( Log_Entry &e ) { - Sequence_Widget::set( e ); - for ( int i = 0; i < e.size(); ++i ) { const char *s, *v; @@ -42,6 +40,8 @@ Sequence_Point::set ( Log_Entry &e ) } } + + Sequence_Widget::set( e ); } static void diff --git a/Timeline/Sequence_Point.H b/Timeline/Sequence_Point.H index 444681a..69f1466 100644 --- a/Timeline/Sequence_Point.H +++ b/Timeline/Sequence_Point.H @@ -31,6 +31,12 @@ protected: void get ( Log_Entry &e ) const; void set ( Log_Entry &e ); + Sequence_Point ( const Sequence_Point &rhs ) : Sequence_Widget( rhs ) + { + if ( _label ) + _label = strdup( rhs._label ); + } + public: const char *name ( void ) const { return _label; } diff --git a/Timeline/Sequence_Region.H b/Timeline/Sequence_Region.H index 53ad89a..d5a49ac 100644 --- a/Timeline/Sequence_Region.H +++ b/Timeline/Sequence_Region.H @@ -43,6 +43,11 @@ protected: } + Sequence_Region ( const Sequence_Region &rhs ) : Sequence_Widget( rhs ) + { + + } + public: LOG_NAME_FUNC( Region ); diff --git a/Timeline/Sequence_Widget.H b/Timeline/Sequence_Widget.H index 8d05710..0946dfe 100644 --- a/Timeline/Sequence_Widget.H +++ b/Timeline/Sequence_Widget.H @@ -64,8 +64,6 @@ class Sequence_Widget : public Loggable static Fl_Color _selection_color; - /* can't have this */ - Sequence_Widget ( const Sequence_Widget &rhs ); protected: @@ -82,6 +80,20 @@ protected: virtual void get ( Log_Entry &e ) const; virtual void set ( Log_Entry &e ); + /* careful with this, it doesn't journal */ + Sequence_Widget ( const Sequence_Widget &rhs ) : Loggable( rhs ) + { + _drag = NULL; + + _sequence = rhs._sequence; + + _range = rhs._range; + _r = &_range; + + _color = rhs._color; + _box_color = rhs._box_color; + }; + public: Sequence_Widget ( ) diff --git a/Timeline/Tempo_Point.C b/Timeline/Tempo_Point.C index be9d6ca..a9348a4 100644 --- a/Timeline/Tempo_Point.C +++ b/Timeline/Tempo_Point.C @@ -25,8 +25,9 @@ void Tempo_Point::get ( Log_Entry &e ) const { - Sequence_Point::get( e ); +// Sequence_Point::get( e ); + e.add( ":start", start() ); e.add( ":tempo", _tempo ); } diff --git a/Timeline/Tempo_Point.H b/Timeline/Tempo_Point.H index 556018d..b11dac0 100644 --- a/Timeline/Tempo_Point.H +++ b/Timeline/Tempo_Point.H @@ -55,10 +55,11 @@ public: ~Tempo_Point ( ); - Tempo_Point ( const Tempo_Point &rhs ) + Tempo_Point ( const Tempo_Point &rhs ) : Sequence_Point( rhs ) { - _r->offset = rhs._r->offset; _tempo = rhs._tempo; + + log_create(); } diff --git a/Timeline/Time_Point.C b/Timeline/Time_Point.C index 1fb2629..7686b15 100644 --- a/Timeline/Time_Point.C +++ b/Timeline/Time_Point.C @@ -24,9 +24,9 @@ void Time_Point::get ( Log_Entry &e ) const { +// Sequence_Point::get( e ); - Sequence_Point::get( e ); - + e.add( ":start", start() ); e.add( ":beats_per_bar", _time.beats_per_bar ); e.add( ":beat_type", _time.beat_type ); } @@ -74,8 +74,9 @@ Time_Point::Time_Point ( nframes_t when, int bpb, int note ) : _time( bpb, note log_create(); } -Time_Point::Time_Point ( const Time_Point &rhs ) +Time_Point::Time_Point ( const Time_Point &rhs ) : Sequence_Point( rhs ) { - _r->offset = rhs._r->offset; _time = rhs._time; + + log_create(); }