make inclusion/exclusion of hidden children optional in Item::add_child_bounding_boxes
[ardour.git] / gtk2_ardour / processor_box.cc
index ee7cfa8dffb1212d7a24b5f65964fcd43b550bda..8a34405e235fdced47ccac5f78403cf57bdf1821 100644 (file)
@@ -86,7 +86,7 @@
 #include "tooltips.h"
 #include "new_plugin_preset_dialog.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 #ifdef AUDIOUNIT_SUPPORT
 class AUPluginUI;
@@ -1518,6 +1518,7 @@ ProcessorEntry::PluginDisplay::PluginDisplay (ProcessorEntry& e, boost::shared_p
 {
        set_name ("processor prefader");
        add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
+       _plug->DropReferences.connect (_death_connection, invalidator (*this), boost::bind (&PluginDisplay::plugin_going_away, this), gui_context());
        _plug->QueueDraw.connect (_qdraw_connection, invalidator (*this),
                        boost::bind (&Gtk::Widget::queue_draw, this), gui_context ());
 
@@ -1547,7 +1548,7 @@ ProcessorEntry::PluginDisplay::on_button_press_event (GdkEventButton *ev)
        // select processor, then call (private)
        //_entry._parent->processor_button_press_event (ev, &_entry);
        if (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS)) {
-               if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
+               if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
                        _entry._parent->generic_edit_processor (_entry.processor ());
                } else {
                        _entry._parent->edit_processor (_entry.processor ());
@@ -1723,6 +1724,7 @@ ProcessorEntry::LuaPluginDisplay::render_inline (cairo_t *cr, uint32_t width)
        Cairo::Context ctx (cr);
        try {
                luabridge::LuaRef rv = (*_lua_render_inline)((Cairo::Context *)&ctx, width, _max_height);
+               lua_gui.collect_garbage_step ();
                if (rv.isTable ()) {
                        uint32_t h = rv[2];
                        return h;
@@ -2440,6 +2442,16 @@ ProcessorBox::use_plugins (const SelectedPlugins& plugins)
 void
 ProcessorBox::weird_plugin_dialog (Plugin& p, Route::ProcessorStreams streams)
 {
+       /* XXX this needs to be re-worked!
+        *
+        * With new pin-management "streams" is no longer correct.
+        * p.get_info () is also incorrect for variable i/o plugins (always -1,-1).
+        *
+        * Since pin-management was added, this dialog will only show in a very rare
+        * condition (non-replicated variable i/o configuration failed).
+        *
+        * TODO: simplify the message after the string-freeze is lifted.
+        */
        ArdourDialog dialog (_("Plugin Incompatibility"));
        Label label;
 
@@ -2496,7 +2508,7 @@ ProcessorBox::choose_send ()
        boost::shared_ptr<Send> send (new Send (*_session, _route->pannable (), _route->mute_master()));
 
        /* make an educated guess at the initial number of outputs for the send */
-       ChanCount outs = (_session->master_out())
+       ChanCount outs = (_route->n_outputs().n_audio() && _session->master_out())
                        ? _session->master_out()->n_outputs()
                        : _route->n_outputs();