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
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);
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 */
#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
{
//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);
BOOST_FOREACH(RouteUI* r, _route_targets) {
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
if (ms) {
- ms->delete_processors ();
+ ms->select_all_processors ();
}
}
}
using namespace std;
using namespace ArdourMeter;
+MixerStrip* MixerStrip::_entered_mixer_strip;
+
int MixerStrip::scrollbar_height = 0;
PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
{
int button_table_row = 0;
+ _entered_mixer_strip= 0;
input_selector = 0;
output_selector = 0;
group_menu = 0;
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));
}
{
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)
{
}
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
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);
bool ignore_speed_adjustment;
+ static MixerStrip* _entered_mixer_strip;
+
void engine_running();
void engine_stopped();
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
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 (...) {
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)
{
void group_display_selection_changed ();
bool strip_button_release_event (GdkEventButton*, MixerStrip*);
- bool strip_enter_event (GdkEventCrossing*, MixerStrip*);
Width _strip_width;