diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-07 19:12:23 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-09 21:08:16 +0200 |
commit | 35b4cb91d21f8e45e49d2e629f6df818cb9742c6 (patch) | |
tree | 3518162891832c275c327b4dc44140918f4317c1 /gtk2_ardour/mixer_strip.cc | |
parent | 0c2a5dc0b2d4850748763bc58ff274d8e19d80ad (diff) |
update_io_button: store input() or output() in a variable
This avoids repeating "if (for_input)" checks.
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 13 |
1 files 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<ARDOUR::Route> route, Width widt { uint32_t io_count; uint32_t io_index; + boost::shared_ptr<IO> io; boost::shared_ptr<Port> port; vector<string> port_connections; @@ -1243,20 +1245,17 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt } if (for_input) { - io_count = route->n_inputs().n_total(); + io = route->input(); tooltip << string_compose (_("<b>INPUT</b> to %1"), Gtkmm2ext::markup_escape_text (route->name())); } else { - io_count = route->n_outputs().n_total(); + io = route->output(); tooltip << string_compose (_("<b>OUTPUT</b> 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); |