@@ -74,6 +74,12 @@ public: | |||||
Audio_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track ) | Audio_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track ) | ||||
{ | { | ||||
_track = track; | |||||
if ( track ) | |||||
track->add( this ); | |||||
log_create(); | log_create(); | ||||
} | } | ||||
@@ -20,6 +20,34 @@ | |||||
#include "Control_Sequence.H" | #include "Control_Sequence.H" | ||||
#include "Track.H" | #include "Track.H" | ||||
Control_Sequence::Control_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0 ) | |||||
{ | |||||
init(); | |||||
_track = track; | |||||
if ( track ) | |||||
track->add( this ); | |||||
log_create(); | |||||
} | |||||
Control_Sequence::~Control_Sequence ( ) | |||||
{ | |||||
log_destroy(); | |||||
} | |||||
void | |||||
Control_Sequence::init ( void ) | |||||
{ | |||||
_track = NULL; | |||||
color( fl_darker( FL_GREEN ) ); | |||||
} | |||||
void | void | ||||
Control_Sequence::get ( Log_Entry &e ) | Control_Sequence::get ( Log_Entry &e ) | ||||
{ | { | ||||
@@ -25,32 +25,25 @@ | |||||
class Control_Sequence : public Sequence | class Control_Sequence : public Sequence | ||||
{ | { | ||||
void init ( void ); | |||||
protected: | protected: | ||||
void get ( Log_Entry &e ); | void get ( Log_Entry &e ); | ||||
void set ( Log_Entry &e ); | void set ( Log_Entry &e ); | ||||
Control_Sequence ( ) : Sequence( 0, 0, 1, 1 ) | |||||
Control_Sequence ( ) : Sequence( 0, 0, 0, 1 ) | |||||
{ | { | ||||
init(); | |||||
} | } | ||||
public: | public: | ||||
LOG_CREATE_FUNC( Control_Sequence ); | LOG_CREATE_FUNC( Control_Sequence ); | ||||
Control_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track ) | |||||
{ | |||||
color( fl_darker( FL_GREEN ) ); | |||||
log_create(); | |||||
} | |||||
~Control_Sequence ( ) | |||||
{ | |||||
log_destroy(); | |||||
} | |||||
Control_Sequence ( Track * ); | |||||
~Control_Sequence ( ); | |||||
const char *class_name ( void ) { return "Control_Sequence"; } | const char *class_name ( void ) { return "Control_Sequence"; } | ||||
@@ -380,7 +380,7 @@ Loggable::flush ( void ) | |||||
{ | { | ||||
if ( ! _fp ) | if ( ! _fp ) | ||||
{ | { | ||||
printf( "error: no log file open!\n" ); | |||||
// printf( "error: no log file open!\n" ); | |||||
while ( ! _transaction.empty() ) | while ( ! _transaction.empty() ) | ||||
{ | { | ||||
@@ -109,6 +109,7 @@ protected: | |||||
{ | { | ||||
e.add( ":source", _clip ? _clip->name() : "" ); | e.add( ":source", _clip ? _clip->name() : "" ); | ||||
e.add( ":gain", _scale ); | e.add( ":gain", _scale ); | ||||
e.add( ":color", (int)_box_color ); | |||||
Sequence_Widget::get( e ); | Sequence_Widget::get( e ); | ||||
} | } | ||||
@@ -124,6 +125,8 @@ protected: | |||||
if ( ! strcmp( s, ":gain" ) ) | if ( ! strcmp( s, ":gain" ) ) | ||||
_scale = atof( v ); | _scale = atof( v ); | ||||
if ( ! strcmp( s, ":color" ) ) | |||||
_box_color = (Fl_Color)atoi( v ); | |||||
else if ( ! strcmp( s, ":source" ) ) | else if ( ! strcmp( s, ":source" ) ) | ||||
{ | { | ||||
if ( ! ( _clip = Audio_File::from_file( v ) ) ) | if ( ! ( _clip = Audio_File::from_file( v ) ) ) | ||||
@@ -33,8 +33,8 @@ Sequence::Sequence ( int X, int Y, int W, int H, Track *track ) : Fl_Widget( X, | |||||
_name = NULL; | _name = NULL; | ||||
_track = track; | _track = track; | ||||
if ( track ) | |||||
track->add( this ); | |||||
/* if ( track ) */ | |||||
/* track->add( this ); */ | |||||
box( FL_DOWN_BOX ); | box( FL_DOWN_BOX ); | ||||
color( fl_darker( FL_GRAY ) ); | color( fl_darker( FL_GRAY ) ); | ||||
@@ -303,6 +303,9 @@ void | |||||
Track::remove ( Sequence *t ) | Track::remove ( Sequence *t ) | ||||
{ | { | ||||
takes->remove( t ); | takes->remove( t ); | ||||
resize(); | |||||
// take_menu->remove( t->name() ); | // take_menu->remove( t->name() ); | ||||
} | } | ||||
@@ -310,6 +313,8 @@ void | |||||
Track::remove ( Control_Sequence *t ) | Track::remove ( Control_Sequence *t ) | ||||
{ | { | ||||
control->remove( t ); | control->remove( t ); | ||||
resize(); | |||||
} | } | ||||
void | void | ||||
@@ -329,6 +334,8 @@ Track::track ( Sequence * t ) | |||||
void | void | ||||
Track::add ( Control_Sequence *t ) | Track::add ( Control_Sequence *t ) | ||||
{ | { | ||||
printf( "adding control sequence\n" ); | |||||
t->track( this ); | t->track( this ); | ||||
control->add( t ); | control->add( t ); | ||||
@@ -119,7 +119,8 @@ public: | |||||
{ | { | ||||
size( atoi( v ) ); | size( atoi( v ) ); | ||||
Fl_Widget::size( w(), height() ); | |||||
// Fl_Widget::size( w(), height() ); | |||||
resize(); | |||||
} | } | ||||
else if ( ! strcmp( s, ":s" ) ) | else if ( ! strcmp( s, ":s" ) ) | ||||
_selected = atoi( v ); | _selected = atoi( v ); | ||||