From 6bdc9764628e0e47f03ac09aeefc280c25d210a7 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 24 Jul 2014 12:30:11 -0500 Subject: Remove "implicit" selection for plugin deletion. Allow deletions in the mixer strip to fall through to editor if nothing was selected. --- gtk2_ardour/editor_ops.cc | 6 ++++-- gtk2_ardour/mixer_strip.cc | 4 ++-- gtk2_ardour/mixer_strip.h | 2 +- gtk2_ardour/mixer_ui.cc | 5 +++-- gtk2_ardour/processor_box.cc | 11 +++++++++-- gtk2_ardour/processor_box.h | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 0fb22b814f..5bbb1d0079 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -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); } diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 97d705b6fa..f40a65e123 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -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 diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 7f15cc9d6a..644e9e57c2 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -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 (); diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index e9c36690a6..f64bab2c07 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -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 diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 4122d9687d..58faf1b8a8 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -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* diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 021e557d36..45f18deda7 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -280,7 +280,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void set_route (boost::shared_ptr); void set_width (Width); - void processor_operation (ProcessorOperation); + bool processor_operation (ProcessorOperation); void select_all_processors (); void deselect_all_processors (); -- cgit v1.2.3