From 71595234bcac7927c5bf3e5006a60627d19c60f8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 2 Jul 2015 10:02:28 +0200 Subject: [PATCH] indicate port-connections of non-track type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously a Midi-track with synth showed “-“ for the output even if the audio output ports were connected. (only MIDI connections are displayed on the button). --- gtk2_ardour/mixer_strip.cc | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index a011d2e9b3..661d1f6db9 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1179,6 +1179,7 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt uint32_t ardour_connection_count = 0; uint32_t system_connection_count = 0; uint32_t other_connection_count = 0; + uint32_t typed_connection_count = 0; ostringstream label; @@ -1196,8 +1197,12 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt //to avoid confusion, the button caption should only show connections that match the datatype of the track DataType dt = DataType::AUDIO; - if ( boost::dynamic_pointer_cast(route) != 0 ) + if ( boost::dynamic_pointer_cast(route) != 0 ) { dt = DataType::MIDI; + // avoid further confusion with Midi-tracks that have a synth. + // Audio-ports may be connected, but button says "Disconnected" + tooltip << _("MIDI "); + } if (for_input) { io_count = route->n_inputs().n_total(); @@ -1215,12 +1220,17 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt port = route->output()->nth (io_index); } - //ignore any port connections that don't match our DataType - if (port->type() != dt) - continue; - port_connections.clear (); port->get_connections(port_connections); + + //ignore any port connections that don't match our DataType + if (port->type() != dt) { + if (!port_connections.empty()) { + ++typed_connection_count; + } + continue; + } + io_connection_count = 0; if (!port_connections.empty()) { @@ -1360,6 +1370,9 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt // Odd configuration label << "*" << total_connection_count << "*"; } + if (typed_connection_count > 0) { + label << "\u2295"; // circled plus + } } if (for_input) {