mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Remove unnecessary assert from midi clock ticker code; MIDI::Port handles non-process thread sends using a ringbuffer. Clean up some types.
git-svn-id: svn://localhost/ardour2/branches/3.0@8259 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8d5b4fbf4a
commit
e8c59e4155
2 changed files with 14 additions and 16 deletions
|
|
@ -97,10 +97,10 @@ private:
|
||||||
|
|
||||||
double one_ppqn_in_frames (framepos_t transport_position);
|
double one_ppqn_in_frames (framepos_t transport_position);
|
||||||
|
|
||||||
void send_midi_clock_event (framecnt_t offset);
|
void send_midi_clock_event (pframes_t offset);
|
||||||
void send_start_event (framecnt_t offset);
|
void send_start_event (pframes_t offset);
|
||||||
void send_continue_event (framecnt_t offset);
|
void send_continue_event (pframes_t offset);
|
||||||
void send_stop_event (framecnt_t offset);
|
void send_stop_event (pframes_t offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,48 +176,46 @@ double MidiClockTicker::one_ppqn_in_frames (framepos_t transport_position)
|
||||||
return frames_per_quarter_note / double (_ppqn);
|
return frames_per_quarter_note / double (_ppqn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidiClockTicker::send_midi_clock_event (framecnt_t offset)
|
void MidiClockTicker::send_midi_clock_event (pframes_t offset)
|
||||||
{
|
{
|
||||||
if (!_midi_port) {
|
if (!_midi_port) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (MIDI::Port::is_process_thread());
|
DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Tick with offset %1", offset));
|
||||||
#ifdef DEBUG_MIDI_CLOCK
|
|
||||||
cerr << "Tick with offset " << offset << endl;
|
|
||||||
#endif // DEBUG_MIDI_CLOCK
|
|
||||||
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_CLOCK };
|
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_CLOCK };
|
||||||
_midi_port->write(_midi_clock_tick, 1, offset);
|
_midi_port->write (_midi_clock_tick, 1, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidiClockTicker::send_start_event (framecnt_t offset)
|
void MidiClockTicker::send_start_event (pframes_t offset)
|
||||||
{
|
{
|
||||||
if (!_midi_port) {
|
if (!_midi_port) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_START };
|
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_START };
|
||||||
_midi_port->write(_midi_clock_tick, 1, offset);
|
_midi_port->write (_midi_clock_tick, 1, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidiClockTicker::send_continue_event (framecnt_t offset)
|
void MidiClockTicker::send_continue_event (pframes_t offset)
|
||||||
{
|
{
|
||||||
if (!_midi_port) {
|
if (!_midi_port) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_CONTINUE };
|
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_CONTINUE };
|
||||||
_midi_port->write(_midi_clock_tick, 1, offset);
|
_midi_port->write (_midi_clock_tick, 1, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidiClockTicker::send_stop_event (framecnt_t offset)
|
void MidiClockTicker::send_stop_event (pframes_t offset)
|
||||||
{
|
{
|
||||||
if (!_midi_port) {
|
if (!_midi_port) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_STOP };
|
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_STOP };
|
||||||
_midi_port->write(_midi_clock_tick, 1, offset);
|
_midi_port->write (_midi_clock_tick, 1, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue