mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
fix for #3977 - shift-tab and shift-ctrl-tab move to the next/previous note like tab, but leave existing selected note(s) selected
git-svn-id: svn://localhost/ardour2/branches/3.0@9838 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
58a700e968
commit
07b584f312
2 changed files with 30 additions and 22 deletions
|
|
@ -723,13 +723,26 @@ MidiRegionView::key_press (GdkEventKey* ev)
|
||||||
|
|
||||||
} else if (ev->keyval == GDK_Tab) {
|
} else if (ev->keyval == GDK_Tab) {
|
||||||
|
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier)) {
|
||||||
goto_previous_note ();
|
goto_previous_note (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier));
|
||||||
} else {
|
} else {
|
||||||
goto_next_note ();
|
goto_next_note (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
} else if (ev->keyval == GDK_ISO_Left_Tab) {
|
||||||
|
|
||||||
|
/* Shift-TAB generates ISO Left Tab, for some reason */
|
||||||
|
|
||||||
|
if (Keyboard::modifier_state_contains (ev->state, Keyboard::PrimaryModifier)) {
|
||||||
|
goto_previous_note (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier));
|
||||||
|
} else {
|
||||||
|
goto_next_note (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if (ev->keyval == GDK_Up) {
|
} else if (ev->keyval == GDK_Up) {
|
||||||
|
|
||||||
bool allow_smush = Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier);
|
bool allow_smush = Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier);
|
||||||
|
|
@ -2054,15 +2067,6 @@ MidiRegionView::note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add, bool
|
||||||
add_to_selection (*i);
|
add_to_selection (*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* if events were guaranteed to be time sorted, we could do this.
|
|
||||||
but as of sept 10th 2009, they no longer are.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((*i)->note()->time() > latest) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3141,9 +3145,8 @@ MidiRegionView::time_sort_events ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiRegionView::goto_next_note ()
|
MidiRegionView::goto_next_note (bool add_to_selection)
|
||||||
{
|
{
|
||||||
// framepos_t pos = -1;
|
|
||||||
bool use_next = false;
|
bool use_next = false;
|
||||||
|
|
||||||
if (_events.back()->selected()) {
|
if (_events.back()->selected()) {
|
||||||
|
|
@ -3157,8 +3160,11 @@ MidiRegionView::goto_next_note ()
|
||||||
use_next = true;
|
use_next = true;
|
||||||
continue;
|
continue;
|
||||||
} else if (use_next) {
|
} else if (use_next) {
|
||||||
unique_select (*i);
|
if (!add_to_selection) {
|
||||||
// pos = _region->position() + beats_to_frames ((*i)->note()->time());
|
unique_select (*i);
|
||||||
|
} else {
|
||||||
|
note_selected (*i, true, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3170,9 +3176,8 @@ MidiRegionView::goto_next_note ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiRegionView::goto_previous_note ()
|
MidiRegionView::goto_previous_note (bool add_to_selection)
|
||||||
{
|
{
|
||||||
// framepos_t pos = -1;
|
|
||||||
bool use_next = false;
|
bool use_next = false;
|
||||||
|
|
||||||
if (_events.front()->selected()) {
|
if (_events.front()->selected()) {
|
||||||
|
|
@ -3186,8 +3191,11 @@ MidiRegionView::goto_previous_note ()
|
||||||
use_next = true;
|
use_next = true;
|
||||||
continue;
|
continue;
|
||||||
} else if (use_next) {
|
} else if (use_next) {
|
||||||
unique_select (*i);
|
if (!add_to_selection) {
|
||||||
// pos = _region->position() + beats_to_frames ((*i)->note()->time());
|
unique_select (*i);
|
||||||
|
} else {
|
||||||
|
note_selected (*i, true, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,8 +258,8 @@ public:
|
||||||
/** Convert a timestamp in frames to beats (both relative to region start) */
|
/** Convert a timestamp in frames to beats (both relative to region start) */
|
||||||
double frames_to_beats(framepos_t) const;
|
double frames_to_beats(framepos_t) const;
|
||||||
|
|
||||||
void goto_previous_note ();
|
void goto_previous_note (bool add_to_selection);
|
||||||
void goto_next_note ();
|
void goto_next_note (bool add_to_selection);
|
||||||
void change_note_lengths (bool, bool, Evoral::MusicalTime beats, bool start, bool end);
|
void change_note_lengths (bool, bool, Evoral::MusicalTime beats, bool start, bool end);
|
||||||
void change_velocities (bool up, bool fine, bool allow_smush);
|
void change_velocities (bool up, bool fine, bool allow_smush);
|
||||||
void transpose (bool up, bool fine, bool allow_smush);
|
void transpose (bool up, bool fine, bool allow_smush);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue