Browse Source

Work on restorability of tracks.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
543d9e4432
8 changed files with 55 additions and 17 deletions
  1. +6
    -0
      Timeline/Audio_Sequence.H
  2. +28
    -0
      Timeline/Control_Sequence.C
  3. +6
    -13
      Timeline/Control_Sequence.H
  4. +1
    -1
      Timeline/Loggable.C
  5. +3
    -0
      Timeline/Region.H
  6. +2
    -2
      Timeline/Sequence.C
  7. +7
    -0
      Timeline/Track.C
  8. +2
    -1
      Timeline/Track.H

+ 6
- 0
Timeline/Audio_Sequence.H 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();
}



+ 28
- 0
Timeline/Control_Sequence.C 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 )
{


+ 6
- 13
Timeline/Control_Sequence.H 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"; }



+ 1
- 1
Timeline/Loggable.C 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() )
{


+ 3
- 0
Timeline/Region.H 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 ) ) )


+ 2
- 2
Timeline/Sequence.C 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 ) );


+ 7
- 0
Timeline/Track.C 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 );


+ 2
- 1
Timeline/Track.H 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 );


Loading…
Cancel
Save