Work on restorability of tracks.

pull/3/head
Jonathan Moore Liles 2008-04-20 22:05:25 -05:00
parent 4160721c65
commit 543d9e4432
8 changed files with 55 additions and 17 deletions

View File

@ -74,6 +74,12 @@ public:
Audio_Sequence ( Track *track ) : Sequence( 0, 0, 0, 0, track )
{
_track = track;
if ( track )
track->add( this );
log_create();
}

View File

@ -20,6 +20,34 @@
#include "Control_Sequence.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
Control_Sequence::get ( Log_Entry &e )
{

View File

@ -25,32 +25,25 @@
class Control_Sequence : public Sequence
{
void init ( void );
protected:
void get ( Log_Entry &e );
void set ( Log_Entry &e );
Control_Sequence ( ) : Sequence( 0, 0, 1, 1 )
Control_Sequence ( ) : Sequence( 0, 0, 0, 1 )
{
init();
}
public:
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"; }

View File

@ -380,7 +380,7 @@ Loggable::flush ( void )
{
if ( ! _fp )
{
printf( "error: no log file open!\n" );
// printf( "error: no log file open!\n" );
while ( ! _transaction.empty() )
{

View File

@ -109,6 +109,7 @@ protected:
{
e.add( ":source", _clip ? _clip->name() : "" );
e.add( ":gain", _scale );
e.add( ":color", (int)_box_color );
Sequence_Widget::get( e );
}
@ -124,6 +125,8 @@ protected:
if ( ! strcmp( s, ":gain" ) )
_scale = atof( v );
if ( ! strcmp( s, ":color" ) )
_box_color = (Fl_Color)atoi( v );
else if ( ! strcmp( s, ":source" ) )
{
if ( ! ( _clip = Audio_File::from_file( v ) ) )

View File

@ -33,8 +33,8 @@ Sequence::Sequence ( int X, int Y, int W, int H, Track *track ) : Fl_Widget( X,
_name = NULL;
_track = track;
if ( track )
track->add( this );
/* if ( track ) */
/* track->add( this ); */
box( FL_DOWN_BOX );
color( fl_darker( FL_GRAY ) );

View File

@ -303,6 +303,9 @@ void
Track::remove ( Sequence *t )
{
takes->remove( t );
resize();
// take_menu->remove( t->name() );
}
@ -310,6 +313,8 @@ void
Track::remove ( Control_Sequence *t )
{
control->remove( t );
resize();
}
void
@ -329,6 +334,8 @@ Track::track ( Sequence * t )
void
Track::add ( Control_Sequence *t )
{
printf( "adding control sequence\n" );
t->track( this );
control->add( t );

View File

@ -119,7 +119,8 @@ public:
{
size( atoi( v ) );
Fl_Widget::size( w(), height() );
// Fl_Widget::size( w(), height() );
resize();
}
else if ( ! strcmp( s, ":s" ) )
_selected = atoi( v );