+Gtk::Widget&
+ProcessorEntry::widget ()
+{
+ return _vbox;
+}
+
+string
+ProcessorEntry::drag_text () const
+{
+ return name (Wide);
+}
+
+void
+ProcessorEntry::set_position (Position p)
+{
+ _position = p;
+ setup_visuals ();
+}
+
+void
+ProcessorEntry::set_visual_state (Gtkmm2ext::VisualState s, bool yn)
+{
+ if (yn) {
+ _button.set_visual_state (Gtkmm2ext::VisualState (_button.visual_state() | s));
+ } else {
+ _button.set_visual_state (Gtkmm2ext::VisualState (_button.visual_state() & ~s));
+ }
+}
+
+void
+ProcessorEntry::setup_visuals ()
+{
+ switch (_position) {
+ case PreFader:
+ _button.set_name ("processor prefader");
+ break;
+
+ case Fader:
+ _button.set_name ("processor fader");
+ break;
+
+ case PostFader:
+ _button.set_name ("processor postfader");
+ break;
+ }
+}
+
+
+boost::shared_ptr<Processor>
+ProcessorEntry::processor () const
+{
+ return _processor;
+}
+
+void
+ProcessorEntry::set_enum_width (Width w)
+{
+ _width = w;
+}
+
+void
+ProcessorEntry::led_clicked()
+{
+ if (_processor) {
+ if (_button.get_active ()) {
+ _processor->deactivate ();
+ } else {
+ _processor->activate ();
+ }
+ }
+}
+
+void
+ProcessorEntry::processor_active_changed ()
+{
+ if (_processor) {
+ _button.set_active (_processor->active());
+ }
+}
+
+void
+ProcessorEntry::processor_property_changed (const PropertyChange& what_changed)
+{
+ if (what_changed.contains (ARDOUR::Properties::name)) {
+ _button.set_text (name (_width));
+ setup_tooltip ();
+ }
+}
+
+void
+ProcessorEntry::setup_tooltip ()
+{
+ ARDOUR_UI::instance()->set_tip (_button, name (Wide));
+}
+
+string
+ProcessorEntry::name (Width w) const
+{
+ boost::shared_ptr<Send> send;
+ string name_display;
+
+ if (!_processor) {
+ return string();
+ }
+
+ if ((send = boost::dynamic_pointer_cast<Send> (_processor)) != 0 &&
+ !boost::dynamic_pointer_cast<InternalSend>(_processor)) {
+
+ name_display += '>';
+
+ /* grab the send name out of its overall name */
+
+ string::size_type lbracket, rbracket;
+ lbracket = send->name().find ('[');
+ rbracket = send->name().find (']');
+
+ switch (w) {
+ case Wide:
+ name_display += send->name().substr (lbracket+1, lbracket-rbracket-1);
+ break;
+ case Narrow:
+ name_display += PBD::short_version (send->name().substr (lbracket+1, lbracket-rbracket-1), 4);
+ break;
+ }
+
+ } else {
+
+ switch (w) {
+ case Wide:
+ name_display += _processor->display_name();
+ break;
+ case Narrow:
+ name_display += PBD::short_version (_processor->display_name(), 5);
+ break;
+ }
+
+ }
+
+ return name_display;
+}
+
+void
+ProcessorEntry::setup_slider_pix ()
+{
+ _slider_pixbuf = ::get_icon ("fader_belt_h_thin");
+ assert (_slider_pixbuf);
+ _slider_pixbuf_desensitised = ::get_icon ("fader_belt_h_thin_desensitised");
+ assert (_slider_pixbuf_desensitised);
+}
+
+void
+ProcessorEntry::set_pixel_width (int p)
+{
+ for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->set_pixel_width (p);
+ }
+}
+
+void
+ProcessorEntry::show_all_controls ()
+{
+ for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->set_visible (true);
+ }
+
+ _parent->update_gui_object_state (this);
+}
+
+void
+ProcessorEntry::hide_all_controls ()
+{
+ for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->set_visible (false);
+ }
+
+ _parent->update_gui_object_state (this);
+}
+
+void
+ProcessorEntry::add_control_state (XMLNode* node) const
+{
+ for (list<Control*>::const_iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->add_state (node);
+ }
+}
+
+void
+ProcessorEntry::set_control_state (XMLNode const * node)
+{
+ for (list<Control*>::const_iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->set_state (node);
+ }
+}
+
+string
+ProcessorEntry::state_id () const
+{
+ return string_compose ("processor %1", _processor->id().to_s());
+}
+
+void
+ProcessorEntry::hide_things ()
+{
+ for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
+ (*i)->hide_things ();
+ }
+}
+
+
+Menu *
+ProcessorEntry::build_controls_menu ()
+{
+ using namespace Menu_Helpers;
+ Menu* menu = manage (new Menu);
+ MenuList& items = menu->items ();
+
+ items.push_back (
+ MenuElem (_("Show All Controls"), sigc::mem_fun (*this, &ProcessorEntry::show_all_controls))
+ );
+
+ items.push_back (
+ MenuElem (_("Hide All Controls"), sigc::mem_fun (*this, &ProcessorEntry::hide_all_controls))
+ );
+
+ if (!_controls.empty ()) {
+ items.push_back (SeparatorElem ());
+ }