Remove "implicit" selection for plugin deletion.
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 24 Jul 2014 17:30:11 +0000 (12:30 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Fri, 25 Jul 2014 03:49:47 +0000 (22:49 -0500)
Allow deletions in the mixer strip to fall through to editor if nothing was selected.

gtk2_ardour/editor_ops.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/mixer_strip.h
gtk2_ardour/mixer_ui.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/processor_box.h

index 0fb22b814fcfc73b5d9fde8234088261d494597c..5bbb1d007996a27cfe056657344fc1df63eda9a5 100644 (file)
@@ -3734,10 +3734,12 @@ Editor::delete_ ()
 {
        //special case: if the user is pointing in the editor/mixer strip, they may be trying to delete a plugin.
        //we need this because the editor-mixer strip is in the editor window, so it doesn't get the bindings from the mix window
+       bool deleted = false;
        MixerStrip *entered = MixerStrip::entered_mixer_strip();
        if ( current_mixer_strip && current_mixer_strip == entered )
-               current_mixer_strip->delete_processors ();
-       else
+               deleted = current_mixer_strip->delete_processors ();
+
+       if (!deleted)
                cut_copy (Delete);
 }
 
index 97d705b6fa817918b1cdb873d963ffba4b560679..f40a65e123d76db078b034bf952ed35488e26c87 100644 (file)
@@ -2219,10 +2219,10 @@ MixerStrip::select_all_processors ()
        processor_box.processor_operation (ProcessorBox::ProcessorsSelectAll);
 }
 
-void
+bool
 MixerStrip::delete_processors ()
 {
-       processor_box.processor_operation (ProcessorBox::ProcessorsDelete);
+       return processor_box.processor_operation (ProcessorBox::ProcessorsDelete);
 }
 
 void
index 7f15cc9d6a6aa87d3ce7563d3807197b9ac76b80..644e9e57c2dc375a582fd5b8cf53796ab080d546 100644 (file)
@@ -126,7 +126,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
        void cut_processors ();
        void paste_processors ();
        void select_all_processors ();
-       void delete_processors ();
+       bool delete_processors ();  //note: returns false if nothing was deleted
        void toggle_processors ();
        void ab_plugins ();
 
index e9c36690a64164f7aa074110c597cf4257a99a3c..f64bab2c07902cdee917317de2f5bfac17020cae 100644 (file)
@@ -1912,8 +1912,7 @@ Mixer_UI::set_route_targets_for_operation ()
                return;
        }
 
-       /* nothing selected ... try to get mixer strip at mouse */
-
+/*  removed "implicit" selections of strips and plugins, after discussion on IRC
        int x, y;
        get_pointer (x, y);
        
@@ -1922,6 +1921,8 @@ Mixer_UI::set_route_targets_for_operation ()
        if (ms) {
                _route_targets.insert (ms);
        }
+*/
+
 }
 
 void
index 4122d9687d83e3b8924150a58e5fd2c63d09cd61..58faf1b8a85636db1472a68c2b9e096aaf45561c 100644 (file)
@@ -1195,14 +1195,18 @@ ProcessorBox::leave_notify (GdkEventCrossing*)
        return false;
 }
 
-void
+bool
 ProcessorBox::processor_operation (ProcessorOperation op) 
 {
        ProcSelection targets;
 
        get_selected_processors (targets);
 
-       if (targets.empty()) {
+       if ((op == ProcessorsDelete) && targets.empty())
+               return false;  //special case:  editor-mixer needs to know that nothing got deleted;  the user probably meant to delete something in the editor
+
+/* removed "implicit" selections of strips and plugins, after discussion on IRC
+       if (targets.empty()) {
 
                int x, y;
                processor_display.get_pointer (x, y);
@@ -1213,6 +1217,7 @@ ProcessorBox::processor_operation (ProcessorOperation op)
                        targets.push_back (pointer.first->processor ());
                }
        }
+*/
 
        switch (op) {
        case ProcessorsSelectAll:
@@ -1256,6 +1261,8 @@ ProcessorBox::processor_operation (ProcessorOperation op)
        default:
                break;
        }
+       
+       return true;
 }
 
 ProcessorWindowProxy* 
index 021e557d364f90f6fb4c1b3d25c7993994327787..45f18deda75e955e93017acb186ce2a8f364ce30 100644 (file)
@@ -280,7 +280,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        void set_route (boost::shared_ptr<ARDOUR::Route>);
        void set_width (Width);
 
-       void processor_operation (ProcessorOperation);
+       bool processor_operation (ProcessorOperation);
 
        void select_all_processors ();
        void deselect_all_processors ();