From a958276b064e973c92d38d3aaa8e884e26494ed4 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 26 Jun 2013 23:03:17 -0700 Subject: [PATCH] Timeline: Mark ports as Terminal. --- nonlib/JACK/Port.C | 7 ++++++- nonlib/JACK/Port.H | 2 ++ timeline/src/Control_Sequence.C | 1 + timeline/src/Engine/Track.C | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nonlib/JACK/Port.C b/nonlib/JACK/Port.C index a3afc1b..169b0fc 100644 --- a/nonlib/JACK/Port.C +++ b/nonlib/JACK/Port.C @@ -39,6 +39,7 @@ namespace JACK Port::Port ( const Port &rhs ) { + _terminal = rhs._terminal; _freezer = rhs._freezer; _client = rhs._client; _port = rhs._port; @@ -52,6 +53,7 @@ namespace JACK /* nframes is the number of frames to buffer */ Port::Port ( JACK::Client *client, jack_port_t *port ) { + _terminal = 0; _freezer = NULL; _client = client; _port = port; @@ -66,6 +68,7 @@ namespace JACK Port::Port ( JACK::Client *client, const char *name, direction_e dir, type_e type ) { + _terminal = 0; _name = NULL; _freezer = NULL; _client = client; @@ -77,6 +80,7 @@ namespace JACK Port::Port ( JACK::Client *client, direction_e dir, type_e type, const char *base, int n, const char *subtype ) { + _terminal = 0; _name = NULL; _freezer = NULL; _client = client; @@ -88,6 +92,7 @@ namespace JACK Port::Port ( JACK::Client *client, direction_e dir, type_e type, int n, const char *subtype ) { + _terminal = 0; _name = NULL; _freezer = NULL; _client = client; @@ -166,7 +171,7 @@ namespace JACK { _port = jack_port_register( _client->jack_client(), _name, _type == Audio ? JACK_DEFAULT_AUDIO_TYPE : JACK_DEFAULT_MIDI_TYPE, - _direction == Output ? JackPortIsOutput : JackPortIsInput, + _direction == Output ? JackPortIsOutput : JackPortIsInput | _terminal ? JackPortIsTerminal : 0, 0 ); if ( ! _port ) diff --git a/nonlib/JACK/Port.H b/nonlib/JACK/Port.H index 5de49e8..c137de9 100644 --- a/nonlib/JACK/Port.H +++ b/nonlib/JACK/Port.H @@ -69,6 +69,7 @@ namespace JACK nframes_t latency ( void ) const; void latency ( nframes_t frames ); + void terminal ( bool b ) { _terminal = b; } bool activate ( void ); void shutdown ( void ); void write ( sample_t *buf, nframes_t nframes ); @@ -89,6 +90,7 @@ namespace JACK direction_e _direction; type_e _type; + bool _terminal; bool activate ( const char *name, direction_e dir ); diff --git a/timeline/src/Control_Sequence.C b/timeline/src/Control_Sequence.C index 560b629..e71206a 100644 --- a/timeline/src/Control_Sequence.C +++ b/timeline/src/Control_Sequence.C @@ -172,6 +172,7 @@ Control_Sequence::update_port_name ( void ) if ( ! _output ) { _output = new JACK::Port( engine, JACK::Port::Output, JACK::Port::Audio, track()->name(), track()->ncontrols(), "cv" ); + _output->terminal( true ); needs_activation = true; } diff --git a/timeline/src/Engine/Track.C b/timeline/src/Engine/Track.C index d4ec167..45217ff 100644 --- a/timeline/src/Engine/Track.C +++ b/timeline/src/Engine/Track.C @@ -88,6 +88,8 @@ Track::configure_outputs ( int n ) { JACK::Port p( engine, JACK::Port::Output, JACK::Port::Audio, name(), i ); + p.terminal(true); + if ( !p.activate() ) { FATAL( "could not created output port!"); @@ -140,6 +142,8 @@ Track::configure_inputs ( int n ) for ( int i = on; i < n; ++i ) { JACK::Port p( engine, JACK::Port::Input, JACK::Port::Audio, name(), i ); + + p.terminal( true ); if ( !p.activate() ) {