summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_buffer.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-21 17:30:08 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-21 17:30:08 +0000
commit8d05ed8e8a487e98ed182ae5b6c98e2160250bf8 (patch)
treeb438a6d1fd9b3458cc63a180900cb82e6059b200 /libs/ardour/midi_buffer.cc
parent5d509146c815bee46e8d1ede78c7e4445f346db8 (diff)
merge-in-place debugging (to be removed later)
git-svn-id: svn://localhost/ardour2/branches/3.0@11050 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_buffer.cc')
-rw-r--r--libs/ardour/midi_buffer.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc
index 403f0a86ac..6e07a1bedd 100644
--- a/libs/ardour/midi_buffer.cc
+++ b/libs/ardour/midi_buffer.cc
@@ -407,6 +407,16 @@ MidiBuffer::merge_in_place(const MidiBuffer &other)
return false;
}
+ cerr << "MERGING\nUS: ";
+ for (MidiBuffer::iterator i = begin(); i != end(); ++i) {
+ cerr << *i << " ; ";
+ }
+ cerr << "\nTHEM: ";
+ for (MidiBuffer::const_iterator i = other.begin(); i != other.end(); ++i) {
+ cerr << *i << " ; ";
+ }
+ cerr << endl;
+
#ifndef NDEBUG
#ifdef TEST_MIDI_MERGE
size_t test_orig_us_size = _size;
@@ -445,14 +455,21 @@ MidiBuffer::merge_in_place(const MidiBuffer &other)
src = -1;
sz = 0;
+ cerr << "Start merge skip with them = " << *them << endl;
+
while (them != other.end() && (*them).time() < (*us).time()) {
if (src == -1) {
src = them.offset;
}
sz += sizeof (TimeType) + (*them).size();
+ cerr << " move through other event " << *them << endl;
++them;
}
+ cerr << "merge skip done, sz = " << sz << " us @ end ? " << (us == end())
+ << " them @ end ? " << (them == other.end())
+ << endl;
+
if (sz) {
assert(src >= 0);
/* move existing */
@@ -471,12 +488,15 @@ MidiBuffer::merge_in_place(const MidiBuffer &other)
*/
while (us != end() && (*us).time() < (*them).time()) {
+ cerr << "skip by our own event " << (*us) << endl;
++us;
}
}
if (us == end()) {
+ cerr << " append rest of other to us\n";
+
/* just append the rest of other */
memcpy (_data + us.offset, other._data + them.offset, other._size - them.offset);