summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc29
-rw-r--r--gtk2_ardour/editor_drag.h1
-rw-r--r--gtk2_ardour/rc_option_editor.cc173
3 files changed, 194 insertions, 9 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index ca45cbc755..ca0a126e9d 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -2352,7 +2352,7 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
_item->grab ();
- if (event->motion.state & Keyboard::PrimaryModifier) {
+ if (event->motion.state & Keyboard::note_size_relative_modifier ()) {
relative = false;
} else {
relative = true;
@@ -2592,6 +2592,7 @@ VideoTimeLineDrag::aborted (bool)
TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool preserve_fade_anchor)
: RegionDrag (e, i, p, v)
, _preserve_fade_anchor (preserve_fade_anchor)
+ , _jump_position_when_done (false)
{
DEBUG_TRACE (DEBUG::Drags, "New TrimDrag\n");
}
@@ -2623,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::PrimaryModifier)) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_anchored_modifier ())) {
Drag::start_grab (event, _editor->cursors()->anchored_left_side_trim);
} else {
Drag::start_grab (event, _editor->cursors()->left_side_trim);
@@ -2631,7 +2632,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
} else {
/* closer to end */
_operation = EndTrim;
- if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_anchored_modifier ())) {
Drag::start_grab (event, _editor->cursors()->anchored_right_side_trim);
} else {
Drag::start_grab (event, _editor->cursors()->right_side_trim);
@@ -2639,6 +2640,10 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
}
}
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::trim_jump_modifier ())) {
+ _jump_position_when_done = true;
+ }
+
switch (_operation) {
case StartTrim:
show_verbose_cursor_time (region_start);
@@ -2838,6 +2843,9 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
ar->set_fade_in_active(true);
}
}
+ if (_jump_position_when_done) {
+ i->view->region()->set_position (i->initial_position);
+ }
}
} else if (_operation == EndTrim) {
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
@@ -2850,6 +2858,9 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
ar->set_fade_out_active(true);
}
}
+ if (_jump_position_when_done) {
+ i->view->region()->set_position (i->initial_end - i->view->region()->length());
+ }
}
}
@@ -3724,7 +3735,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::PrimaryModifier)) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::push_points_modifier ())) {
move_both = true;
}
@@ -3991,7 +4002,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::PrimaryModifier);
+ _pushing = Keyboard::modifier_state_contains (event->button.state, Keyboard::push_points_modifier ());
if (!_point->can_slide ()) {
_x_constrained = true;
@@ -4004,7 +4015,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::SecondaryModifier) {
+ if (event->button.state & Keyboard::fine_adjust_modifier ()) {
dx *= 0.1;
dy *= 0.1;
}
@@ -4059,7 +4070,7 @@ ControlPointDrag::finished (GdkEvent* event, bool movement_occurred)
if (!movement_occurred) {
/* just a click */
- if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier))) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::TertiaryModifier))) {
_editor->reset_point_selection ();
}
@@ -4143,7 +4154,7 @@ LineDrag::motion (GdkEvent* event, bool)
{
double dy = current_pointer_y() - last_pointer_y();
- if (event->button.state & Keyboard::SecondaryModifier) {
+ if (event->button.state & Keyboard::fine_adjust_modifier ()) {
dy *= 0.1;
}
@@ -4935,7 +4946,7 @@ RangeMarkerBarDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
case CreateTransportMarker:
case CreateCDMarker:
- if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::CopyModifier)) {
_copy = true;
} else {
_copy = false;
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 4ed77999bf..2197f5601e 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -654,6 +654,7 @@ private:
Operation _operation;
bool _preserve_fade_anchor;
+ bool _jump_position_when_done;
};
/** Meter marker drag */
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 4df3ff2c2b..4fefcfada1 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -478,6 +478,69 @@ public:
t->attach (_trim_contents_combo, col + 1, col + 2, row, row + 1, FILL | EXPAND, FILL);
++row;
+ col = 1;
+
+ /* anchored trim */
+ set_popdown_strings (_trim_anchored_combo, dumb);
+ _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 ()) {
+ _trim_anchored_combo.set_active_text (S_(modifiers[x].name));
+ break;
+ }
+ }
+
+ l = manage (left_aligned_label (_("Anchored trim using:")));
+ l->set_name ("OptionsLabel");
+
+ t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+ ++col;
+ t->attach (_trim_anchored_combo, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+
+ ++row;
+ col = 1;
+
+ /* jump trim */
+ set_popdown_strings (_trim_jump_combo, dumb);
+ _trim_jump_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::trim_jump_modifier_chosen));
+
+ for (int x = 0; modifiers[x].name; ++x) {
+ if (modifiers[x].modifier == (guint) Keyboard::trim_jump_modifier ()) {
+ _trim_jump_combo.set_active_text (S_(modifiers[x].name));
+ break;
+ }
+ }
+
+ l = manage (left_aligned_label (_("Jump after trim using:")));
+ l->set_name ("OptionsLabel");
+
+ t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+ ++col;
+ t->attach (_trim_jump_combo, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+
+ ++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 ()) {
+ _note_size_relative_combo.set_active_text (S_(modifiers[x].name));
+ break;
+ }
+ }
+
+ l = manage (left_aligned_label (_("Resize notes relatively using:")));
+ l->set_name ("OptionsLabel");
+
+ t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+ ++col;
+ t->attach (_note_size_relative_combo, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+
+ ++row;
l = manage (left_aligned_label (_("While Dragging:")));
l->set_name ("OptionEditorHeading");
@@ -550,6 +613,51 @@ public:
t->attach (_trim_overlap_combo, col + 1, col + 2, row, row + 1, FILL | EXPAND, FILL);
++row;
+
+ l = manage (left_aligned_label (_("While Dragging Control Points:")));
+ l->set_name ("OptionEditorHeading");
+ t->attach (*l, 0, 1, row, row + 1, FILL | EXPAND, FILL);
+
+ ++row;
+ col = 1;
+
+ /* fine adjust */
+ set_popdown_strings (_fine_adjust_combo, dumb);
+ _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 ()) {
+ _fine_adjust_combo.set_active_text (S_(modifiers[x].name));
+ break;
+ }
+ }
+
+ l = manage (left_aligned_label (_("Fine adjust using:")));
+ l->set_name ("OptionsLabel");
+
+ t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL);
+ t->attach (_fine_adjust_combo, col + 1, col + 2, row, row + 1, FILL | EXPAND, FILL);
+
+ ++row;
+ col = 1;
+
+ /* push points */
+ set_popdown_strings (_push_points_combo, dumb);
+ _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 ()) {
+ _push_points_combo.set_active_text (S_(modifiers[x].name));
+ break;
+ }
+ }
+
+ l = manage (left_aligned_label (_("Push points using:")));
+ l->set_name ("OptionsLabel");
+
+ 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);
@@ -678,6 +786,66 @@ private:
}
}
+ void trim_anchored_modifier_chosen ()
+ {
+ string const txt = _trim_anchored_combo.get_active_text();
+
+ 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);
+ break;
+ }
+ }
+ }
+
+ void fine_adjust_modifier_chosen ()
+ {
+ string const txt = _fine_adjust_combo.get_active_text();
+
+ for (int i = 0; modifiers[i].name; ++i) {
+ if (txt == _(modifiers[i].name)) {
+ Keyboard::set_fine_adjust_modifier (modifiers[i].modifier);
+ break;
+ }
+ }
+ }
+
+ void push_points_modifier_chosen ()
+ {
+ string const txt = _push_points_combo.get_active_text();
+
+ for (int i = 0; modifiers[i].name; ++i) {
+ if (txt == _(modifiers[i].name)) {
+ Keyboard::set_push_points_modifier (modifiers[i].modifier);
+ break;
+ }
+ }
+ }
+
+ void note_size_relative_modifier_chosen ()
+ {
+ string const txt = _note_size_relative_combo.get_active_text();
+
+ for (int i = 0; modifiers[i].name; ++i) {
+ if (txt == _(modifiers[i].name)) {
+ Keyboard::set_note_size_relative_modifier (modifiers[i].modifier);
+ break;
+ }
+ }
+ }
+
void delete_button_changed ()
{
Keyboard::set_delete_button (_delete_button_spin.get_value_as_int());
@@ -702,6 +870,11 @@ private:
ComboBoxText _snap_delta_combo;
ComboBoxText _trim_contents_combo;
ComboBoxText _trim_overlap_combo;
+ ComboBoxText _trim_anchored_combo;
+ ComboBoxText _trim_jump_combo;
+ ComboBoxText _fine_adjust_combo;
+ ComboBoxText _push_points_combo;
+ ComboBoxText _note_size_relative_combo;
Adjustment _delete_button_adjustment;
SpinButton _delete_button_spin;
Adjustment _edit_button_adjustment;