+ boost::shared_ptr<AutomationControl> c = _control.lock ();
+ if (!c) {
+ return;
+ }
+
+ _ignore_ui_adjustment = true;
+
+ if (c->toggled ()) {
+
+ _button.set_active (c->get_value() > 0.5);
+
+ } else {
+
+ _adjustment.set_value (c->internal_to_interface (c->get_value ()));
+
+ stringstream s;
+ s.precision (1);
+ s.setf (ios::fixed, ios::floatfield);
+ s << c->internal_to_user (c->get_value ());
+ }
+
+ _ignore_ui_adjustment = false;
+}
+
+void
+ProcessorEntry::Control::add_state (XMLNode* node) const
+{
+ XMLNode* c = new XMLNode (X_("Object"));
+ c->add_property (X_("id"), state_id ());
+ c->add_property (X_("visible"), _visible);
+ node->add_child_nocopy (*c);
+}
+
+void
+ProcessorEntry::Control::set_state (XMLNode const * node)
+{
+ XMLNode* n = GUIObjectState::get_node (node, state_id ());
+ if (n) {
+ XMLProperty* p = n->property (X_("visible"));
+ set_visible (p && string_is_affirmative (p->value ()));
+ } else {
+ set_visible (false);
+ }
+}
+
+void
+ProcessorEntry::Control::set_visible (bool v)
+{
+ if (v) {
+ box.show ();
+ } else {
+ box.hide ();
+ }
+
+ _visible = v;
+}
+
+/** Called when the Editor might have re-shown things that
+ we want hidden.
+*/
+void
+ProcessorEntry::Control::hide_things ()
+{
+ if (!_visible) {
+ box.hide ();
+ }
+}
+
+void
+ProcessorEntry::Control::hide_label ()
+{
+ _label.hide ();
+}
+
+string
+ProcessorEntry::Control::state_id () const
+{
+ boost::shared_ptr<AutomationControl> c = _control.lock ();
+ assert (c);
+
+ return string_compose (X_("control %1"), c->id().to_s ());
+}
+
+BlankProcessorEntry::BlankProcessorEntry (ProcessorBox* b, Width w)
+ : ProcessorEntry (b, boost::shared_ptr<Processor>(), w)
+{
+}
+
+PluginInsertProcessorEntry::PluginInsertProcessorEntry (ProcessorBox* b, boost::shared_ptr<ARDOUR::PluginInsert> p, Width w)
+ : ProcessorEntry (b, p, w)
+ , _plugin_insert (p)
+{
+ p->SplittingChanged.connect (
+ _splitting_connection, invalidator (*this), boost::bind (&PluginInsertProcessorEntry::plugin_insert_splitting_changed, this), gui_context()
+ );
+
+ _splitting_icon.set_size_request (-1, 12);
+
+ _vbox.pack_start (_splitting_icon);
+ _vbox.reorder_child (_splitting_icon, 0);
+
+ plugin_insert_splitting_changed ();
+}
+
+void
+PluginInsertProcessorEntry::plugin_insert_splitting_changed ()
+{
+ if (_plugin_insert->splitting ()) {
+ _splitting_icon.show ();
+ } else {
+ _splitting_icon.hide ();
+ }
+}
+
+void
+PluginInsertProcessorEntry::hide_things ()
+{
+ ProcessorEntry::hide_things ();
+ plugin_insert_splitting_changed ();
+}
+
+void
+PluginInsertProcessorEntry::setup_visuals ()
+{
+ switch (_position) {
+ case PreFader:
+ _splitting_icon.set_name ("ProcessorPreFader");
+ break;
+
+ case Fader:
+ _splitting_icon.set_name ("ProcessorFader");
+ break;
+
+ case PostFader:
+ _splitting_icon.set_name ("ProcessorPostFader");
+ break;
+ }
+
+ ProcessorEntry::setup_visuals ();
+}
+
+bool
+PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev)
+{
+ cairo_t* cr = gdk_cairo_create (get_window()->gobj());
+
+ cairo_set_line_width (cr, 1);
+
+ double const width = ev->area.width;
+ double const height = ev->area.height;
+
+ Gdk::Color const bg = get_style()->get_bg (STATE_NORMAL);
+ cairo_set_source_rgb (cr, bg.get_red_p (), bg.get_green_p (), bg.get_blue_p ());
+
+ cairo_rectangle (cr, 0, 0, width, height);
+ cairo_fill (cr);
+
+ 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 ());
+
+ cairo_move_to (cr, width * 0.3, height);
+ cairo_line_to (cr, width * 0.3, height * 0.5);
+ cairo_line_to (cr, width * 0.7, height * 0.5);
+ cairo_line_to (cr, width * 0.7, height);
+ cairo_move_to (cr, width * 0.5, height * 0.5);
+ cairo_line_to (cr, width * 0.5, 0);
+ cairo_stroke (cr);
+
+ return true;