From e313838485697033d1b7366105968d789ea4228e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 15 May 2008 13:40:07 +0000 Subject: [PATCH] generalize "delete-while-mouse-button-pressed" fix; make LADSPA/VST plugins compute i/o numbers correctly; add spacing to wierd plugin config dialog git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3354 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 25 ++++++++++++++++++++----- gtk2_ardour/redirect_box.cc | 3 +++ libs/ardour/plugin.cc | 7 ++++++- libs/ardour/route.cc | 4 +++- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 691dc3d8ef..084859dc83 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -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 diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index e39f5cee04..c2ffaf0e0c 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -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); diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index de5c843013..9fd1707176 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -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 */ diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e56028833b..f424740509 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -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. -- 2.30.2