13
0

Revert previous select-strips-under-mouse behavior

However, keep the path for deletions in the editor-mixer via _entered_mixer_strip
TODO:  if nothing was deleted, assume the user was trying to delete something in the editor instead
Show selected plugins by a red border
TODO:  more work on the selection model for plugins and mixer strips
This commit is contained in:
Ben Loftis 2014-07-24 11:28:31 -05:00
parent 05f3adaba3
commit 61c66afd4c
9 changed files with 50 additions and 45 deletions

View File

@ -465,6 +465,12 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_fill (cr);
}
}
if (visual_state() & Gtkmm2ext::Selected) {
cairo_set_line_width(cr,2);
rounded_function (cr, 0, 0, get_width(), get_height(), _corner_radius);
cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
cairo_stroke (cr);
}
if (_focused) {
rounded_function (cr, 1.5, 1.5, get_width() - 3, get_height() - 3, _corner_radius);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.8);

View File

@ -307,8 +307,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void show_editor_list (bool yn);
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

@ -184,27 +184,6 @@ Editor::create_editor_mixer ()
#endif
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 ));
}
bool
Editor::mixer_strip_enter_event (GdkEventCrossing *ev)
{
current_mixer_strip->set_selected(true);
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

View File

@ -3734,8 +3734,8 @@ 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
//TODO: perhaps someday we need to accomodate the other bindings such as mute, solo, etc.
if ( current_mixer_strip && current_mixer_strip->is_selected() )
MixerStrip *entered = MixerStrip::entered_mixer_strip();
if ( current_mixer_strip && current_mixer_strip == entered )
current_mixer_strip->delete_processors ();
else
cut_copy (Delete);

View File

@ -237,7 +237,7 @@ MixerActor::delete_processors ()
BOOST_FOREACH(RouteUI* r, _route_targets) {
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
if (ms) {
ms->delete_processors ();
ms->select_all_processors ();
}
}
}

View File

@ -76,6 +76,8 @@ using namespace Gtkmm2ext;
using namespace std;
using namespace ArdourMeter;
MixerStrip* MixerStrip::_entered_mixer_strip;
int MixerStrip::scrollbar_height = 0;
PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
@ -137,6 +139,7 @@ MixerStrip::init ()
{
int button_table_row = 0;
_entered_mixer_strip= 0;
input_selector = 0;
output_selector = 0;
group_menu = 0;
@ -394,6 +397,10 @@ MixerStrip::init ()
Config->ParameterChanged.connect (_config_connection, MISSING_INVALIDATOR, boost::bind (&MixerStrip::parameter_changed, this, _1), gui_context());
_session->config.ParameterChanged.connect (_config_connection, MISSING_INVALIDATOR, boost::bind (&MixerStrip::parameter_changed, this, _1), gui_context());
//watch for mouse enter/exit so we can do some stuff
signal_enter_notify_event().connect (sigc::mem_fun(*this, &MixerStrip::mixer_strip_enter_event ));
signal_leave_notify_event().connect (sigc::mem_fun(*this, &MixerStrip::mixer_strip_leave_event ));
gpm.LevelMeterButtonPress.connect_same_thread (_level_meter_connection, boost::bind (&MixerStrip::level_meter_button_press, this, _1));
}
@ -401,11 +408,38 @@ MixerStrip::~MixerStrip ()
{
CatchDeletion (this);
if (this ==_entered_mixer_strip)
_entered_mixer_strip = NULL;
delete input_selector;
delete output_selector;
delete comment_window;
}
bool
MixerStrip::mixer_strip_enter_event (GdkEventCrossing *ev)
{
_entered_mixer_strip = this;
return false;
}
bool
MixerStrip::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) ) {
_entered_mixer_strip= 0;
// processor_box.deselect_all_processors();
//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);
}
return false;
}
void
MixerStrip::set_route (boost::shared_ptr<Route> rt)
{
@ -1613,10 +1647,6 @@ MixerStrip::set_selected (bool yn)
}
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

@ -133,6 +133,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void set_selected(bool yn);
bool is_selected() {return _selected;}
static MixerStrip* entered_mixer_strip() { return _entered_mixer_strip; }
protected:
friend class Mixer_UI;
void set_packed (bool yn);
@ -280,6 +282,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
bool ignore_speed_adjustment;
static MixerStrip* _entered_mixer_strip;
void engine_running();
void engine_stopped();
@ -298,6 +302,9 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool input_button);
void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
bool mixer_strip_enter_event ( GdkEventCrossing * );
bool mixer_strip_leave_event ( GdkEventCrossing * );
/** A VisibilityGroup to manage the visibility of some of our controls.
* We fill it with the controls that are being managed, using the same names
* as those used with _mixer_strip_visibility in RCOptionEditor. Then

View File

@ -392,7 +392,6 @@ Mixer_UI::add_strips (RouteList& routes)
strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed));
strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
strip->signal_enter_notify_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_enter_event), strip));
}
} catch (...) {
@ -635,19 +634,6 @@ Mixer_UI::strip_by_route (boost::shared_ptr<Route> r)
return 0;
}
bool
Mixer_UI::strip_enter_event (GdkEventCrossing *ev, MixerStrip *strip)
{
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
; //don't change the current selection, user is doing it manually
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
_selection.add (strip);
} else
_selection.set (strip);
return false;
}
bool
Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
{

View File

@ -249,7 +249,6 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
void group_display_selection_changed ();
bool strip_button_release_event (GdkEventButton*, MixerStrip*);
bool strip_enter_event (GdkEventCrossing*, MixerStrip*);
Width _strip_width;