From 0c66131fea79acd8d540be8c943865257d49b001 Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Wed, 16 Apr 2008 02:30:37 +0000 Subject: [PATCH] * bugfix in midi editing: adding notes impossible after delete git-svn-id: svn://localhost/ardour2/branches/3.0@3255 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_region_view.cc | 1 + libs/ardour/midi_model.cc | 4 ++-- libs/ardour/smf_source.cc | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 115733e8ed..cdee66ea9b 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -174,6 +174,7 @@ MidiRegionView::canvas_event(GdkEvent* ev) } if (delete_mod) { trackview.editor.set_midi_edit_mode(original_mode); + _mouse_state = None; delete_mod = false; } return true; diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index b073d9c678..31f9f2f576 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -523,8 +523,8 @@ MidiModel::remove_note_unlocked(const boost::shared_ptr note) { //cerr << "MidiModel " << this << " remove note " << (int)note.note() << " @ " << note.time() << endl; for(Notes::iterator n = _notes.begin(); n != _notes.end(); ++n) { - Note _n = *(*n); - Note _note =*note; + Note& _n = *(*n); + const Note& _note = *note; cerr << "======================================= " << endl; cerr << int(_n.note()) << "@" << int(_n.time()) << "[" << int(_n.channel()) << "] --" << int(_n.duration()) << "-- #" << int(_n.velocity()) << endl; cerr << int(_note.note()) << "@" << int(_note.time()) << "[" << int(_note.channel()) << "] --" << int(_note.duration()) << "-- #" << int(_note.velocity()) << endl; diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index aef011ed00..257108c818 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -477,6 +477,7 @@ SMFSource::append_event_unlocked(EventTimeUnit unit, const MIDI::Event& ev) delta_time = (uint32_t)((ev.time() - _last_ev_time) * _ppqn); } + const size_t stamp_size = write_var_len(delta_time); fwrite(ev.buffer(), 1, ev.size(), _fd);