diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-07-25 21:19:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-07-25 21:19:55 +0000 |
commit | 0bbc9144cca18495775cdc8b2050e5141bfcdc12 (patch) | |
tree | 8cdc26e873e77e609d493acccd32816296757d8d /gtk2_ardour/midi_region_view.cc | |
parent | 6fa58df7918b3a9fea715bf6c917c144af540f3c (diff) |
(1) extend region if needed BEFORE adding step-edit note, so that the new note ends up in the selection (2) hide the channel selector that shows up on note-right-click after its clicked anywhere, not just if the note(s) channel(s) are changed
git-svn-id: svn://localhost/ardour2/branches/3.0@7492 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 9f67dc89ba..b7fd04765c 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -816,7 +816,6 @@ MidiRegionView::apply_diff () _model->apply_command(*trackview.session(), _diff_command); _diff_command = 0; midi_view()->midi_track()->playlist_modified(); - if (add_or_remove) { _marked_for_selection.clear(); @@ -1435,7 +1434,7 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible) if (event) { if (_marked_for_selection.find(note) != _marked_for_selection.end()) { note_selected(event, true); - } + } if (_marked_for_velocity.find(note) != _marked_for_velocity.end()) { event->show_velocity(); @@ -1452,15 +1451,11 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible) } void -MidiRegionView::add_note (uint8_t channel, uint8_t number, uint8_t velocity, +MidiRegionView::step_add_note (uint8_t channel, uint8_t number, uint8_t velocity, Evoral::MusicalTime pos, Evoral::MusicalTime len) { boost::shared_ptr<NoteType> new_note (new NoteType (channel, pos, len, number, velocity)); - start_diff_command (_("step add")); - diff_add_note (new_note, true, false); - apply_diff(); - /* potentially extend region to hold new note */ nframes64_t end_frame = _region->position() + beats_to_frames (new_note->end_time()); @@ -1468,9 +1463,13 @@ MidiRegionView::add_note (uint8_t channel, uint8_t number, uint8_t velocity, if (end_frame > region_end) { _region->set_length (end_frame, this); - } else { - redisplay_model (); } + + start_diff_command (_("step add")); + diff_add_note (new_note, true, false); + apply_diff(); + + // last_step_edit_note = new_note; } void |