+void
+ProcessorBox::on_size_allocate (Allocation& a)
+{
+ HBox::on_size_allocate (a);
+
+ list<ProcessorEntry*> children = processor_display.children ();
+ for (list<ProcessorEntry*>::const_iterator i = children.begin(); i != children.end(); ++i) {
+ (*i)->set_pixel_width (a.get_width ());
+ }
+}
+
+/** @param p Processor.
+ * @return the UI window for \a p.
+ */
+Window *
+ProcessorBox::get_processor_ui (boost::shared_ptr<Processor> p) const
+{
+ list<ProcessorWindowProxy*>::const_iterator i = _processor_window_proxies.begin ();
+ while (i != _processor_window_proxies.end()) {
+ boost::shared_ptr<Processor> t = (*i)->processor().lock ();
+ if (t && t == p) {
+ return (*i)->get ();
+ }
+
+ ++i;
+ }
+
+ /* we shouldn't get here, because the ProcessorUIList should always contain
+ an entry for each processor.
+ */
+ assert (false);
+ return 0;
+}
+
+/** Make a note of the UI window that a processor is using.
+ * @param p Processor.
+ * @param w UI window.
+ */
+void
+ProcessorBox::set_processor_ui (boost::shared_ptr<Processor> p, Gtk::Window* w)
+{
+ list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin ();
+
+ p->set_ui (w);
+
+ while (i != _processor_window_proxies.end()) {
+ boost::shared_ptr<Processor> t = (*i)->processor().lock ();
+ if (t && t == p) {
+ (*i)->set (w);
+ return;
+ }
+
+ ++i;
+ }
+
+ /* we shouldn't get here, because the ProcessorUIList should always contain
+ an entry for each processor.
+ */
+ assert (false);
+}
+
+void
+ProcessorBox::mixer_strip_delivery_changed (boost::weak_ptr<Delivery> w)
+{
+ boost::shared_ptr<Delivery> d = w.lock ();
+ if (!d) {
+ return;
+ }
+
+ list<ProcessorEntry*> children = processor_display.children ();
+ list<ProcessorEntry*>::const_iterator i = children.begin();
+ while (i != children.end() && (*i)->processor() != d) {
+ ++i;
+ }
+
+ if (i == children.end()) {
+ processor_display.set_active (0);
+ } else {
+ processor_display.set_active (*i);
+ }
+}
+
+void
+ProcessorBox::hide_things ()
+{
+ list<ProcessorEntry*> c = processor_display.children ();
+ for (list<ProcessorEntry*>::iterator i = c.begin(); i != c.end(); ++i) {
+ (*i)->hide_things ();
+ }
+}
+
+ProcessorWindowProxy::ProcessorWindowProxy (
+ string const & name,
+ XMLNode const * node,
+ ProcessorBox* box,
+ boost::weak_ptr<Processor> processor
+ )
+ : WindowProxy<Gtk::Window> (name, node)
+ , marked (false)
+ , _processor_box (box)
+ , _processor (processor)
+{
+
+}
+
+
+void
+ProcessorWindowProxy::show ()
+{
+ boost::shared_ptr<Processor> p = _processor.lock ();
+ if (!p) {
+ return;
+ }
+
+ _processor_box->toggle_edit_processor (p);
+}
+