Move ui-centric modifiers into ArdourKeyboard, set some bad defaults.
- Also makes "Mod4" Appear as "Windows" and adds new combination "Alt-Windows" to the dropdown. - Attempt to set a pair of default snap modifiers (without knowing what it actually is for OSX) - Copy modifier now saves - Snap modifier modifier problem still remains.
This commit is contained in:
@@ -2352,7 +2352,7 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
|
||||
|
||||
_item->grab ();
|
||||
|
||||
if (event->motion.state & Keyboard::note_size_relative_modifier ()) {
|
||||
if (event->motion.state & ArdourKeyboard::note_size_relative_modifier ()) {
|
||||
relative = false;
|
||||
} else {
|
||||
relative = true;
|
||||
@@ -2615,7 +2615,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
framepos_t const pf = adjusted_current_frame (event);
|
||||
setup_snap_delta (region_start);
|
||||
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_contents_modifier ())) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::trim_contents_modifier ())) {
|
||||
/* Move the contents of the region around without changing the region bounds */
|
||||
_operation = ContentsTrim;
|
||||
Drag::start_grab (event, _editor->cursors()->trimmer);
|
||||
@@ -2624,7 +2624,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
if (pf < (region_start + region_length/2)) {
|
||||
/* closer to front */
|
||||
_operation = StartTrim;
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_anchored_modifier ())) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::trim_anchored_modifier ())) {
|
||||
Drag::start_grab (event, _editor->cursors()->anchored_left_side_trim);
|
||||
} else {
|
||||
Drag::start_grab (event, _editor->cursors()->left_side_trim);
|
||||
@@ -2632,17 +2632,18 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
} else {
|
||||
/* closer to end */
|
||||
_operation = EndTrim;
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_anchored_modifier ())) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::trim_anchored_modifier ())) {
|
||||
Drag::start_grab (event, _editor->cursors()->anchored_right_side_trim);
|
||||
} else {
|
||||
Drag::start_grab (event, _editor->cursors()->right_side_trim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* jump trim disabled for now
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_jump_modifier ())) {
|
||||
_jump_position_when_done = true;
|
||||
}
|
||||
*/
|
||||
|
||||
switch (_operation) {
|
||||
case StartTrim:
|
||||
@@ -2725,7 +2726,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||
|
||||
bool non_overlap_trim = false;
|
||||
|
||||
if (event && Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_overlap_modifier ())) {
|
||||
if (event && Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::trim_overlap_modifier ())) {
|
||||
non_overlap_trim = true;
|
||||
}
|
||||
|
||||
@@ -3735,7 +3736,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
|
||||
framepos_t const newframe = adjusted_current_frame (event);
|
||||
framepos_t next = newframe;
|
||||
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::push_points_modifier ())) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::push_points_modifier ())) {
|
||||
move_both = true;
|
||||
}
|
||||
|
||||
@@ -4002,7 +4003,7 @@ ControlPointDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/)
|
||||
|
||||
show_verbose_cursor_text (_point->line().get_verbose_cursor_string (fraction));
|
||||
|
||||
_pushing = Keyboard::modifier_state_contains (event->button.state, Keyboard::push_points_modifier ());
|
||||
_pushing = Keyboard::modifier_state_contains (event->button.state, ArdourKeyboard::push_points_modifier ());
|
||||
|
||||
if (!_point->can_slide ()) {
|
||||
_x_constrained = true;
|
||||
@@ -4015,7 +4016,7 @@ ControlPointDrag::motion (GdkEvent* event, bool)
|
||||
double dx = _drags->current_pointer_x() - last_pointer_x();
|
||||
double dy = current_pointer_y() - last_pointer_y();
|
||||
|
||||
if (event->button.state & Keyboard::fine_adjust_modifier ()) {
|
||||
if (event->button.state & ArdourKeyboard::fine_adjust_modifier ()) {
|
||||
dx *= 0.1;
|
||||
dy *= 0.1;
|
||||
}
|
||||
@@ -4154,7 +4155,7 @@ LineDrag::motion (GdkEvent* event, bool)
|
||||
{
|
||||
double dy = current_pointer_y() - last_pointer_y();
|
||||
|
||||
if (event->button.state & Keyboard::fine_adjust_modifier ()) {
|
||||
if (event->button.state & ArdourKeyboard::fine_adjust_modifier ()) {
|
||||
dy *= 0.1;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,13 @@ accel_map_changed (GtkAccelMap* /*map*/,
|
||||
me->ui.setup_tooltips ();
|
||||
}
|
||||
|
||||
guint ArdourKeyboard::trim_contents_mod = Keyboard::PrimaryModifier;
|
||||
guint ArdourKeyboard::trim_overlap_mod = Keyboard::TertiaryModifier;
|
||||
guint ArdourKeyboard::trim_anchored_mod = Keyboard::TertiaryModifier;
|
||||
guint ArdourKeyboard::fine_adjust_mod = Keyboard::SecondaryModifier;
|
||||
guint ArdourKeyboard::push_points_mod = Keyboard::PrimaryModifier;
|
||||
guint ArdourKeyboard::note_size_relative_mod = Keyboard::PrimaryModifier;
|
||||
|
||||
void
|
||||
ArdourKeyboard::setup_keybindings ()
|
||||
{
|
||||
@@ -174,6 +181,108 @@ ArdourKeyboard::setup_keybindings ()
|
||||
g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, this);
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
ArdourKeyboard::get_state (void)
|
||||
{
|
||||
XMLNode* node = &Keyboard::get_state ();
|
||||
char buf[32];
|
||||
|
||||
snprintf (buf, sizeof (buf), "%d", trim_contents_mod);
|
||||
node->add_property ("trim-contents-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_overlap_mod);
|
||||
node->add_property ("trim-overlap-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_anchored_mod);
|
||||
node->add_property ("trim-anchored-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", fine_adjust_mod);
|
||||
node->add_property ("fine-adjust-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", push_points_mod);
|
||||
node->add_property ("push-points-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", note_size_relative_mod);
|
||||
node->add_property ("note-size-relative-modifier", buf);
|
||||
|
||||
return *node;
|
||||
}
|
||||
|
||||
int
|
||||
ArdourKeyboard::set_state (const XMLNode& node, int version)
|
||||
{
|
||||
const XMLProperty* prop;
|
||||
|
||||
if ((prop = node.property ("trim-contents-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_contents_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-overlap-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_overlap_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-anchored-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_anchored_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("fine-adjust-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &fine_adjust_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("push-points-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &push_points_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("note-size-relative-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", ¬e_size_relative_mod);
|
||||
}
|
||||
|
||||
return Keyboard::set_state (node, version);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_trim_contents_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_contents_mod);
|
||||
trim_contents_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_contents_mod);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_trim_overlap_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_overlap_mod);
|
||||
trim_overlap_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_overlap_mod);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_trim_anchored_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_anchored_mod);
|
||||
trim_anchored_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_anchored_mod);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_fine_adjust_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~fine_adjust_mod);
|
||||
fine_adjust_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | fine_adjust_mod);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_push_points_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~push_points_mod);
|
||||
push_points_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | push_points_mod);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourKeyboard::set_note_size_relative_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~note_size_relative_mod);
|
||||
note_size_relative_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | note_size_relative_mod);
|
||||
}
|
||||
|
||||
Selection::Operation
|
||||
ArdourKeyboard::selection_type (guint state)
|
||||
{
|
||||
|
||||
@@ -32,11 +32,51 @@ class ArdourKeyboard : public Gtkmm2ext::Keyboard
|
||||
public:
|
||||
ArdourKeyboard(ARDOUR_UI& ardour_ui) : ui(ardour_ui) {}
|
||||
|
||||
XMLNode& get_state (void);
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
void setup_keybindings ();
|
||||
|
||||
static Selection::Operation selection_type (guint state);
|
||||
|
||||
ARDOUR_UI& ui;
|
||||
|
||||
static void set_trim_contents_modifier (guint);
|
||||
/** @return Modifier mask to move contents rather than region bounds during trim;
|
||||
*/
|
||||
static ModifierMask trim_contents_modifier () { return ModifierMask (trim_contents_mod); }
|
||||
|
||||
static void set_trim_overlap_modifier (guint);
|
||||
/** @return Modifier mask to remove region overlaps during trim;
|
||||
*/
|
||||
static ModifierMask trim_overlap_modifier () { return ModifierMask (trim_overlap_mod); }
|
||||
|
||||
static void set_trim_anchored_modifier (guint);
|
||||
/** @return Modifier mask to use anchored trim;
|
||||
*/
|
||||
static ModifierMask trim_anchored_modifier () { return ModifierMask (trim_anchored_mod); }
|
||||
|
||||
static void set_fine_adjust_modifier (guint);
|
||||
/** @return Modifier mask to fine adjust (control points only atm);
|
||||
*/
|
||||
static ModifierMask fine_adjust_modifier () { return ModifierMask (fine_adjust_mod); }
|
||||
|
||||
static void set_push_points_modifier (guint);
|
||||
/** @return Modifier mask to push proceeding points;
|
||||
*/
|
||||
static ModifierMask push_points_modifier () { return ModifierMask (push_points_mod); }
|
||||
|
||||
static void set_note_size_relative_modifier (guint);
|
||||
/** @return Modifier mask to resize notes relatively;
|
||||
*/
|
||||
static ModifierMask note_size_relative_modifier () { return ModifierMask (note_size_relative_mod); }
|
||||
private:
|
||||
static guint trim_contents_mod;
|
||||
static guint trim_overlap_mod;
|
||||
static guint trim_anchored_mod;
|
||||
static guint fine_adjust_mod;
|
||||
static guint push_points_mod;
|
||||
static guint note_size_relative_mod;
|
||||
};
|
||||
|
||||
#endif /* __ardour_keyboard_h__ */
|
||||
|
||||
@@ -277,14 +277,15 @@ static const struct {
|
||||
#else
|
||||
{ "Key|Shift", GDK_SHIFT_MASK },
|
||||
{ "Control", GDK_CONTROL_MASK },
|
||||
{ "Alt (Mod1)", GDK_MOD1_MASK },
|
||||
{ "Alt", GDK_MOD1_MASK },
|
||||
{ "Control-Shift", GDK_CONTROL_MASK|GDK_SHIFT_MASK },
|
||||
{ "Control-Alt", GDK_CONTROL_MASK|GDK_MOD1_MASK },
|
||||
{ "Shift-Alt", GDK_SHIFT_MASK|GDK_MOD1_MASK },
|
||||
{ "Control-Shift-Alt", GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
|
||||
{ "Alt-Windows", GDK_MOD1_MASK|GDK_MOD4_MASK },
|
||||
{ "Mod2", GDK_MOD2_MASK },
|
||||
{ "Mod3", GDK_MOD3_MASK },
|
||||
{ "Mod4", GDK_MOD4_MASK },
|
||||
{ "Windows", GDK_MOD4_MASK },
|
||||
{ "Mod5", GDK_MOD5_MASK },
|
||||
#endif
|
||||
{ 0, 0 }
|
||||
@@ -465,7 +466,7 @@ public:
|
||||
_trim_contents_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::trim_contents_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::trim_contents_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::trim_contents_modifier ()) {
|
||||
_trim_contents_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -485,7 +486,7 @@ public:
|
||||
_trim_anchored_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::trim_anchored_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::trim_anchored_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::trim_anchored_modifier ()) {
|
||||
_trim_anchored_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -499,9 +500,9 @@ public:
|
||||
t->attach (_trim_anchored_combo, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
|
||||
|
||||
++row;
|
||||
col = 1;
|
||||
col = 1;
|
||||
|
||||
/* jump trim */
|
||||
/* jump trim disabled for now
|
||||
set_popdown_strings (_trim_jump_combo, dumb);
|
||||
_trim_jump_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::trim_jump_modifier_chosen));
|
||||
|
||||
@@ -521,13 +522,14 @@ public:
|
||||
|
||||
++row;
|
||||
col = 1;
|
||||
*/
|
||||
|
||||
/* note resize relative */
|
||||
set_popdown_strings (_note_size_relative_combo, dumb);
|
||||
_note_size_relative_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::note_size_relative_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::note_size_relative_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::note_size_relative_modifier ()) {
|
||||
_note_size_relative_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -600,7 +602,7 @@ public:
|
||||
_trim_overlap_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::trim_overlap_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::trim_overlap_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::trim_overlap_modifier ()) {
|
||||
_trim_overlap_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -626,7 +628,7 @@ public:
|
||||
_fine_adjust_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::fine_adjust_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::fine_adjust_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::fine_adjust_modifier ()) {
|
||||
_fine_adjust_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -646,7 +648,7 @@ public:
|
||||
_push_points_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::push_points_modifier_chosen));
|
||||
|
||||
for (int x = 0; modifiers[x].name; ++x) {
|
||||
if (modifiers[x].modifier == (guint) Keyboard::push_points_modifier ()) {
|
||||
if (modifiers[x].modifier == (guint) ArdourKeyboard::push_points_modifier ()) {
|
||||
_push_points_combo.set_active_text (S_(modifiers[x].name));
|
||||
break;
|
||||
}
|
||||
@@ -658,8 +660,6 @@ public:
|
||||
t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
|
||||
t->attach (_push_points_combo, col + 1, col + 2, row, row + 1, FILL | EXPAND, FILL);
|
||||
|
||||
++row;
|
||||
|
||||
_box->pack_start (*t, false, false);
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_trim_contents_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_trim_contents_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -780,7 +780,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_trim_overlap_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_trim_overlap_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -792,19 +792,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_trim_anchored_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void trim_jump_modifier_chosen ()
|
||||
{
|
||||
string const txt = _trim_jump_combo.get_active_text();
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_trim_jump_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_trim_anchored_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -816,7 +804,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_fine_adjust_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_fine_adjust_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -828,7 +816,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_push_points_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_push_points_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -840,7 +828,7 @@ private:
|
||||
|
||||
for (int i = 0; modifiers[i].name; ++i) {
|
||||
if (txt == _(modifiers[i].name)) {
|
||||
Keyboard::set_note_size_relative_modifier (modifiers[i].modifier);
|
||||
ArdourKeyboard::set_note_size_relative_modifier (modifiers[i].modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,41 +126,6 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
|
||||
*/
|
||||
static ModifierMask snap_delta_modifier () { return ModifierMask (snap_delta_mod); }
|
||||
|
||||
static void set_trim_contents_modifier (guint);
|
||||
/** @return Modifier mask to move contents rather than region bounds during trim;
|
||||
*/
|
||||
static ModifierMask trim_contents_modifier () { return ModifierMask (trim_contents_mod); }
|
||||
|
||||
static void set_trim_overlap_modifier (guint);
|
||||
/** @return Modifier mask to remove region overlaps during trim;
|
||||
*/
|
||||
static ModifierMask trim_overlap_modifier () { return ModifierMask (trim_overlap_mod); }
|
||||
|
||||
static void set_trim_anchored_modifier (guint);
|
||||
/** @return Modifier mask to use anchored trim;
|
||||
*/
|
||||
static ModifierMask trim_anchored_modifier () { return ModifierMask (trim_anchored_mod); }
|
||||
|
||||
static void set_fine_adjust_modifier (guint);
|
||||
/** @return Modifier mask to fine adjust (control points only atm);
|
||||
*/
|
||||
static ModifierMask fine_adjust_modifier () { return ModifierMask (fine_adjust_mod); }
|
||||
|
||||
static void set_push_points_modifier (guint);
|
||||
/** @return Modifier mask to push proceeding points;
|
||||
*/
|
||||
static ModifierMask push_points_modifier () { return ModifierMask (push_points_mod); }
|
||||
|
||||
static void set_note_size_relative_modifier (guint);
|
||||
/** @return Modifier mask to resize notes relatively;
|
||||
*/
|
||||
static ModifierMask note_size_relative_modifier () { return ModifierMask (note_size_relative_mod); }
|
||||
|
||||
static void set_trim_jump_modifier (guint);
|
||||
/** @return Modifier mask to jump position after trim;
|
||||
*/
|
||||
static ModifierMask trim_jump_modifier () { return ModifierMask (trim_jump_mod); }
|
||||
|
||||
static guint edit_button() { return edit_but; }
|
||||
static void set_edit_button (guint);
|
||||
static guint edit_modifier() { return edit_mod; }
|
||||
@@ -226,13 +191,6 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
|
||||
static guint insert_note_mod;
|
||||
static guint snap_mod;
|
||||
static guint snap_delta_mod;
|
||||
static guint trim_contents_mod;
|
||||
static guint trim_overlap_mod;
|
||||
static guint trim_anchored_mod;
|
||||
static guint fine_adjust_mod;
|
||||
static guint push_points_mod;
|
||||
static guint note_size_relative_mod;
|
||||
static guint trim_jump_mod;
|
||||
static guint button2_modifiers;
|
||||
static Gtk::Window* current_window;
|
||||
static std::string user_keybindings_path;
|
||||
|
||||
@@ -58,8 +58,6 @@ guint Keyboard::delete_but = 3;
|
||||
guint Keyboard::delete_mod = GDK_SHIFT_MASK;
|
||||
guint Keyboard::insert_note_but = 1;
|
||||
guint Keyboard::insert_note_mod = GDK_CONTROL_MASK;
|
||||
guint Keyboard::snap_mod = GDK_MOD3_MASK;
|
||||
guint Keyboard::snap_delta_mod = 0;
|
||||
|
||||
#ifdef GTKOSX
|
||||
|
||||
@@ -78,6 +76,9 @@ const char* Keyboard::level4_modifier_name() { return _("Option"); }
|
||||
const char* Keyboard::copy_modifier_name() { return _("Control"); }
|
||||
const char* Keyboard::rangeselect_modifier_name() { return S_("Key|Shift"); }
|
||||
|
||||
guint Keyboard::snap_mod = GDK_MOD3_MASK|Keyboard::Level4Modifier; // XXX this is probably completely wrong
|
||||
guint Keyboard::snap_delta_mod = GDK_MOD3_MASK;
|
||||
|
||||
#else
|
||||
|
||||
guint Keyboard::PrimaryModifier = GDK_CONTROL_MASK; // Control
|
||||
@@ -95,6 +96,9 @@ const char* Keyboard::level4_modifier_name() { return _("Meta"); }
|
||||
const char* Keyboard::copy_modifier_name() { return _("Control"); }
|
||||
const char* Keyboard::rangeselect_modifier_name() { return S_("Key|Shift"); }
|
||||
|
||||
guint Keyboard::snap_mod = Keyboard::SecondaryModifier|Keyboard::Level4Modifier;
|
||||
guint Keyboard::snap_delta_mod = Keyboard::SecondaryModifier;
|
||||
|
||||
#endif
|
||||
|
||||
guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier;
|
||||
@@ -104,14 +108,6 @@ guint Keyboard::ScrollZoomVerticalModifier = Keyboard::SecondaryModifier;
|
||||
guint Keyboard::ScrollZoomHorizontalModifier = Keyboard::PrimaryModifier;
|
||||
guint Keyboard::ScrollHorizontalModifier = Keyboard::TertiaryModifier;
|
||||
|
||||
guint Keyboard::trim_contents_mod = Keyboard::PrimaryModifier;
|
||||
guint Keyboard::trim_overlap_mod = Keyboard::TertiaryModifier;
|
||||
guint Keyboard::trim_anchored_mod = Keyboard::TertiaryModifier;
|
||||
guint Keyboard::trim_jump_mod = Keyboard::TertiaryModifier;
|
||||
guint Keyboard::fine_adjust_mod = Keyboard::SecondaryModifier;
|
||||
guint Keyboard::push_points_mod = Keyboard::PrimaryModifier;
|
||||
guint Keyboard::note_size_relative_mod = Keyboard::PrimaryModifier;
|
||||
|
||||
Keyboard* Keyboard::_the_keyboard = 0;
|
||||
Gtk::Window* Keyboard::current_window = 0;
|
||||
bool Keyboard::_some_magic_widget_has_focus = false;
|
||||
@@ -177,6 +173,8 @@ Keyboard::get_state (void)
|
||||
XMLNode* node = new XMLNode ("Keyboard");
|
||||
char buf[32];
|
||||
|
||||
snprintf (buf, sizeof (buf), "%d", CopyModifier);
|
||||
node->add_property ("copy-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", edit_but);
|
||||
node->add_property ("edit-button", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", edit_mod);
|
||||
@@ -189,20 +187,6 @@ Keyboard::get_state (void)
|
||||
node->add_property ("snap-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", snap_delta_mod);
|
||||
node->add_property ("snap-delta-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_contents_mod);
|
||||
node->add_property ("trim-contents-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_overlap_mod);
|
||||
node->add_property ("trim-overlap-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_anchored_mod);
|
||||
node->add_property ("trim-anchored-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", trim_jump_mod);
|
||||
node->add_property ("trim-jump-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", fine_adjust_mod);
|
||||
node->add_property ("fine-adjust-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", push_points_mod);
|
||||
node->add_property ("push-points-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", note_size_relative_mod);
|
||||
node->add_property ("note-size-relative-modifier", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", insert_note_but);
|
||||
node->add_property ("insert-note-button", buf);
|
||||
snprintf (buf, sizeof (buf), "%d", insert_note_mod);
|
||||
@@ -216,6 +200,10 @@ Keyboard::set_state (const XMLNode& node, int /*version*/)
|
||||
{
|
||||
const XMLProperty* prop;
|
||||
|
||||
if ((prop = node.property ("copy-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &CopyModifier);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("edit-button")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &edit_but);
|
||||
}
|
||||
@@ -240,34 +228,6 @@ Keyboard::set_state (const XMLNode& node, int /*version*/)
|
||||
sscanf (prop->value().c_str(), "%d", &snap_delta_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-contents-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_contents_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-overlap-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_overlap_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-anchored-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_anchored_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("trim-jump-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &trim_jump_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("fine-adjust-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &fine_adjust_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("push-points-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &push_points_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("note-size-relative-modifier")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", ¬e_size_relative_mod);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("insert-note-button")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%d", &insert_note_but);
|
||||
}
|
||||
@@ -530,62 +490,6 @@ Keyboard::set_snap_delta_modifier (guint mod)
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | snap_delta_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_trim_contents_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_contents_mod);
|
||||
trim_contents_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_contents_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_trim_overlap_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_overlap_mod);
|
||||
trim_overlap_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_overlap_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_trim_anchored_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_anchored_mod);
|
||||
trim_anchored_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_anchored_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_trim_jump_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~trim_jump_mod);
|
||||
trim_jump_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | trim_jump_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_fine_adjust_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~fine_adjust_mod);
|
||||
fine_adjust_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | fine_adjust_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_push_points_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~push_points_mod);
|
||||
push_points_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | push_points_mod);
|
||||
}
|
||||
|
||||
void
|
||||
Keyboard::set_note_size_relative_modifier (guint mod)
|
||||
{
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask & ~note_size_relative_mod);
|
||||
note_size_relative_mod = mod;
|
||||
RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | note_size_relative_mod);
|
||||
}
|
||||
|
||||
bool
|
||||
Keyboard::is_edit_event (GdkEventButton *ev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user