summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-04-05 09:47:07 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-04-05 09:47:07 +0000
commit4ee42dc455ce5015801a5db7a2b86a5a71a8ec25 (patch)
treed845eca6e276f994f93d646a05172000b28b4ff9 /libs
parent549a8cb88b93e60d8dc412ee29fd52508ce07d2d (diff)
* Bugfix: resizing beginnings of MIDI regions did not work correctly (it shifted the region content right)
* Bugfix: resizing ends of MIDI tracks did not hide noted beyond region boundaries (in the moment only all notes with note_on >= region end are hidden, their note offs still may exceed region boundaries, but so much for now.....) git-svn-id: svn://localhost/ardour2/branches/3.0@3219 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/midi_region.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index ababd41a8d..26eb0e5054 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -131,7 +131,7 @@ MidiRegion::master_read_at (MidiRingBuffer& out, nframes_t position, nframes_t d
nframes_t
MidiRegion::_read_at (const SourceList& srcs, MidiRingBuffer& dst, nframes_t position, nframes_t dur, uint32_t chan_n, NoteMode mode) const
{
- // cerr << _name << "._read_at(" << position << ") - " << _position << endl;
+ //cerr << _name << "._read_at(" << position << ") - " << _position << " duration: " << dur << endl;
nframes_t internal_offset = 0;
nframes_t src_offset = 0;
@@ -171,7 +171,16 @@ MidiRegion::_read_at (const SourceList& srcs, MidiRingBuffer& dst, nframes_t pos
boost::shared_ptr<MidiSource> src = midi_source(chan_n);
src->set_note_mode(mode);
- if (src->midi_read (dst, _start + internal_offset, to_read, _position) != to_read) {
+ if (src->midi_read (
+ // the destination buffer
+ dst,
+ // where to start reading in the region
+ _start + internal_offset,
+ // how many bytes
+ to_read,
+ // the offset in the output buffer
+ _position - _start
+ ) != to_read) {
return 0; /* "read nothing" */
}