From 35b4cb91d21f8e45e49d2e629f6df818cb9742c6 Mon Sep 17 00:00:00 2001 From: "Julien \"_FrnchFrgg_\" RIVAUD" Date: Thu, 7 Jul 2016 19:12:23 +0200 Subject: [PATCH] update_io_button: store input() or output() in a variable This avoids repeating "if (for_input)" checks. --- gtk2_ardour/mixer_strip.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 77b203e7fb..f8386e7706 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -38,6 +38,7 @@ #include "ardour/audio_track.h" #include "ardour/audioengine.h" #include "ardour/internal_send.h" +#include "ardour/io.h" #include "ardour/meter.h" #include "ardour/midi_track.h" #include "ardour/pannable.h" @@ -1209,6 +1210,7 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt { uint32_t io_count; uint32_t io_index; + boost::shared_ptr io; boost::shared_ptr port; vector port_connections; @@ -1243,20 +1245,17 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt } if (for_input) { - io_count = route->n_inputs().n_total(); + io = route->input(); tooltip << string_compose (_("INPUT to %1"), Gtkmm2ext::markup_escape_text (route->name())); } else { - io_count = route->n_outputs().n_total(); + io = route->output(); tooltip << string_compose (_("OUTPUT from %1"), Gtkmm2ext::markup_escape_text (route->name())); } + io_count = io->n_ports().n_total(); for (io_index = 0; io_index < io_count; ++io_index) { - if (for_input) { - port = route->input()->nth (io_index); - } else { - port = route->output()->nth (io_index); - } + port = io->nth (io_index); port_connections.clear (); port->get_connections(port_connections);