summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-09-01 01:50:24 +0000
committerCarl Hetherington <carl@carlh.net>2010-09-01 01:50:24 +0000
commitf645b4119e4f2b03d5cd24618253e2f8b4140262 (patch)
treebbd4832eb7cf8fab4d9815c46f50d385abb05f2d /libs/ardour/smf_source.cc
parent61af48d18e188d9b0cf8e68515962995912b2e6b (diff)
Clean up MidiSource::midi_read now that the signed type sframes_t is being used to pass positions around.
git-svn-id: svn://localhost/ardour2/branches/3.0@7726 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r--libs/ardour/smf_source.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 5ce87fe93e..d03489e6e8 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -105,9 +105,8 @@ SMFSource::~SMFSource ()
/** All stamps in audio frames */
nframes_t
-SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t source_start,
+SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t const source_start,
sframes_t start, nframes_t duration,
- sframes_t stamp_offset, sframes_t negative_stamp_offset,
MidiStateTracker* tracker) const
{
int ret = 0;
@@ -171,16 +170,14 @@ SMFSource::read_unlocked (Evoral::EventSink<nframes_t>& destination, sframes_t s
ev_delta_t, time, ev_buffer[0], ev_type));
assert(time >= start_ticks);
- const sframes_t ev_frame_time = converter.to(time / (double)ppqn()) + stamp_offset;
-#if 0
- cerr << " frames = " << ev_frame_time
- << " w/offset = " << ev_frame_time - negative_stamp_offset
- << endl;
-#endif
+ /* Note that we add on the source start time (in session frames) here so that ev_frame_time
+ is in session frames.
+ */
+ const sframes_t ev_frame_time = converter.to(time / (double)ppqn()) + source_start;
if (ev_frame_time < start + duration) {
- destination.write(ev_frame_time - negative_stamp_offset, ev_type, ev_size, ev_buffer);
+ destination.write (ev_frame_time, ev_type, ev_size, ev_buffer);
if (tracker) {
if (ev_buffer[0] & MIDI_CMD_NOTE_ON) {