From a57db305f2a9bd30e5b27c0a21a631b084de538a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 7 May 2008 11:18:57 -0500 Subject: [PATCH] Symbol name cleanup. --- Timeline/Audio_Sequence.C | 2 +- Timeline/Disk_Stream.C | 16 +++++++++++----- Timeline/Disk_Stream.H | 5 +++-- Timeline/Playback_DS.C | 8 ++++---- Timeline/Record_DS.C | 10 +++++----- Timeline/Timeline.C | 2 +- Timeline/Track.C | 22 +++++++++++----------- Timeline/Track.H | 10 +++++----- 8 files changed, 41 insertions(+), 34 deletions(-) diff --git a/Timeline/Audio_Sequence.C b/Timeline/Audio_Sequence.C index f1adc05..7b9a7e5 100644 --- a/Timeline/Audio_Sequence.C +++ b/Timeline/Audio_Sequence.C @@ -78,7 +78,7 @@ Audio_Sequence::set ( Log_Entry &e ) assert( t ); - t->track( this ); + t->sequence( this ); } else if ( ! strcmp( ":name", s ) ) name( v ); diff --git a/Timeline/Disk_Stream.C b/Timeline/Disk_Stream.C index f1ed375..e694947 100644 --- a/Timeline/Disk_Stream.C +++ b/Timeline/Disk_Stream.C @@ -50,7 +50,7 @@ float Disk_Stream::seconds_to_buffer = 2.0f; counts.*/ size_t Disk_Stream::disk_io_kbytes = 256; -Disk_Stream::Disk_Stream ( Track *th, float frame_rate, nframes_t nframes, int channels ) : _th( th ) +Disk_Stream::Disk_Stream ( Track *track, float frame_rate, nframes_t nframes, int channels ) : _track( track ) { assert( channels ); @@ -83,7 +83,7 @@ Disk_Stream::~Disk_Stream ( ) /* it isn't safe to do all this with the RT thread running */ engine->lock(); - _th = NULL; + _track = NULL; sem_destroy( &_blocks ); @@ -148,10 +148,16 @@ Disk_Stream::shutdown ( void ) _terminate = false; } -Audio_Sequence * -Disk_Stream::track ( void ) +Track * +Disk_Stream::track ( void ) const { - return (Audio_Sequence*)_th->track(); + return _track; +} + +Audio_Sequence * +Disk_Stream::sequence ( void ) const +{ + return (Audio_Sequence*)_track->sequence(); } /** start Disk_Stream thread */ diff --git a/Timeline/Disk_Stream.H b/Timeline/Disk_Stream.H index 5532990..f528187 100644 --- a/Timeline/Disk_Stream.H +++ b/Timeline/Disk_Stream.H @@ -42,7 +42,7 @@ protected: pthread_t _thread; /* io thread */ - Track *_th; /* Track we belong to */ + Track *_track; /* Track we belong to */ nframes_t _nframes; /* buffer size */ @@ -62,7 +62,8 @@ protected: int channels ( void ) const { return _rb.size(); } - Audio_Sequence * track ( void ); + Audio_Sequence * sequence ( void ) const; + Track * track ( void ) const; static void *disk_thread ( void *arg ); diff --git a/Timeline/Playback_DS.C b/Timeline/Playback_DS.C index d41f152..b9c4115 100644 --- a/Timeline/Playback_DS.C +++ b/Timeline/Playback_DS.C @@ -71,7 +71,7 @@ Playback_DS::read_block ( sample_t *buf, nframes_t nframes ) // printf( "IO: attempting to read block @ %lu\n", _frame ); - if ( ! track() ) + if ( ! sequence() ) { // _frame += _nframes; return; @@ -79,7 +79,7 @@ Playback_DS::read_block ( sample_t *buf, nframes_t nframes ) timeline->rdlock(); - if ( track()->play( buf, _frame, nframes, channels() ) ) + if ( sequence()->play( buf, _frame, nframes, channels() ) ) _frame += nframes; else /* error */; @@ -213,7 +213,7 @@ Playback_DS::process ( nframes_t nframes ) for ( int i = channels(); i--; ) { - void *buf = _th->output[ i ].buffer( nframes ); + void *buf = track()->output[ i ].buffer( nframes ); if ( jack_ringbuffer_read( _rb[ i ], (char*)buf, block_size ) < block_size ) { @@ -223,7 +223,7 @@ Playback_DS::process ( nframes_t nframes ) } /* TODO: figure out a way to stop IO while muted without losing sync */ - if ( _th->mute() || ( Track::soloing() && ! _th->solo() ) ) + if ( track()->mute() || ( Track::soloing() && ! track()->solo() ) ) buffer_fill_with_silence( (sample_t*)buf, nframes ); } diff --git a/Timeline/Record_DS.C b/Timeline/Record_DS.C index 8f1777e..c073623 100644 --- a/Timeline/Record_DS.C +++ b/Timeline/Record_DS.C @@ -38,12 +38,12 @@ Record_DS::write_block ( sample_t *buf, nframes_t nframes ) { /* stupid chicken/egg */ - if ( ! ( timeline && track() ) ) + if ( ! ( timeline && sequence() ) ) return; // timeline->wrlock(); - _th->write( buf, nframes ); + track()->write( buf, nframes ); _frames_written += nframes; @@ -201,7 +201,7 @@ Record_DS::start ( nframes_t frame ) _frame = frame; - _th->record( frame ); + track()->record( frame ); run(); @@ -231,7 +231,7 @@ Record_DS::stop ( nframes_t frame ) /* FIXME: flush buffers here? */ - _th->stop( frame ); + track()->stop( frame ); DMESSAGE( "recording finished" ); } @@ -252,7 +252,7 @@ Record_DS::process ( nframes_t nframes ) for ( int i = channels(); i--; ) { - void *buf = _th->input[ i ].buffer( nframes ); + void *buf = track()->input[ i ].buffer( nframes ); if ( jack_ringbuffer_write( _rb[ i ], (char*)buf, block_size ) < block_size ) { diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index c677b9c..62b5da8 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -929,7 +929,7 @@ Timeline::handle ( int m ) add_track( t ); - t->track( o ); + t->sequence( o ); Loggable::block_end(); } diff --git a/Timeline/Track.C b/Timeline/Track.C index 69b1bc5..28fad99 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -93,7 +93,7 @@ Track::cb_button ( Fl_Widget *w ) show_all_takes( take_menu->menu()[ v ].value() ); return; case 1: /* new */ - track( (Audio_Sequence*)track()->clone_empty() ); + sequence( (Audio_Sequence*)sequence()->clone_empty() ); return; } @@ -104,7 +104,7 @@ Track::cb_button ( Fl_Widget *w ) Audio_Sequence *t = (Audio_Sequence*)takes->child( i ); if ( ! strcmp( s, t->name() ) ) { - track( t ); + sequence( t ); redraw(); break; } @@ -116,7 +116,7 @@ void Track::init ( void ) { _capture = NULL; - _track = NULL; + _sequence = NULL; _name = NULL; _selected = false; _show_all_takes = false; @@ -312,8 +312,8 @@ Track::resize ( void ) Fl_Group::size( w(), h() + ( ( 24 ) * pack_visible( annotation ) ) ); - if ( track() ) - track()->size( w(), height() ); + if ( sequence() ) + sequence()->size( w(), height() ); if ( controls->y() + controls->h() > y() + h() ) @@ -373,14 +373,14 @@ Track::remove ( Control_Sequence *t ) } void -Track::track ( Audio_Sequence * t ) +Track::sequence ( Audio_Sequence * t ) { t->track( this ); - if ( track() ) - add( track() ); + if ( sequence() ) + add( sequence() ); - _track = t; + _sequence = t; pack->insert( *t, 1 ); t->labeltype( FL_NO_LABEL ); @@ -423,7 +423,7 @@ Track::select ( int X, int Y, int W, int H, bool include_control, bool merge_control ) { - Sequence *t = track(); + Sequence *t = sequence(); if ( ! ( t->y() > Y + H || t->y() + t->h() < Y ) ) t->select_range( X, W ); @@ -786,7 +786,7 @@ Track::record ( nframes_t frame ) /* open it again for reading in the GUI thread */ Audio_File *af = Audio_File::from_file( _capture_af->name() ); - _capture = new Audio_Region( af, track(), frame ); + _capture = new Audio_Region( af, sequence(), frame ); _capture->prepare(); } diff --git a/Timeline/Track.H b/Timeline/Track.H index 040f48a..a664e88 100644 --- a/Timeline/Track.H +++ b/Timeline/Track.H @@ -79,7 +79,7 @@ private: enum { AUDIO } _type; - Audio_Sequence *_track; + Audio_Sequence *_sequence; Audio_Region *_capture; /* capture region */ Audio_File *_capture_af; /* capture write source */ @@ -171,7 +171,7 @@ public: { // assert( t ); - track( t ); + sequence( t ); } } @@ -185,7 +185,7 @@ public: virtual void get ( Log_Entry &e ) const { e.add( ":name", _name ); - e.add( ":sequence", track() ); + e.add( ":sequence", sequence() ); e.add( ":selected", _selected ); e.add( ":height", size() ); e.add( ":inputs", input.size() ); @@ -251,8 +251,8 @@ public: static int width ( void ) { return 150; } - void track ( Audio_Sequence * t ); - Audio_Sequence * track ( void ) const { return _track; } + void sequence ( Audio_Sequence * t ); + Audio_Sequence * sequence ( void ) const { return _sequence; } void draw ( void ); int handle ( int m );