mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
update_io_button: store input() or output() in a variable
This avoids repeating "if (for_input)" checks.
This commit is contained in:
parent
0c2a5dc0b2
commit
35b4cb91d2
1 changed files with 6 additions and 7 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
#include "ardour/audio_track.h"
|
#include "ardour/audio_track.h"
|
||||||
#include "ardour/audioengine.h"
|
#include "ardour/audioengine.h"
|
||||||
#include "ardour/internal_send.h"
|
#include "ardour/internal_send.h"
|
||||||
|
#include "ardour/io.h"
|
||||||
#include "ardour/meter.h"
|
#include "ardour/meter.h"
|
||||||
#include "ardour/midi_track.h"
|
#include "ardour/midi_track.h"
|
||||||
#include "ardour/pannable.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_count;
|
||||||
uint32_t io_index;
|
uint32_t io_index;
|
||||||
|
boost::shared_ptr<IO> io;
|
||||||
boost::shared_ptr<Port> port;
|
boost::shared_ptr<Port> port;
|
||||||
vector<string> port_connections;
|
vector<string> port_connections;
|
||||||
|
|
||||||
|
|
@ -1243,20 +1245,17 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
|
||||||
}
|
}
|
||||||
|
|
||||||
if (for_input) {
|
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()));
|
tooltip << string_compose (_("<b>INPUT</b> to %1"), Gtkmm2ext::markup_escape_text (route->name()));
|
||||||
} else {
|
} 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()));
|
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) {
|
for (io_index = 0; io_index < io_count; ++io_index) {
|
||||||
if (for_input) {
|
port = io->nth (io_index);
|
||||||
port = route->input()->nth (io_index);
|
|
||||||
} else {
|
|
||||||
port = route->output()->nth (io_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
port_connections.clear ();
|
port_connections.clear ();
|
||||||
port->get_connections(port_connections);
|
port->get_connections(port_connections);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue