diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-08-13 19:48:10 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-08-13 19:48:10 +0000 |
commit | e57c4d4c43c0d302c0b06128e0ba10c4683ee8fe (patch) | |
tree | bb464234572ba2efc655e8db6da0cb7c7e5b0c58 /gtk2_ardour/selection.cc | |
parent | 84fb6ae9bac56123b4ebcfcc8440a4262b29e6c0 (diff) |
more MIDI paste improvements, plus move region-mute binding to PRIMARY-m and use "m" for toggle-internal-editing
git-svn-id: svn://localhost/ardour2/branches/3.0@5525 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r-- | gtk2_ardour/selection.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index b5454c4a12..66d1075557 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -25,6 +25,7 @@ #include "ardour/playlist.h" #include "ardour/rc_configuration.h" +#include "midi_cut_buffer.h" #include "region_view.h" #include "selection.h" #include "selection_templates.h" @@ -119,6 +120,9 @@ void Selection::clear_midi_notes () { if (!midi_notes.empty()) { + for (MidiNoteSelection::iterator x = midi_notes.begin(); x != midi_notes.end(); ++x) { + delete *x; + } midi_notes.clear (); MidiNotesChanged (); } @@ -233,6 +237,8 @@ Selection::toggle (MidiCutBuffer* midi) if ((i = find (midi_notes.begin(), midi_notes.end(), midi)) == midi_notes.end()) { midi_notes.push_back (midi); } else { + /* remember that we own the MCB */ + delete *i; midi_notes.erase (i); } @@ -369,6 +375,8 @@ Selection::add (const MidiNoteSelection& midi_list) void Selection::add (MidiCutBuffer* midi) { + /* we take ownership of the MCB */ + if (find (midi_notes.begin(), midi_notes.end(), midi) == midi_notes.end()) { midi_notes.push_back (midi); MidiNotesChanged (); @@ -554,6 +562,8 @@ Selection::remove (MidiCutBuffer* midi) MidiNoteSelection::iterator x; if ((x = find (midi_notes.begin(), midi_notes.end(), midi)) != midi_notes.end()) { + /* remember that we own the MCB */ + delete *x; midi_notes.erase (x); MidiNotesChanged (); } |