Browse Source

Minor cleanup.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
424b68f044
2 changed files with 30 additions and 23 deletions
  1. +10
    -2
      Timeline/Disk_Stream.C
  2. +20
    -21
      Timeline/Track_Header.H

+ 10
- 2
Timeline/Disk_Stream.C View File

@@ -28,7 +28,7 @@
/**********/ /**********/


/* A Disk_Stream uses a separate I/O thread to stream a track's /* 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 thread (or vice-versa). The I/O thread syncronizes access with the
user thread via the Timeline mutex. The size of the buffer (in user thread via the Timeline mutex. The size of the buffer (in
seconds) must be set before any Disk_Stream objects are created; seconds) must be set before any Disk_Stream objects are created;
@@ -38,7 +38,15 @@
/* FIXME: handle termination of IO thread in destructor */ /* FIXME: handle termination of IO thread in destructor */
/* FIXME: deal with (jack) buffer size changes */ /* FIXME: deal with (jack) buffer size changes */
/* FIXME: needs error handling everywhere! */ /* 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; float Disk_Stream::seconds_to_buffer = 5.0f;
// size_t Disk_Stream::disk_block_frames = 2048; // size_t Disk_Stream::disk_block_frames = 2048;


+ 20
- 21
Timeline/Track_Header.H View File

@@ -100,26 +100,24 @@ public:


Fl_Widget::size( w(), height() ); 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 ); free( s );
@@ -131,14 +129,15 @@ public:


char ** get ( void ) char ** get ( void )
{ {
char **sa = (char**)malloc( sizeof( char* ) * (1 + 4) );
char **sa = (char**)malloc( sizeof( char* ) * (1 + 5) );


int i = 0; int i = 0;


asprintf( &sa[ i++ ], ":name \"%s\"", _name ? _name : "" ); asprintf( &sa[ i++ ], ":name \"%s\"", _name ? _name : "" );
asprintf( &sa[ i++ ], ":track 0x%X", track() ? track()->id() : 0 ); asprintf( &sa[ i++ ], ":track 0x%X", track() ? track()->id() : 0 );
asprintf( &sa[ i++ ], ":selected %d", _selected ); 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++ ], ":solo %d", solo_button->value() ); */
/* asprintf( &sa[ i++ ], ":mute %d", mute_button->value() ); */ /* asprintf( &sa[ i++ ], ":mute %d", mute_button->value() ); */
asprintf( &sa[ i++ ], ":h %d", size() ); asprintf( &sa[ i++ ], ":h %d", size() );
@@ -203,7 +202,7 @@ public:
const char * name ( void ) const { return _name; } const char * name ( void ) const { return _name; }
bool mute ( void ) const { return mute_button->value(); } bool mute ( void ) const { return mute_button->value(); }
bool solo ( void ) const { return solo_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; } bool selected ( void ) const { return _selected; }


static void cb_input_field ( Fl_Widget *w, void *v ); static void cb_input_field ( Fl_Widget *w, void *v );


Loading…
Cancel
Save