diff --git a/Timeline/Engine.C b/Timeline/Engine.C index 365ad6a..6c48a72 100644 --- a/Timeline/Engine.C +++ b/Timeline/Engine.C @@ -127,10 +127,6 @@ Engine::process ( nframes_t nframes ) { transport->poll(); - if ( ! transport->rolling ) - /* FIXME: fill all ports with silence */ - return 0; - if ( ! trylock() ) { /* the data structures we need to access here (tracks and @@ -141,6 +137,11 @@ Engine::process ( nframes_t nframes ) return 0; } +/* if ( ! transport->rolling ) */ +/* timeline->silence( nframes ); */ +/* return 0; */ + + /* handle chicken/egg problem */ if ( timeline ) /* this will initiate the process() call graph for the various diff --git a/Timeline/Port.C b/Timeline/Port.C index 93b9b9a..f73397b 100644 --- a/Timeline/Port.C +++ b/Timeline/Port.C @@ -122,3 +122,9 @@ Port::buffer ( nframes_t nframes ) { return jack_port_get_buffer( _port, nframes ); } + +void +Port::silence ( nframes_t nframes ) +{ + memset( buffer( nframes ), 0, nframes * sizeof( sample_t ) ); +} diff --git a/Timeline/Port.H b/Timeline/Port.H index 31519a9..d988f60 100644 --- a/Timeline/Port.H +++ b/Timeline/Port.H @@ -62,5 +62,5 @@ public: void write ( sample_t *buf, nframes_t nframes ); void read ( sample_t *buf, nframes_t nframes ); void *buffer ( nframes_t nframes ); - + void silence ( nframes_t nframes ); }; diff --git a/Timeline/Track.C b/Timeline/Track.C index 4c0e70b..95bc66e 100644 --- a/Timeline/Track.C +++ b/Timeline/Track.C @@ -645,6 +645,22 @@ Track::configure_inputs ( int n ) nframes_t Track::process ( nframes_t nframes ) { + + if ( ! transport->rolling ) + { + for ( int i = output.size(); i--; ) + output[ i ].silence( nframes ); + + for ( int i = input.size(); i--; ) + input[ i ].silence( nframes ); + + /* FIXME: is this really the right thing to do for control ports? */ + for ( int i = control_out.size(); i--; ) + control_out[ i ]->silence( nframes ); + + return 0; + } + for ( int i = control->children(); i--; ) ((Control_Sequence*)control->child( i ))->process( nframes );