summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-02 03:20:43 +0200
committerRobin Gareus <robin@gareus.org>2016-04-02 03:20:43 +0200
commitc44fb3e6627bb43eaddcf29ffc3feae3b72c668d (patch)
tree86af8e63e1d1fef3875bcea2544fc0bf3e6b5190
parent2f62309d447d9f9426a7624b454aef06a58e6656 (diff)
fix some thinkos with audio/midi port counting.
(there's more to come w/multiple midi ports grouped left)
-rw-r--r--gtk2_ardour/plugin_pin_dialog.cc30
-rw-r--r--gtk2_ardour/processor_box.cc2
2 files changed, 21 insertions, 11 deletions
diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc
index 48f09f12ff..b7f9d7f810 100644
--- a/gtk2_ardour/plugin_pin_dialog.cc
+++ b/gtk2_ardour/plugin_pin_dialog.cc
@@ -179,11 +179,13 @@ PluginPinDialog::update_elements ()
_selection.reset();
for (uint32_t i = 0; i < _in.n_total (); ++i) {
- _elements.push_back (CtrlWidget (Input, (i < _in.n_midi () ? DataType::MIDI : DataType::AUDIO), i));
+ int id = (i < _in.n_midi ()) ? i : i - _in.n_midi ();
+ _elements.push_back (CtrlWidget (Input, (i < _in.n_midi () ? DataType::MIDI : DataType::AUDIO), id));
}
for (uint32_t i = 0; i < _out.n_total (); ++i) {
- _elements.push_back (CtrlWidget (Output, (i < _out.n_midi () ? DataType::MIDI : DataType::AUDIO), i));
+ int id = (i < _out.n_midi ()) ? i : i - _out.n_midi ();
+ _elements.push_back (CtrlWidget (Output, (i < _out.n_midi () ? DataType::MIDI : DataType::AUDIO), id));
}
for (uint32_t n = 0; n < _n_plugins; ++n) {
@@ -214,16 +216,24 @@ PluginPinDialog::update_element_pos ()
for (CtrlElemList::iterator i = _elements.begin(); i != _elements.end(); ++i) {
switch (i->e->ct) {
case Input:
- i->x = rint ((i->e->id + 1) * _width / (1. + _in.n_total ())) - 5.5;
- i->y = y_in - 25;
- i->w = 10;
- i->h = 25;
+ {
+ uint32_t idx = i->e->id;
+ if (i->e->dt == DataType::AUDIO) { idx += _in.n_midi (); }
+ i->x = rint ((idx + 1) * _width / (1. + _in.n_total ())) - 5.5;
+ i->y = y_in - 25;
+ i->w = 10;
+ i->h = 25;
+ }
break;
case Output:
- i->x = rint ((i->e->id + 1) * _width / (1. + _out.n_total ())) - 5.5;
- i->y = y_out;
- i->w = 10;
- i->h = 25;
+ {
+ uint32_t idx = i->e->id;
+ if (i->e->dt == DataType::AUDIO) { idx += _out.n_midi (); }
+ i->x = rint ((idx + 1) * _width / (1. + _out.n_total ())) - 5.5;
+ i->y = y_out;
+ i->w = 10;
+ i->h = 25;
+ }
break;
case Sink:
{
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 9d5fbaf8d3..f8d72590c7 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1157,7 +1157,7 @@ ProcessorEntry::RoutingIcon::expose_map (cairo_t* cr, const double width, const
bool valid_src;
uint32_t src = _f_out_map.get_src (is_midi ? DataType::MIDI : DataType::AUDIO, idx, &valid_src);
if (!valid_src) {
- double x = pin_x_pos (i, width, pc_in, pc_in_midi, is_midi);
+ double x = pin_x_pos (i, width, pc_in, 0, false);
draw_gnd (cr, x, height, is_midi);
continue;
}