Browse Source

Clean up sequence widget copy constructors.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
edb9be37ab
15 changed files with 59 additions and 25 deletions
  1. +1
    -1
      Makefile
  2. +2
    -3
      Timeline/Annotation_Point.H
  3. +3
    -4
      Timeline/Annotation_Region.C
  4. +2
    -1
      Timeline/Annotation_Region.H
  5. +2
    -2
      Timeline/Audio_Region.C
  6. +3
    -2
      Timeline/Control_Point.C
  7. +2
    -1
      Timeline/Control_Point.H
  8. +7
    -0
      Timeline/Loggable.H
  9. +2
    -2
      Timeline/Sequence_Point.C
  10. +6
    -0
      Timeline/Sequence_Point.H
  11. +5
    -0
      Timeline/Sequence_Region.H
  12. +14
    -2
      Timeline/Sequence_Widget.H
  13. +2
    -1
      Timeline/Tempo_Point.C
  14. +3
    -2
      Timeline/Tempo_Point.H
  15. +5
    -4
      Timeline/Time_Point.C

+ 1
- 1
Makefile View File

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



+ 2
- 3
Timeline/Annotation_Point.H View File

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


+ 3
- 4
Timeline/Annotation_Region.C View File

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




+ 2
- 1
Timeline/Annotation_Region.H View File

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


+ 2
- 2
Timeline/Audio_Region.C View File

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


+ 3
- 2
Timeline/Control_Point.C View File

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


+ 2
- 1
Timeline/Control_Point.H View File

@@ -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 ( )
{


+ 7
- 0
Timeline/Loggable.H View File

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


+ 2
- 2
Timeline/Sequence_Point.C View File

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


+ 6
- 0
Timeline/Sequence_Point.H View File

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


+ 5
- 0
Timeline/Sequence_Region.H View File

@@ -43,6 +43,11 @@ protected:

}

Sequence_Region ( const Sequence_Region &rhs ) : Sequence_Widget( rhs )
{

}

public:

LOG_NAME_FUNC( Region );


+ 14
- 2
Timeline/Sequence_Widget.H View File

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


+ 2
- 1
Timeline/Tempo_Point.C View File

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



+ 3
- 2
Timeline/Tempo_Point.H View File

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




+ 5
- 4
Timeline/Time_Point.C View File

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

Loading…
Cancel
Save