Compare commits

...

2 Commits

Author SHA1 Message Date
Ben Loftis 0cc9f87baf continued work on modifier semantics (gtk part)
more implementations of group_override_event() and momentary_push_event()
2022-06-21 13:01:30 -05:00
Ben Loftis e557245bf7 implement group_override_modifier() (lib part)
Consistently use Tertiary for Group Override on all platforms (and be consistent about it)

Consistently use Primary-mod for Momentary on all platforms (partially reverts 47932f)
Primary modifier is used for fine-adjust on knobs and sliders, with no analogous operation on switches.
2022-06-21 13:01:30 -05:00
3 changed files with 36 additions and 32 deletions

View File

@ -208,11 +208,11 @@ RouteUI::init ()
mute_button = manage (new ArdourButton); mute_button = manage (new ArdourButton);
mute_button->set_name ("mute button"); mute_button->set_name ("mute button");
std::string tip = string_compose( _("Mute this track\n" std::string tip = string_compose( _("Mute this track\n"
"%1+Click to Override Group\n" "%2+Click to Override Group\n"
"%1+%3+Click to toggle ALL tracks\n" "%1+%3+Click to toggle ALL tracks\n"
"%4 for Momentary mute\n" "%4 for Momentary mute\n"
"Right-Click for Context menu") "Right-Click for Context menu")
, Keyboard::primary_modifier_short_name(), Keyboard::secondary_modifier_short_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::button2_name() ); , Keyboard::primary_modifier_short_name(), Keyboard::group_override_event_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::momentary_push_name() );
UI::instance()->set_tip (mute_button, tip.c_str(), ""); UI::instance()->set_tip (mute_button, tip.c_str(), "");
solo_button = manage (new ArdourButton); solo_button = manage (new ArdourButton);
@ -223,10 +223,10 @@ RouteUI::init ()
rec_enable_button->set_name ("record enable button"); rec_enable_button->set_name ("record enable button");
rec_enable_button->set_icon (ArdourIcon::RecButton); rec_enable_button->set_icon (ArdourIcon::RecButton);
tip = string_compose( _("Enable Recording on this track\n" tip = string_compose( _("Enable Recording on this track\n"
"%1+Click to Override group\n" "%2+Click to Override group\n"
"%1+%3+Click to toggle ALL tracks\n" "%1+%3+Click to toggle ALL tracks\n"
"Right-Click for Context menu") "Right-Click for Context menu")
, Keyboard::primary_modifier_short_name(), Keyboard::secondary_modifier_short_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::button2_name() ); , Keyboard::primary_modifier_short_name(), Keyboard::group_override_event_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::momentary_push_name() );
UI::instance()->set_tip (rec_enable_button, tip.c_str(), ""); UI::instance()->set_tip (rec_enable_button, tip.c_str(), "");
if (UIConfiguration::instance().get_blink_rec_arm()) { if (UIConfiguration::instance().get_blink_rec_arm()) {
@ -522,9 +522,9 @@ RouteUI::mute_press (GdkEventButton* ev)
_session->set_controls (route_list_to_control_list (copy, &Stripable::mute_control), _route->muted_by_self() ? 0.0 : 1.0, Controllable::UseGroup); _session->set_controls (route_list_to_control_list (copy, &Stripable::mute_control), _route->muted_by_self() ? 0.0 : 1.0, Controllable::UseGroup);
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { } else if (Keyboard::is_group_override_event (ev)) {
/* Primary-button1 inverts the implication of /* Tertiary-button1 inverts the implication of
the group being active. If the group is the group being active. If the group is
active (for mute), then this modifier means active (for mute), then this modifier means
"do not apply to mute". If the group is "do not apply to mute". If the group is
@ -686,15 +686,13 @@ RouteUI::solo_press(GdkEventButton* ev)
DisplaySuspender ds; DisplaySuspender ds;
_route->solo_control()->set_value (1.0, Controllable::NoGroup); _route->solo_control()->set_value (1.0, Controllable::NoGroup);
/* } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { do not explicitly implement Tertiary Modifier; this is the default for Momentary */ /* } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { do not explicitly implement Primary Modifier; this is the default for Momentary */
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { /* } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { do not explicitly implement Tertiary Modifier; this is the default for Group-Override */
/* Primary-button1: solo mix group. } else if (Keyboard::is_group_override_event (ev)) {
NOTE: Primary-button2 is MIDI learn.
*/
/* Primary-button1 applies change to the mix group even if it is not active /* Tertiary-button1: override mix group.
NOTE: Primary-button2 is MIDI learn. NOTE: Primary-button2 is MIDI learn.
*/ */
@ -702,7 +700,7 @@ RouteUI::solo_press(GdkEventButton* ev)
if (ev->button == 1) { if (ev->button == 1) {
/* Primary-button1 inverts the implication of /* Tertiary-button1 inverts the implication of
the group being active. If the group is the group being active. If the group is
active (for solo), then this modifier means active (for solo), then this modifier means
"do not apply to solo". If the group is "do not apply to solo". If the group is
@ -718,12 +716,6 @@ RouteUI::solo_press(GdkEventButton* ev)
rl.reset (new RouteList); rl.reset (new RouteList);
rl->push_back (_route); rl->push_back (_route);
#if 0 // XX why? _solo_release is deleted below
if (_solo_release) {
_solo_release->set (rl);
}
#endif
_session->set_controls (route_list_to_control_list (rl, &Stripable::solo_control), !_route->self_soloed(), Controllable::InverseGroup); _session->set_controls (route_list_to_control_list (rl, &Stripable::solo_control), !_route->self_soloed(), Controllable::InverseGroup);
} }
@ -797,9 +789,9 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
_session->set_controls (route_list_to_control_list (_session->get_routes(), &Stripable::rec_enable_control), !track()->rec_enable_control()->get_value(), Controllable::NoGroup); _session->set_controls (route_list_to_control_list (_session->get_routes(), &Stripable::rec_enable_control), !track()->rec_enable_control()->get_value(), Controllable::NoGroup);
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { } else if (Keyboard::is_group_override_event (ev)) {
/* Primary-button1 applies change to the route group (even if it is not active) /* Tertiary-button1 applies change to the route group (even if it is not active)
NOTE: Primary-button2 is MIDI learn. NOTE: Primary-button2 is MIDI learn.
*/ */
@ -913,8 +905,8 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice)
/* Primary-Tertiary-click applies change to all routes */ /* Primary-Tertiary-click applies change to all routes */
rl = _session->get_routes (); rl = _session->get_routes ();
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup); _session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::NoGroup);
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { } else if (Keyboard::is_group_override_event (ev)) {
/* Primary-click overrides group */ /* Tertiary-click overrides group */
rl.reset (new RouteList); rl.reset (new RouteList);
rl->push_back (route()); rl->push_back (route());
_session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::InverseGroup); _session->set_controls (route_list_to_control_list (rl, &Stripable::monitoring_control), (double) mc, Controllable::InverseGroup);
@ -2011,19 +2003,19 @@ RouteUI::update_solo_button ()
if (Config->get_solo_control_is_listen_control()) { if (Config->get_solo_control_is_listen_control()) {
tip = string_compose( _("Listen to this track\n" tip = string_compose( _("Listen to this track\n"
"%1+Click to Override Group\n" "%2+Click to Override Group\n"
"%1+%3+Click to toggle ALL tracks\n" "%1+%3+Click to toggle ALL tracks\n"
"%4 for Momentary listen\n" "%4 for Momentary listen\n"
"Right-Click for Context menu") "Right-Click for Context menu")
, Keyboard::primary_modifier_short_name(), Keyboard::secondary_modifier_short_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::button2_name() ); , Keyboard::primary_modifier_short_name(), Keyboard::group_override_event_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::momentary_push_name() );
} else { } else {
tip = string_compose( _("Solo this track\n" tip = string_compose( _("Solo this track\n"
"%1+Click to Override Group\n" "%2+Click to Override Group\n"
"%1+%2+Click for Exclusive solo\n" "%1+%5+Click for Exclusive solo\n"
"%1+%3+Click to toggle ALL tracks\n" "%1+%3+Click to toggle ALL tracks\n"
"%4 for Momentary solo\n" "%4 for Momentary solo\n"
"Right-Click for Context menu") "Right-Click for Context menu")
, Keyboard::primary_modifier_short_name(), Keyboard::secondary_modifier_short_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::button2_name() ); , Keyboard::primary_modifier_short_name(), Keyboard::group_override_event_name(), Keyboard::tertiary_modifier_short_name(), Keyboard::momentary_push_name(), Keyboard::secondary_modifier_short_name() );
} }
UI::instance()->set_tip (solo_button, tip.c_str()); UI::instance()->set_tip (solo_button, tip.c_str());
} }

View File

@ -80,6 +80,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static const char* button2_name (); static const char* button2_name ();
static const char* momentary_push_name (); static const char* momentary_push_name ();
static const char* group_override_event_name ();
static const char* primary_modifier_short_name (); static const char* primary_modifier_short_name ();
static const char* secondary_modifier_short_name (); static const char* secondary_modifier_short_name ();
@ -165,6 +166,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static bool is_context_menu_event (GdkEventButton*); static bool is_context_menu_event (GdkEventButton*);
static bool is_button2_event (GdkEventButton*); static bool is_button2_event (GdkEventButton*);
static bool is_momentary_push_event (GdkEventButton*); static bool is_momentary_push_event (GdkEventButton*);
static bool is_group_override_event (GdkEventButton*);
static Keyboard& the_keyboard() { return *_the_keyboard; } static Keyboard& the_keyboard() { return *_the_keyboard; }
@ -212,6 +214,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static guint snap_delta_mod; static guint snap_delta_mod;
static guint button2_modifiers; static guint button2_modifiers;
static guint momentary_push_modifiers; static guint momentary_push_modifiers;
static guint group_override_modifiers;
static Gtk::Window* current_window; static Gtk::Window* current_window;
static std::string user_keybindings_path; static std::string user_keybindings_path;
static bool can_save_keybindings; static bool can_save_keybindings;

View File

@ -71,7 +71,6 @@ guint Keyboard::Level4Modifier = GDK_MOD1_MASK; // Alt/Option
guint Keyboard::CopyModifier = GDK_CONTROL_MASK; // Control guint Keyboard::CopyModifier = GDK_CONTROL_MASK; // Control
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK; guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
guint Keyboard::button2_modifiers = Keyboard::SecondaryModifier|Keyboard::Level4Modifier; guint Keyboard::button2_modifiers = Keyboard::SecondaryModifier|Keyboard::Level4Modifier;
guint Keyboard::momentary_push_modifiers = Keyboard::TertiaryModifier;
const char* Keyboard::primary_modifier_name() { return _("Command"); } const char* Keyboard::primary_modifier_name() { return _("Command"); }
const char* Keyboard::secondary_modifier_name() { return _("Control"); } const char* Keyboard::secondary_modifier_name() { return _("Control"); }
@ -79,7 +78,7 @@ const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
const char* Keyboard::level4_modifier_name() { return _("Option"); } const char* Keyboard::level4_modifier_name() { return _("Option"); }
const char* Keyboard::button2_name() { return _("Middle Click (or Ctrl+Alt+Click)"); } // TODO build dynamically depending on Keyboard::button2_modifiers const char* Keyboard::button2_name() { return _("Middle Click (or Ctrl+Alt+Click)"); } // TODO build dynamically depending on Keyboard::button2_modifiers
const char* Keyboard::momentary_push_name() { return _("Shift+Click (or Middle-Click)"); } // TODO formay dynamically depending on Keyboard::momentary_push_modifiers -- Keyboard::tertiary_modifier_name const char* Keyboard::momentary_push_name() { return _("Cmd+Click (or Middle-Click)"); } // TODO formay dynamically depending on Keyboard::momentary_push_modifiers -- Keyboard::tertiary_modifier_name
const char* Keyboard::primary_modifier_short_name() { return _("Cmd"); } const char* Keyboard::primary_modifier_short_name() { return _("Cmd"); }
const char* Keyboard::secondary_modifier_short_name() { return _("Ctrl"); } const char* Keyboard::secondary_modifier_short_name() { return _("Ctrl"); }
@ -98,7 +97,6 @@ guint Keyboard::Level4Modifier = GDK_MOD4_MASK|GDK_SUPER_MASK; // Mod4/Windows
guint Keyboard::CopyModifier = GDK_CONTROL_MASK; guint Keyboard::CopyModifier = GDK_CONTROL_MASK;
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK; guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
guint Keyboard::button2_modifiers = 0; /* not used */ guint Keyboard::button2_modifiers = 0; /* not used */
guint Keyboard::momentary_push_modifiers = 0; /* not used */
const char* Keyboard::primary_modifier_name() { return _("Control"); } const char* Keyboard::primary_modifier_name() { return _("Control"); }
const char* Keyboard::secondary_modifier_name() { return _("Alt"); } const char* Keyboard::secondary_modifier_name() { return _("Alt"); }
@ -106,7 +104,7 @@ const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
const char* Keyboard::level4_modifier_name() { return _("Windows"); } const char* Keyboard::level4_modifier_name() { return _("Windows"); }
const char* Keyboard::button2_name() { return _("Middle-Click"); } const char* Keyboard::button2_name() { return _("Middle-Click"); }
const char* Keyboard::momentary_push_name() { return _("Middle-Click"); } const char* Keyboard::momentary_push_name() { return _("Cmd+Click or Middle-Click"); }
const char* Keyboard::primary_modifier_short_name() { return _("Ctrl"); } const char* Keyboard::primary_modifier_short_name() { return _("Ctrl"); }
const char* Keyboard::secondary_modifier_short_name() { return _("Alt"); } const char* Keyboard::secondary_modifier_short_name() { return _("Alt"); }
@ -118,6 +116,11 @@ guint Keyboard::snap_delta_mod = Keyboard::SecondaryModifier|Keyboard::Level4Mod
#endif #endif
guint Keyboard::momentary_push_modifiers = Keyboard::PrimaryModifier;
guint Keyboard::group_override_modifiers = Keyboard::TertiaryModifier;
const char* Keyboard::group_override_event_name() { return tertiary_modifier_name(); }
guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier; guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier;
guint Keyboard::GainExtraFineScaleModifier = Keyboard::SecondaryModifier; guint Keyboard::GainExtraFineScaleModifier = Keyboard::SecondaryModifier;
@ -554,6 +557,12 @@ Keyboard::is_momentary_push_event (GdkEventButton* ev)
((ev->state & RelevantModifierKeyMask) == Keyboard::momentary_push_modifiers)); ((ev->state & RelevantModifierKeyMask) == Keyboard::momentary_push_modifiers));
} }
bool
Keyboard::is_group_override_event (GdkEventButton* ev)
{
return ((ev->button == 1) && ((ev->state & RelevantModifierKeyMask) == Keyboard::group_override_modifiers));
}
bool bool
Keyboard::is_delete_event (GdkEventButton *ev) Keyboard::is_delete_event (GdkEventButton *ev)
{ {