Browse Source

Fig logging for captures.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
6b97c912eb
5 changed files with 33 additions and 2 deletions
  1. +9
    -0
      Timeline/Loggable.C
  2. +17
    -0
      Timeline/Region.C
  3. +2
    -0
      Timeline/Region.H
  4. +4
    -0
      Timeline/Timeline.C
  5. +1
    -2
      Timeline/Track.C

+ 9
- 0
Timeline/Loggable.C View File

@@ -538,6 +538,15 @@ void
Loggable::log_create ( void ) const Loggable::log_create ( void ) const
{ {
// indent(); // indent();

/* if ( Loggable::_level ) */
/* { */
/* /\* defer until the block ends--this is really only required for capturing... *\/ */



/* } */

log( "%s 0x%X create ", class_name(), _id ); log( "%s 0x%X create ", class_name(), _id );


char **sa; char **sa;


+ 17
- 0
Timeline/Region.C View File

@@ -232,6 +232,10 @@ Region::handle ( int m )
static bool copied = false; static bool copied = false;
static nframes_t os; static nframes_t os;



if ( ! active_r() )
return 0;

// int X = Fl::event_x() - _track->x(); // int X = Fl::event_x() - _track->x();
int X = Fl::event_x(); int X = Fl::event_x();
int Y = Fl::event_y(); int Y = Fl::event_y();
@@ -543,6 +547,7 @@ Region::draw_fade ( const Fade &fade, Fade::fade_dir_e dir, bool line, int X, in
fl_pop_matrix(); fl_pop_matrix();
} }



void void
Region::draw_box( void ) Region::draw_box( void )
{ {
@@ -553,6 +558,7 @@ Region::draw_box( void )
Fl_Color selection_color = _selection_color; Fl_Color selection_color = _selection_color;
Fl_Color color = _box_color; Fl_Color color = _box_color;



if ( this == ((Audio_Sequence*)track())->capture() ) if ( this == ((Audio_Sequence*)track())->capture() )
{ {
color = FL_RED; color = FL_RED;
@@ -954,11 +960,22 @@ Region::write ( sample_t *buf, nframes_t nframes )
return l; return l;
} }



/** prepare for capturing */
void
Region::prepare ( void )
{
log_start();
}


/** finalize region capture. Assumes that this *is* a captured region /** finalize region capture. Assumes that this *is* a captured region
and that no other regions refer to the same source */ and that no other regions refer to the same source */
bool bool
Region::finalize ( void ) Region::finalize ( void )
{ {
log_end();

_clip->close(); _clip->close();
_clip->open(); _clip->open();




+ 2
- 0
Timeline/Region.H View File

@@ -198,9 +198,11 @@ public:


void normalize ( void ); void normalize ( void );



/* Engine */ /* Engine */
nframes_t read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) const; nframes_t read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) const;
nframes_t write ( sample_t *buf, nframes_t nframes ); nframes_t write ( sample_t *buf, nframes_t nframes );
void prepare ( void );
bool finalize ( void ); bool finalize ( void );


}; };

+ 4
- 0
Timeline/Timeline.C View File

@@ -933,6 +933,8 @@ Timeline::remove_track ( Track *track )
bool bool
Timeline::record ( void ) Timeline::record ( void )
{ {
Loggable::block_start();

for ( int i = tracks->children(); i-- ; ) for ( int i = tracks->children(); i-- ; )
{ {
Track *t = (Track*)tracks->child( i ); Track *t = (Track*)tracks->child( i );
@@ -958,6 +960,8 @@ Timeline::stop ( void )
t->record_ds->stop( transport->frame ); t->record_ds->stop( transport->frame );
} }


Loggable::block_end();

activate(); activate();
} }




+ 1
- 2
Timeline/Track.C View File

@@ -635,8 +635,7 @@ Track::record ( nframes_t frame )


_capture = new Region( af, track(), frame ); _capture = new Region( af, track(), frame );


/* FIXME: wrong place for this */
_capture->_r->end = 0;
_capture->prepare();
} }


/* THREAD: IO */ /* THREAD: IO */


Loading…
Cancel
Save