mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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
This commit is contained in:
parent
61af48d18e
commit
f645b4119e
5 changed files with 15 additions and 38 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue