diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-04 17:04:20 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-04 17:04:20 +0000 |
commit | 46eaff772d6ea28e97c31b16859085ca41c11a45 (patch) | |
tree | bf9f3c767d8314a54f547bf0d0c9a91f92995dcf /gtk2_ardour/midi_time_axis.cc | |
parent | c831ea516791f171d2e5910baf7100af5378ee95 (diff) |
endless further tweaks to step editor; stop stealing the "r" key inside MidiRegionView key handling
git-svn-id: svn://localhost/ardour2/branches/3.0@7537 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index bc36d6fbe8..36ee6ccf9d 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -968,6 +968,15 @@ MidiTimeAxisView::check_step_edit () int MidiTimeAxisView::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evoral::MusicalTime beat_duration) { + MidiStreamView* msv = midi_view(); + + /* make sure its visible on the vertical axis */ + + if (pitch < msv->lowest_note() || pitch > msv->highest_note()) { + msv->update_note_range (pitch); + msv->set_note_range (MidiStreamView::ContentsRange); + } + if (step_edit_region == 0) { step_edit_region = add_region (step_edit_insert_position); @@ -1050,11 +1059,19 @@ MidiTimeAxisView::step_edit_toggle_chord () } void -MidiTimeAxisView::step_edit_rest () +MidiTimeAxisView::step_edit_rest (Evoral::MusicalTime beats) { bool success; - Evoral::MusicalTime beats = _editor.get_grid_type_as_beats (success, step_edit_insert_position); - step_edit_beat_pos += beats; + + if (beats == 0.0) { + beats = _editor.get_grid_type_as_beats (success, step_edit_insert_position); + } else { + success = true; + } + + if (success) { + step_edit_beat_pos += beats; + } } boost::shared_ptr<Region> |