Set length of new percussive hits to 1 tick
This prevents overlap of successive hits. Ardour 7 added a new duration select drop-down menu, which defaults to "Auto" (musical grid) and removed the special case when drawing percussive notes. It was possible to accidentally create overlapping notes, without the user being aware of doing so.
This commit is contained in:
@@ -6946,17 +6946,8 @@ HitCreateDrag::finished (GdkEvent* event, bool had_movement)
|
||||
|
||||
Beats const start = _region_view->region ()->absolute_time_to_region_beats (timepos_t (aligned_beats));
|
||||
|
||||
/* This code is like MidiRegionView::get_draw_length_beats() but
|
||||
* defaults to 1/64th note rather than a 1/4 note, since we're in
|
||||
* percussive mode.
|
||||
*/
|
||||
|
||||
bool success;
|
||||
Beats length = _editor->get_draw_length_as_beats (success, pos);
|
||||
|
||||
if (!success) {
|
||||
length = Beats::ticks (Beats::PPQN / 64);
|
||||
}
|
||||
/* Percussive hits are as short as possible */
|
||||
Beats length (0, 1);
|
||||
|
||||
/* create_note_at() implements UNDO for us */
|
||||
_region_view->create_note_at (timepos_t (start), _y, length, event->button.state, false);
|
||||
|
||||
@@ -4697,9 +4697,13 @@ MidiRegionView::get_grid_beats (timepos_t const & pos) const
|
||||
Temporal::Beats
|
||||
MidiRegionView::get_draw_length_beats (timepos_t const & pos) const
|
||||
{
|
||||
if (midi_view()->note_mode() == Percussive) {
|
||||
return Temporal::Beats (0, 1);
|
||||
}
|
||||
|
||||
PublicEditor& editor = trackview.editor();
|
||||
bool success = false;
|
||||
Temporal::Beats beats = editor.get_draw_length_as_beats (success, pos);
|
||||
Temporal::Beats beats = editor.get_draw_length_as_beats (success, pos);
|
||||
|
||||
if (!success) {
|
||||
beats = Temporal::Beats (1, 0);
|
||||
|
||||
Reference in New Issue
Block a user