diff options
author | Robin Gareus <robin@gareus.org> | 2013-12-30 15:55:17 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-12-30 15:55:17 +0100 |
commit | 7e857b226440cb1ad396e448b1af6e6c958fae28 (patch) | |
tree | 8b582583d4694b32cdae79a983fd7b4b5814b2ac /gtk2_ardour/processor_box.cc | |
parent | c284823413c31f9fba9ee4f39f501b1d40f5a67b (diff) |
visualize # of channels in processor-box splitting icon
Diffstat (limited to 'gtk2_ardour/processor_box.cc')
-rw-r--r-- | gtk2_ardour/processor_box.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index b549fd15ac..99ba5c5f1a 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -618,6 +618,7 @@ void PluginInsertProcessorEntry::plugin_insert_splitting_changed () { if (_plugin_insert->splitting ()) { + _splitting_icon.set_branches(_plugin_insert->output_streams().n_audio()); _splitting_icon.show (); } else { _splitting_icon.hide (); @@ -675,17 +676,27 @@ PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev) Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL); cairo_set_source_rgb (cr, fg.get_red_p (), fg.get_green_p (), fg.get_blue_p ()); - const float si_l = rint(width * 0.3) + .5; - const float si_c = rint(width * 0.5) + .5; - const float si_r = rint(width * 0.7) + .5; - const float si_m = rint(height * 0.5) + .5; + const float si_l = rintf(width * 0.2) + .5f; + const float si_c = rintf(width * 0.5) + .5f; + const float si_r = rintf(width * 0.8) + .5f; + const float si_m = rintf(height * 0.5) + .5f; cairo_move_to (cr, si_l, height); cairo_line_to (cr, si_l, si_m); cairo_line_to (cr, si_r, si_m); cairo_line_to (cr, si_r, height); + cairo_stroke (cr); cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); + + for (uint32_t i = 2; i < _branches; ++i) { + //const float si_b = rintf((width * .2f) + (i - 1.f) * width * .6f / (_branches - 1.f)) + .5f; + const float si_b = rintf(width * (.2f + .6f * (i - 1.f) / (_branches - 1.f))) + .5f; + cairo_move_to (cr, si_b, height); + cairo_line_to (cr, si_b, si_m); + cairo_stroke (cr); + } + cairo_move_to (cr, si_c, si_m); cairo_line_to (cr, si_c, 0); cairo_stroke (cr); |