Allow deletion of processors in editor_mixer_strip by pointing and pressing Delete

This had to be hacked because the editor_mixer strip is on the editor and doesnt respond to mixer keybindings.
Also force the gain intry to lose focus if the user leaves the mixer strip.  this will probably solve some long-standing complaints.  although perhaps a more elegant solution is possible.
This commit is contained in:
Ben Loftis 2014-07-23 16:58:43 -05:00
parent d46081c275
commit 05f3adaba3
6 changed files with 28 additions and 1 deletions

View File

@ -308,6 +308,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void set_selected_mixer_strip (TimeAxisView&);
void mixer_strip_width_changed ();
bool mixer_strip_enter_event ( GdkEventCrossing * );
bool mixer_strip_leave_event ( GdkEventCrossing * );
void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false);
/* nudge is initiated by transport controls owned by ARDOUR_UI */

View File

@ -185,6 +185,7 @@ Editor::create_editor_mixer ()
current_mixer_strip->set_embedded (true);
current_mixer_strip->signal_enter_notify_event().connect (sigc::mem_fun(*this, &Editor::mixer_strip_enter_event ));
current_mixer_strip->signal_leave_notify_event().connect (sigc::mem_fun(*this, &Editor::mixer_strip_leave_event ));
}
@ -195,6 +196,17 @@ Editor::mixer_strip_enter_event (GdkEventCrossing *ev)
return false;
}
bool
Editor::mixer_strip_leave_event (GdkEventCrossing *ev)
{
//if we have moved outside our strip, but not into a child view, then deselect ourselves
if ( !(ev->detail == GDK_NOTIFY_INFERIOR) ) {
current_mixer_strip->set_selected(false);
}
return false;
}
void
Editor::set_selected_mixer_strip (TimeAxisView& view)
{

View File

@ -76,6 +76,7 @@
#include "interthread_progress_window.h"
#include "keyboard.h"
#include "midi_region_view.h"
#include "mixer_strip.h"
#include "mouse_cursors.h"
#include "normalize_dialog.h"
#include "patch_change_dialog.h"
@ -3731,7 +3732,13 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
void
Editor::delete_ ()
{
cut_copy (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
//TODO: perhaps someday we need to accomodate the other bindings such as mute, solo, etc.
if ( current_mixer_strip && current_mixer_strip->is_selected() )
current_mixer_strip->delete_processors ();
else
cut_copy (Delete);
}
/** Cut selected regions, automation points or a time range */

View File

@ -14,6 +14,7 @@
<Binding key="Primary-c" action="Mixer/copy-processors"/>
<Binding key="Primary-v" action="Mixer/paste-processors"/>
<Binding key="Delete" action="Mixer/delete-processors"/>
<Binding key="Backspace" action="Mixer/delete-processors"/>
<Binding key="Return" action="Mixer/toggle-processors"/>
<Binding key="Primary-a" action="Mixer/select-all-processors"/>
<Binding key="Slash" action="Mixer/ab-plugins"/>

View File

@ -1612,6 +1612,11 @@ MixerStrip::set_selected (bool yn)
global_frame.set_name ("MixerStripFrame");
}
global_frame.queue_draw ();
if (!yn) { //if deselected, 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);
}
}
void

View File

@ -131,6 +131,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void ab_plugins ();
void set_selected(bool yn);
bool is_selected() {return _selected;}
protected:
friend class Mixer_UI;