several fixes to make processor selection and deletion feel right, for both mixer and editor-mixer strips

This commit is contained in:
Ben Loftis
2014-07-24 22:49:33 -05:00
parent 6bdc976462
commit 96171ebe83
10 changed files with 54 additions and 32 deletions

View File

@@ -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)

View File

@@ -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 ();

View File

@@ -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
*/

View File

@@ -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 ()
{

View File

@@ -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 ();

View File

@@ -404,6 +404,23 @@ Mixer_UI::add_strips (RouteList& routes)
redisplay_track_list ();
}
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)
{
@@ -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
}

View File

@@ -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 ();

View File

@@ -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;

View File

@@ -269,6 +269,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
ProcessorsPaste,
ProcessorsDelete,
ProcessorsSelectAll,
ProcessorsSelectNone,
ProcessorsToggleActive,
ProcessorsAB,
};

View File

@@ -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();