+ /* compute the centers of the L/R boxes based on the current stereo width */
+ if (fmod (usable_width,2.0) == 0) {
+ usable_width -= 1.0;
+ }
+ const double half_lr_box = lr_box_size/2.0;
+ const double left = pos_box_size * .5 + half_lr_box; // center of left box
+ const double right = width - pos_box_size * .5 - half_lr_box; // center of right box
+
+ /* center line */
+ context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
+ context->set_line_width (1.0);
+ context->move_to ((pos_box_size/2.0) + (usable_width/2.0), 0);
+ context->line_to ((pos_box_size/2.0) + (usable_width/2.0), height);
+ context->stroke ();
+
+ context->set_line_width (1.0);
+ /* left box */
+
+ rounded_left_half_rectangle (context,
+ left - half_lr_box + .5,
+ half_lr_box + step_down,
+ lr_box_size, lr_box_size, corner_radius);
+ context->set_source_rgba (UINT_RGBA_R_FLT(f), UINT_RGBA_G_FLT(f), UINT_RGBA_B_FLT(f), UINT_RGBA_A_FLT(f));
+ context->fill_preserve ();
+ context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
+ context->stroke();
+
+ /* add text */
+ int tw, th;
+ Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create(get_pango_context());
+ layout->set_attributes (panner_font_attributes);
+
+ layout->set_text (S_("Panner|L"));
+ layout->get_pixel_size(tw, th);
+ context->move_to (rint(left - tw/2), rint(lr_box_size + step_down - th/2));
+ context->set_source_rgba (UINT_RGBA_R_FLT(t), UINT_RGBA_G_FLT(t), UINT_RGBA_B_FLT(t), UINT_RGBA_A_FLT(t));
+ pango_cairo_show_layout (context->cobj(), layout->gobj());
+
+ /* right box */
+ rounded_right_half_rectangle (context,
+ right - half_lr_box - .5,
+ half_lr_box + step_down,
+ lr_box_size, lr_box_size, corner_radius);
+ context->set_source_rgba (UINT_RGBA_R_FLT(f), UINT_RGBA_G_FLT(f), UINT_RGBA_B_FLT(f), UINT_RGBA_A_FLT(f));
+ context->fill_preserve ();
+ context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
+ context->stroke();
+
+ /* add text */
+ layout->set_text (S_("Panner|R"));
+ layout->get_pixel_size(tw, th);
+ context->move_to (rint(right - tw/2), rint(lr_box_size + step_down - th/2));
+ context->set_source_rgba (UINT_RGBA_R_FLT(t), UINT_RGBA_G_FLT(t), UINT_RGBA_B_FLT(t), UINT_RGBA_A_FLT(t));
+ pango_cairo_show_layout (context->cobj(), layout->gobj());
+
+ /* 2 lines that connect them both */
+ context->set_line_width (1.0);
+
+ if (_panner_shell->panner_gui_uri() != "http://ardour.org/plugin/panner_balance#ui") {
+ context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
+ context->move_to (left + half_lr_box, half_lr_box + step_down);
+ context->line_to (right - half_lr_box, half_lr_box + step_down);
+ context->stroke ();
+
+ context->move_to (left + half_lr_box, half_lr_box+step_down+lr_box_size);
+ context->line_to (right - half_lr_box, half_lr_box+step_down+lr_box_size);
+ context->stroke ();
+ } else {
+ context->move_to (left + half_lr_box, half_lr_box+step_down+lr_box_size);
+ context->line_to (left + half_lr_box, half_lr_box + step_down);
+ context->line_to ((pos_box_size/2.0) + (usable_width/2.0), half_lr_box+step_down+lr_box_size);
+ context->line_to (right - half_lr_box, half_lr_box + step_down);
+ context->line_to (right - half_lr_box, half_lr_box+step_down+lr_box_size);
+ context->close_path();
+
+ context->set_source_rgba (UINT_RGBA_R_FLT(f), UINT_RGBA_G_FLT(f), UINT_RGBA_B_FLT(f), UINT_RGBA_A_FLT(f));
+ context->fill_preserve ();
+ context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
+ context->stroke ();
+ }