diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-11-04 12:57:19 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-11-04 12:57:19 -0700 |
commit | 62c4e88a9d8f4a7b019243fe9a10830b1da0150c (patch) | |
tree | 59f4809ddcc999d09898348cea9ca79e2fd20a54 /libs/ardour/ticker.cc | |
parent | 47672fceec568949d8dcf3f2be516a644ff4ccbd (diff) |
avoid use of Port::port_offset() everywhere except Port::flush_buffers() and Port::get_buffer()
Split cycles are run as if they are an entire self-contained cycle, starting at zero and running for "nframes".
We adjust the timing and position of data only when retrieving and writing it to Port buffers.
Diffstat (limited to 'libs/ardour/ticker.cc')
-rw-r--r-- | libs/ardour/ticker.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc index 7e36978177..7d378d72ae 100644 --- a/libs/ardour/ticker.cc +++ b/libs/ardour/ticker.cc @@ -329,7 +329,7 @@ MidiClockTicker::send_midi_clock_event (pframes_t offset, pframes_t nframes) static uint8_t msg = MIDI_CMD_COMMON_CLOCK; MidiBuffer& mb (_midi_port->get_midi_buffer (nframes)); - mb.push_back (offset + Port::port_offset(), 1, &msg); + mb.push_back (offset, 1, &msg); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Tick with offset %1\n", offset)); } @@ -343,7 +343,7 @@ MidiClockTicker::send_start_event (pframes_t offset, pframes_t nframes) static uint8_t msg = { MIDI_CMD_COMMON_START }; MidiBuffer& mb (_midi_port->get_midi_buffer (nframes)); - mb.push_back (offset + Port::port_offset(), 1, &msg); + mb.push_back (offset, 1, &msg); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Start %1\n", _last_tick)); } @@ -357,7 +357,7 @@ MidiClockTicker::send_continue_event (pframes_t offset, pframes_t nframes) static uint8_t msg = { MIDI_CMD_COMMON_CONTINUE }; MidiBuffer& mb (_midi_port->get_midi_buffer (nframes)); - mb.push_back (offset + Port::port_offset(), 1, &msg); + mb.push_back (offset, 1, &msg); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Continue %1\n", _last_tick)); } @@ -371,7 +371,7 @@ MidiClockTicker::send_stop_event (pframes_t offset, pframes_t nframes) static uint8_t msg = MIDI_CMD_COMMON_STOP; MidiBuffer& mb (_midi_port->get_midi_buffer (nframes)); - mb.push_back (offset + Port::port_offset(), 1, &msg); + mb.push_back (offset, 1, &msg); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Stop %1\n", _last_tick)); } @@ -395,9 +395,8 @@ MidiClockTicker::send_position_event (uint32_t midi_beats, pframes_t offset, pfr msg[2] = midi_beats >> 7; MidiBuffer& mb (_midi_port->get_midi_buffer (nframes)); - mb.push_back (offset + Port::port_offset(), 3, &msg[0]); + mb.push_back (offset, 3, &msg[0]); - DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position Sent: %1 to %2 (events now %3, buf = %4)\n", midi_beats, _midi_port->name(), - mb.size(), &mb)); + DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position Sent: %1 to %2 (events now %3, buf = %4)\n", midi_beats, _midi_port->name(), mb.size(), &mb)); } |