Lua bind MonitorProcessor
[ardour.git] / gtk2_ardour / processor_box.cc
index c70dc9078a96b1b015f25612e5b4e1b75d3e3fa3..3590c280d6e487d68232ed9777190a885d1d858d 100644 (file)
@@ -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 ());
 
@@ -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();