mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
fix some thinkos with audio/midi port counting.
(there's more to come w/multiple midi ports grouped left)
This commit is contained in:
parent
2f62309d44
commit
c44fb3e662
2 changed files with 21 additions and 11 deletions
|
|
@ -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:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue