summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-07-24 22:49:33 -0500
committerBen Loftis <ben@harrisonconsoles.com>2014-07-24 22:49:47 -0500
commit96171ebe838137814e729e36ad904a307df55f4d (patch)
tree689950670b91fff781abbe74e0d6b09159c614e3 /gtk2_ardour
parent6bdc9764628e0e47f03ac09aeefc280c25d210a7 (diff)
several fixes to make processor selection and deletion feel right, for both mixer and editor-mixer strips
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_ops.cc3
-rw-r--r--gtk2_ardour/mixer_actor.cc12
-rw-r--r--gtk2_ardour/mixer_actor.h5
-rw-r--r--gtk2_ardour/mixer_strip.cc18
-rw-r--r--gtk2_ardour/mixer_strip.h1
-rw-r--r--gtk2_ardour/mixer_ui.cc28
-rw-r--r--gtk2_ardour/mixer_ui.h3
-rw-r--r--gtk2_ardour/processor_box.cc13
-rw-r--r--gtk2_ardour/processor_box.h1
-rw-r--r--gtk2_ardour/route_params_ui.cc2
10 files changed, 54 insertions, 32 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 5bbb1d0079..37ffcb83d4 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3735,8 +3735,7 @@ 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 )
+ if ( current_mixer_strip && current_mixer_strip == MixerStrip::entered_mixer_strip() )
deleted = current_mixer_strip->delete_processors ();
if (!deleted)
diff --git a/gtk2_ardour/mixer_actor.cc b/gtk2_ardour/mixer_actor.cc
index cd3d090dd6..5cc207d509 100644
--- a/gtk2_ardour/mixer_actor.cc
+++ b/gtk2_ardour/mixer_actor.cc
@@ -230,18 +230,6 @@ MixerActor::select_all_processors ()
}
}
void
-MixerActor::delete_processors ()
-{
- set_route_targets_for_operation ();
-
- BOOST_FOREACH(RouteUI* r, _route_targets) {
- MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
- if (ms) {
- ms->delete_processors ();
- }
- }
-}
-void
MixerActor::toggle_processors ()
{
set_route_targets_for_operation ();
diff --git a/gtk2_ardour/mixer_actor.h b/gtk2_ardour/mixer_actor.h
index 0b856d338c..c1a1afec6e 100644
--- a/gtk2_ardour/mixer_actor.h
+++ b/gtk2_ardour/mixer_actor.h
@@ -59,10 +59,13 @@ class MixerActor : virtual public sigc::trackable
void cut_processors ();
void paste_processors ();
void select_all_processors ();
- void delete_processors ();
void toggle_processors ();
void ab_plugins ();
+ //this op is different because it checks _all_ mixer strips, and deletes selected plugins on any of them (ignores track selections)
+ //BUT... note that we have used mixerstrip's "Enter" to enforce the rule that only one strip will have an active selection
+ virtual void delete_processors () = 0;
+
/* these actions need access to a Session, do defer to
a derived class
*/
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index f40a65e123..4181626cf0 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -186,7 +186,7 @@ MixerStrip::init ()
meter_point_button.signal_button_press_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_press), false);
meter_point_button.signal_button_release_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_release), false);
-
+
hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
monitor_input_button->set_diameter (3);
@@ -420,6 +420,11 @@ bool
MixerStrip::mixer_strip_enter_event (GdkEventCrossing *ev)
{
_entered_mixer_strip = this;
+
+ //although we are triggering on the "enter", to the user it will appear that it is happenin on the "leave"
+ //because the mixerstrip control is a parent that encompasses the strip
+ ARDOUR_UI::instance()->the_mixer()->deselect_all_strip_processors();
+
return false;
}
@@ -433,6 +438,9 @@ MixerStrip::mixer_strip_leave_event (GdkEventCrossing *ev)
//clear keyboard focus in the gain display. this is cheesy but fixes a longstanding bug.
gpm.gain_display.set_sensitive(false);
gpm.gain_display.set_sensitive(true);
+
+ //if we leave this mixer strip we need to clear out any selections
+ //processor_box.processor_display.select_none(); //but this doesn't work, because it gets triggered when (for example) you open the menu or start a drag
}
return false;
@@ -1645,6 +1653,8 @@ MixerStrip::set_selected (bool yn)
}
global_frame.queue_draw ();
+// if (!yn)
+// processor_box.deselect_all_processors();
}
void
@@ -2219,6 +2229,12 @@ MixerStrip::select_all_processors ()
processor_box.processor_operation (ProcessorBox::ProcessorsSelectAll);
}
+void
+MixerStrip::deselect_all_processors ()
+{
+ processor_box.processor_operation (ProcessorBox::ProcessorsSelectNone);
+}
+
bool
MixerStrip::delete_processors ()
{
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 644e9e57c2..3bbe4e396b 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -126,6 +126,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void cut_processors ();
void paste_processors ();
void select_all_processors ();
+ void deselect_all_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 f64bab2c07..77f5f45a56 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -405,6 +405,23 @@ Mixer_UI::add_strips (RouteList& routes)
}
void
+Mixer_UI::deselect_all_strip_processors ()
+{
+ for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
+ (*i)->deselect_all_processors();
+ }
+}
+
+void
+Mixer_UI::delete_processors ()
+{
+ for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
+ (*i)->delete_processors();
+ }
+}
+
+
+void
Mixer_UI::remove_strip (MixerStrip* strip)
{
if (_session && _session->deletion_in_progress()) {
@@ -1912,16 +1929,7 @@ Mixer_UI::set_route_targets_for_operation ()
return;
}
-/* removed "implicit" selections of strips and plugins, after discussion on IRC
- int x, y;
- get_pointer (x, y);
-
- MixerStrip* ms = strip_by_x (x);
-
- if (ms) {
- _route_targets.insert (ms);
- }
-*/
+// removed "implicit" selections of strips, after discussion on IRC
}
diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h
index e5d78f2218..622cbd9f0d 100644
--- a/gtk2_ardour/mixer_ui.h
+++ b/gtk2_ardour/mixer_ui.h
@@ -87,6 +87,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
MonitorSection* monitor_section() const { return _monitor_section; }
+ void deselect_all_strip_processors();
+ void delete_processors();
+
protected:
void set_route_targets_for_operation ();
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 58faf1b8a8..ff67923935 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1202,11 +1202,7 @@ ProcessorBox::processor_operation (ProcessorOperation op)
get_selected_processors (targets);
- 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()) {
+/* if (targets.empty()) {
int x, y;
processor_display.get_pointer (x, y);
@@ -1219,11 +1215,18 @@ ProcessorBox::processor_operation (ProcessorOperation op)
}
*/
+ if ( (op == ProcessorsDelete) && targets.empty() )
+ return false; //nothing to delete. return false so the editor-mixer, because the user was probably intending to delete something in the editor
+
switch (op) {
case ProcessorsSelectAll:
processor_display.select_all ();
break;
+ case ProcessorsSelectNone:
+ processor_display.select_none ();
+ break;
+
case ProcessorsCopy:
copy_processors (targets);
break;
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index 45f18deda7..52ed36a9b2 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -269,6 +269,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
ProcessorsPaste,
ProcessorsDelete,
ProcessorsSelectAll,
+ ProcessorsSelectNone,
ProcessorsToggleActive,
ProcessorsAB,
};
diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc
index f1677c4c2a..be5b6663f0 100644
--- a/gtk2_ardour/route_params_ui.cc
+++ b/gtk2_ardour/route_params_ui.cc
@@ -251,7 +251,7 @@ RouteParams_UI::setup_processor_boxes()
}
redir_hpane.pack1 (*insert_box);
- insert_box->ProcessorSelected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected));
+ insert_box->ProcessorSelected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected)); //note: this indicates a double-click activation, not just a "selection"
insert_box->ProcessorUnselected.connect (sigc::mem_fun(*this, &RouteParams_UI::redirect_selected));
redir_hpane.show_all();