generalize "delete-while-mouse-button-pressed" fix; make LADSPA/VST plugins compute...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 15 May 2008 13:40:07 +0000 (13:40 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 15 May 2008 13:40:07 +0000 (13:40 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3354 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_ops.cc
gtk2_ardour/redirect_box.cc
libs/ardour/plugin.cc
libs/ardour/route.cc

index 691dc3d8ef3bc37e6d57607f6d344f832dcf7f56..084859dc83c5719fa5c43124cc1e3664460a81d7 100644 (file)
@@ -3673,6 +3673,19 @@ Editor::cut_copy (CutCopyOp op)
                opname = _("clear");
                break;
        }
+
+       /* if we're deleting something, and the mouse is still pressed,
+          the thing we started a drag for will be gone when we release
+          the mouse button(s). avoid this. see part 2 at the end of
+          this function.
+       */
+
+       if (op == Cut || op == Clear) {
+               if (drag_info.item) {
+                       drag_info.item->ungrab (0);
+                       drag_info.item = 0;
+               }
+       }
        
        cut_buffer->clear ();
 
@@ -3687,11 +3700,8 @@ Editor::cut_copy (CutCopyOp op)
                        Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
                }
 
-               if (drag_info.item) {
-                       drag_info.item->ungrab (0);
-                       drag_info.item = 0;
-               }
-               
+               break_drag ();
+
                return;
        }
 
@@ -3756,6 +3766,11 @@ Editor::cut_copy (CutCopyOp op)
        default:
                break;
        }
+
+
+       if (op == Cut || op == Clear) {
+               break_drag ();
+       }
 }
 
 void
index e39f5cee043b68e43bb226753fba6bcc82439adb..c2ffaf0e0c02405734ef897bba97a7fa551d3af3 100644 (file)
@@ -476,6 +476,9 @@ RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr
                                         streams));
        }
 
+       dialog.set_border_width (PublicEditor::window_border_width);
+
+       label.set_alignment (0.5, 0.5);
        dialog.get_vbox()->pack_start (label);
        dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
 
index de5c843013f9670bc702ec97230b171c2619382d..9fd1707176688c09c0e690998f55b620306ba6f1 100644 (file)
@@ -388,16 +388,19 @@ Plugin::can_do (int32_t in, int32_t& out)
                   away any existing active streams.
                */
 
+               out = outputs;
                return 1;
        }
 
        if (outputs == 1 && inputs == 1) {
                /* mono plugin, replicate as needed */
+               out = in;
                return in;
        }
 
        if (inputs == in) {
                /* exact match */
+               out = outputs;
                return 1;
        }
 
@@ -407,7 +410,9 @@ Plugin::can_do (int32_t in, int32_t& out)
                   configuration, so we can replicate.
                */
 
-               return in/inputs;
+               int nplugs = in/inputs;
+               out = outputs * nplugs;
+               return nplugs;
        }
 
        /* sorry */
index e56028833b62ce3a2c6187810b3192128711b9eb..f42474050983f523965eca130db899cc430f76d3 100644 (file)
@@ -1138,7 +1138,9 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
 
        redirect_max_outs = 0;
 
-       /* divide inserts up by placement so we get the signal flow
+       /* Step 1: build a map that links each insert to an in/out channel count 
+
+          Divide inserts up by placement so we get the signal flow
           properly modelled. we need to do this because the _redirects
           list is not sorted by placement, and because other reasons may 
           exist now or in the future for this separate treatment.