_button.set_active (_processor->active());
- routing_icon.set_no_show_all(true);
input_icon.set_no_show_all(true);
+ routing_icon.set_no_show_all(true);
+ output_icon.set_no_show_all(true);
+ output_routing_icon.set_no_show_all(true);
_button.show ();
input_icon.hide();
const ARDOUR::ChanCount& sinks,
const ARDOUR::ChanCount& sources,
const ARDOUR::ChanMapping& in_map,
- const ARDOUR::ChanMapping& out_map)
+ const ARDOUR::ChanMapping& out_map,
+ const ARDOUR::ChanMapping& thru_map)
{
- _in = in; _out = out;
- _sources = sources; _sinks = sinks;
- _in_map = in_map; _out_map = out_map;
-
+ _in = in;
+ _out = out;
+ _sources = sources;
+ _sinks = sinks;
+ _in_map = in_map;
+ _out_map = out_map;
+ _thru_map = thru_map;
}
bool
if (!_in_map.is_monotonic () || !_in_map.is_identity ()) {
return false;
}
- if (_in_map.count () != _sinks.n_total () || _in.n_total () != _sinks.n_total ()) {
+ if (_in_map.n_total () != _sinks.n_total () || _in.n_total () != _sinks.n_total ()) {
return false;
}
if (_feed) {
if (!_f_out_map.is_monotonic () || !_f_out_map.is_identity ()) {
return false;
}
- if (_f_out_map.count () != _f_sources.n_total () || _sinks != _f_sources) {
+ if (_f_out_map.n_total () != _f_sources.n_total () || _sinks != _f_sources) {
return false;
}
}
if (!_out_map.is_monotonic () || !_out_map.is_identity ()) {
return false;
}
- if (_out_map.count () != _sources.n_total () || _out.n_total () != _sources.n_total ()) {
+ if (_out_map.n_total () != _sources.n_total () || _out.n_total () != _sources.n_total ()) {
+ return false;
+ }
+ if (_thru_map.n_total () > 0) {
return false;
}
return true;
ProcessorEntry::RoutingIcon::set_feed (
const ARDOUR::ChanCount& out,
const ARDOUR::ChanCount& sources,
- const ARDOUR::ChanMapping& out_map)
+ const ARDOUR::ChanMapping& out_map,
+ const ARDOUR::ChanMapping& thru_map)
{
- _f_out = out;
- _f_sources = sources;
- _f_out_map = out_map;
- _feed = true;
+ _f_out = out;
+ _f_sources = sources;
+ _f_out_map = out_map;
+ _f_thru_map = thru_map;
+ _feed = true;
}
double
ProcessorEntry::RoutingIcon::draw_sidechain (cairo_t* cr, double x0, double height, bool midi)
{
const double dx = 1 + rint (max(2., 2. * UIConfiguration::instance().get_ui_scale()));
- const double y0 = rint (height * .66) + .5;
+ const double y0 = rint (height * .6) + .5;
cairo_move_to (cr, x0 - dx, height);
cairo_line_to (cr, x0, y0);
cairo_line_to (cr, x0 + dx, height);
cairo_close_path (cr);
+ set_routing_color (cr, midi);
+ cairo_fill (cr);
+}
+
+void
+ProcessorEntry::RoutingIcon::draw_thru (cairo_t* cr, double x0, double height, bool midi)
+{
+ const double dx = 1 + rint (max(2., 2. * UIConfiguration::instance().get_ui_scale()));
+ const double y0 = rint (height * .5) + .5;
+
+ cairo_move_to (cr, x0 - dx - .5, y0);
+ cairo_line_to (cr, x0 + dx + .5, y0 - 2);
+
+ cairo_move_to (cr, x0 - dx - .5, y0 + 2);
+ cairo_line_to (cr, x0 + dx + .5, y0);
+
+ cairo_move_to (cr, x0, y0 + 1);
+ cairo_line_to (cr, x0, height);
+
set_routing_color (cr, midi);
cairo_set_line_width (cr, 1.0);
cairo_stroke (cr);
uint32_t src = _f_out_map.get_src (dt, idx, &valid_src);
if (!valid_src) {
double x = pin_x_pos (i, width, pc_in, 0, false);
- draw_gnd (cr, x, height, is_midi);
+ bool valid_thru;
+ _f_thru_map.get (dt, idx, &valid_thru);
+ if (valid_thru) {
+ draw_thru (cr, x, height, is_midi);
+ } else {
+ draw_gnd (cr, x, height, is_midi);
+ }
continue;
}
c_x0 = pin_x_pos (src, width, _f_sources.n_total(), _f_sources.n_midi(), is_midi);
DataType dt = is_midi ? DataType::MIDI : DataType::AUDIO;
uint32_t idx = _out_map.get (dt, pn, &valid_out);
if (!valid_out) {
- double x = pin_x_pos (i, width, pc_out, 0, is_midi);
- draw_X (cr, x, height - 5, is_midi);
continue;
}
double c_x0 = pin_x_pos (i, width, pc_out, 0, false);
draw_connection (cr, c_x0, c_x1, 0, height - 3, is_midi);
}
- // arrows
+ // output arrows
for (uint32_t i = 0; i < n_out; ++i) {
const bool is_midi = i < n_out_midi;
double x = pin_x_pos (i, width, n_out, 0, is_midi);
bool valid_src;
_out_map.get_src (dt, pn, &valid_src);
if (!valid_src) {
- draw_gnd (cr, x, height, is_midi);
+ bool valid_thru;
+ _thru_map.get (dt, pn, &valid_thru);
+ if (valid_thru) {
+ draw_thru (cr, x, height, is_midi);
+ } else {
+ draw_gnd (cr, x, height, is_midi);
+ }
}
set_routing_color (cr, is_midi);
cairo_move_to (cr, x , height);
ChanCount in, out;
pi->configured_io (in, out);
- ChanCount midi_trhu;
+ ChanCount midi_thru;
ChanCount midi_bypass;
ChanMapping input_map (pi->input_map ());
- if (pi->has_midi_trhu ()) {
- midi_trhu.set(DataType::MIDI, 1);
+ if (pi->has_midi_thru ()) {
+ midi_thru.set(DataType::MIDI, 1);
input_map.set (DataType::MIDI, 0, 0);
}
if (pi->has_midi_bypass ()) {
midi_bypass.set(DataType::MIDI, 1);
}
- (*i)->input_icon.set_ports (sinks * count + midi_trhu);
+ (*i)->input_icon.set_ports (sinks * count + midi_thru);
(*i)->output_icon.set_ports (sources * count + midi_bypass);
(*i)->routing_icon.set (
in, out,
- sinks * count + midi_trhu,
+ sinks * count + midi_thru,
sources * count + midi_bypass,
input_map,
- pi->output_map ());
+ pi->output_map (),
+ pi->thru_map ());
if (next != children.end()) {
- (*next)->routing_icon.set_feed (out, sources * count + midi_bypass, pi->output_map ());
+ (*next)->routing_icon.set_feed (out, sources * count + midi_bypass, pi->output_map (), pi->thru_map ());
}
} else {
(*i)->output_icon.set_ports (p->output_streams());
ChanMapping inmap (p->input_streams ());
ChanMapping outmap (p->input_streams ());
+ ChanMapping thrumap;
(*i)->routing_icon.set (
p->input_streams(),
p->output_streams(),
p->input_streams(),
p->output_streams(),
- inmap, outmap);
+ inmap, outmap, thrumap);
if (next != children.end()) {
- (*next)->routing_icon.set_feed (p->output_streams(), p->output_streams(), outmap);
+ (*next)->routing_icon.set_feed (p->output_streams(), p->output_streams(), outmap, thrumap);
}
}