Browse Source

Output silence when stopped.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
7793863d46
4 changed files with 28 additions and 5 deletions
  1. +5
    -4
      Timeline/Engine.C
  2. +6
    -0
      Timeline/Port.C
  3. +1
    -1
      Timeline/Port.H
  4. +16
    -0
      Timeline/Track.C

+ 5
- 4
Timeline/Engine.C View File

@@ -127,10 +127,6 @@ Engine::process ( nframes_t nframes )
{ {
transport->poll(); transport->poll();


if ( ! transport->rolling )
/* FIXME: fill all ports with silence */
return 0;

if ( ! trylock() ) if ( ! trylock() )
{ {
/* the data structures we need to access here (tracks and /* the data structures we need to access here (tracks and
@@ -141,6 +137,11 @@ Engine::process ( nframes_t nframes )
return 0; return 0;
} }


/* if ( ! transport->rolling ) */
/* timeline->silence( nframes ); */
/* return 0; */


/* handle chicken/egg problem */ /* handle chicken/egg problem */
if ( timeline ) if ( timeline )
/* this will initiate the process() call graph for the various /* this will initiate the process() call graph for the various


+ 6
- 0
Timeline/Port.C View File

@@ -122,3 +122,9 @@ Port::buffer ( nframes_t nframes )
{ {
return jack_port_get_buffer( _port, nframes ); return jack_port_get_buffer( _port, nframes );
} }

void
Port::silence ( nframes_t nframes )
{
memset( buffer( nframes ), 0, nframes * sizeof( sample_t ) );
}

+ 1
- 1
Timeline/Port.H View File

@@ -62,5 +62,5 @@ public:
void write ( sample_t *buf, nframes_t nframes ); void write ( sample_t *buf, nframes_t nframes );
void read ( sample_t *buf, nframes_t nframes ); void read ( sample_t *buf, nframes_t nframes );
void *buffer ( nframes_t nframes ); void *buffer ( nframes_t nframes );
void silence ( nframes_t nframes );
}; };

+ 16
- 0
Timeline/Track.C View File

@@ -645,6 +645,22 @@ Track::configure_inputs ( int n )
nframes_t nframes_t
Track::process ( nframes_t nframes ) 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--; ) for ( int i = control->children(); i--; )
((Control_Sequence*)control->child( i ))->process( nframes ); ((Control_Sequence*)control->child( i ))->process( nframes );




Loading…
Cancel
Save