From 249ee47296fdaf000c2820e9922d8b429020759e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 26 Jan 2014 01:21:28 +0100 Subject: fix routing display for mono synths and midi-tracks w/o synth --- gtk2_ardour/processor_box.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index c2421dcabf..cb72162773 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -844,6 +844,13 @@ ProcessorEntry::RoutingIcon::on_expose_event (GdkEventExpose* ev) cairo_move_to (cr, si_x, height); cairo_line_to (cr, si_x, 0); cairo_stroke (cr); + } else if (midi_sources == 1 && midi_sinks == 1) { + /* unusual cases -- removed synth, midi-track w/audio plugins */ + const float si_x = rintf(width * (sinks > 1 ? .2f : .5f)) + .5f; + const float si_x0 = rintf(width * (sources > 1 ? .2f : .5f)) + .5f; + cairo_move_to (cr, si_x, height); + cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); + cairo_stroke (cr); } /* AUDIO */ @@ -855,8 +862,10 @@ ProcessorEntry::RoutingIcon::on_expose_event (GdkEventExpose* ev) UINT_RGBA_B_FLT(audio_port_color)); if (_splitting) { + assert(audio_sources < 2); assert(audio_sinks > 1); - const float si_x0 = rintf(width * .5f) + .5f; + /* assume there is only ever one MIDI port */ + const float si_x0 = rintf(width * (midi_sources > 0 ? .8f : .5f)) + .5f; for (uint32_t i = midi_sinks; i < sinks; ++i) { const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f; cairo_move_to (cr, si_x, height); -- cgit v1.2.3