indicate port-connections of non-track type
authorRobin Gareus <robin@gareus.org>
Thu, 2 Jul 2015 08:02:28 +0000 (10:02 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 2 Jul 2015 08:03:21 +0000 (10:03 +0200)
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

index a011d2e9b35666922ecb85309d726c8160291a93..661d1f6db99e10c1dd7082103bcab9db0bdc117f 100644 (file)
@@ -1179,6 +1179,7 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> 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<ARDOUR::Route> 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<MidiTrack>(route) != 0 )
+       if ( boost::dynamic_pointer_cast<MidiTrack>(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<ARDOUR::Route> 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<ARDOUR::Route> route, Width widt
                        // Odd configuration
                        label << "*" << total_connection_count << "*";
                }
+               if (typed_connection_count > 0) {
+                       label << "\u2295"; // circled plus
+               }
        }
 
        if (for_input) {