From 424b68f044b5b43a462a874bdae6d7d26ab0fb32 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 15 Apr 2008 19:08:48 -0500 Subject: [PATCH] Minor cleanup. --- Timeline/Disk_Stream.C | 12 ++++++++++-- Timeline/Track_Header.H | 41 ++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Timeline/Disk_Stream.C b/Timeline/Disk_Stream.C index 167c758..e66713e 100644 --- a/Timeline/Disk_Stream.C +++ b/Timeline/Disk_Stream.C @@ -28,7 +28,7 @@ /**********/ /* A Disk_Stream uses a separate I/O thread to stream a track's - regions from disk into a ringbuffer, to be processed by the RT + regions from disk into a ringbuffer to be processed by the RT thread (or vice-versa). The I/O thread syncronizes access with the user thread via the Timeline mutex. The size of the buffer (in seconds) must be set before any Disk_Stream objects are created; @@ -38,7 +38,15 @@ /* FIXME: handle termination of IO thread in destructor */ /* FIXME: deal with (jack) buffer size changes */ /* FIXME: needs error handling everywhere! */ -/* TODO: handle capture too */ +/* TODO: handle capture too. For this to work with some kind of + * punch-in/out system, I believe we'll have to always keep at least + * one buffer's worth of input. We would need this anyway in order to + * pass input through to output (software monitoring). What about + * looped recording? */ +/* TODO: latency compensation? Does this really apply to us? (we're + * not hosting plugins here) */ +/* TODO: read/write data from/to disk in larger chunks to avoid + * excessive seeking. 256k is supposedly the sweetspot. */ float Disk_Stream::seconds_to_buffer = 5.0f; // size_t Disk_Stream::disk_block_frames = 2048; diff --git a/Timeline/Track_Header.H b/Timeline/Track_Header.H index d7640e2..b58d512 100644 --- a/Timeline/Track_Header.H +++ b/Timeline/Track_Header.H @@ -100,26 +100,24 @@ public: Fl_Widget::size( w(), height() ); } - else - if ( ! strcmp( s, ":selected" ) ) - _selected = atoi( v ); - else - if ( ! strcmp( s, ":name" ) ) - { - _name = strdup( v ); - name_field->value( _name ); - } - else - if ( ! strcmp( s, ":track" ) ) - { - int i; - sscanf( v, "%X", &i ); - Track *t = (Track*)Loggable::find( i ); + else if ( ! strcmp( s, ":selected" ) ) + _selected = atoi( v ); +// else if ( ! strcmp( s, ":armed" + else if ( ! strcmp( s, ":name" ) ) + { + _name = strdup( v ); + name_field->value( _name ); + } + else if ( ! strcmp( s, ":track" ) ) + { + int i; + sscanf( v, "%X", &i ); + Track *t = (Track*)Loggable::find( i ); - assert( t ); + assert( t ); - track( t ); - } + track( t ); + } free( s ); @@ -131,14 +129,15 @@ public: char ** get ( void ) { - char **sa = (char**)malloc( sizeof( char* ) * (1 + 4) ); + char **sa = (char**)malloc( sizeof( char* ) * (1 + 5) ); int i = 0; asprintf( &sa[ i++ ], ":name \"%s\"", _name ? _name : "" ); asprintf( &sa[ i++ ], ":track 0x%X", track() ? track()->id() : 0 ); asprintf( &sa[ i++ ], ":selected %d", _selected ); -/* asprintf( &sa[ i++ ], ":record %d", record_button->value() ); */ +// asprintf( &sa[ i++ ], ":record %d", record_button->value() ); + /* asprintf( &sa[ i++ ], ":solo %d", solo_button->value() ); */ /* asprintf( &sa[ i++ ], ":mute %d", mute_button->value() ); */ asprintf( &sa[ i++ ], ":h %d", size() ); @@ -203,7 +202,7 @@ public: const char * name ( void ) const { return _name; } bool mute ( void ) const { return mute_button->value(); } bool solo ( void ) const { return solo_button->value(); } - bool arm ( void ) const { return record_button->value(); } + bool armed ( void ) const { return record_button->value(); } bool selected ( void ) const { return _selected; } static void cb_input_field ( Fl_Widget *w, void *v );