*/
#include <iostream>
+#include <vector>
+
+#include <glibmm/timer.h>
#include "pbd/error.h"
#include "pbd/stacktrace.h"
, _last_write_timestamp (0)
, output_fifo (512)
, input_fifo (1024)
+#ifndef PLATFORM_WINDOWS
, xthread (true)
+#endif
{
}
}
void
-AsyncMIDIPort::flush_output_fifo (pframes_t nframes)
+AsyncMIDIPort::flush_output_fifo (MIDI::pframes_t nframes)
{
RingBuffer< Evoral::Event<double> >::rw_vector vec = { { 0, 0 }, { 0, 0 } };
size_t written;
}
void
-AsyncMIDIPort::cycle_start (pframes_t nframes)
+AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
{
_currently_in_cycle = true;
MidiPort::cycle_start (nframes);
for (MidiBuffer::iterator b = mb.begin(); b != mb.end(); ++b) {
input_fifo.write (when, (Evoral::EventType) 0, (*b).size(), (*b).buffer());
}
-
+
+#ifndef PLATFORM_WINDOWS
if (!mb.empty()) {
xthread.wakeup ();
}
+#endif
}
-
}
void
-AsyncMIDIPort::cycle_end (pframes_t nframes)
+AsyncMIDIPort::cycle_end (MIDI::pframes_t nframes)
{
if (ARDOUR::Port::sends_output()) {
/* move any additional data from output FIFO into the port
if (vec.len[0] + vec.len[1] >= output_fifo.bufsize() - 1) {
break;
}
- usleep (check_interval_usecs);
+ Glib::usleep (check_interval_usecs);
}
}
timestamp_t time;
Evoral::EventType type;
uint32_t size;
- MIDI::byte buffer[input_fifo.capacity()];
+ vector<MIDI::byte> buffer(input_fifo.capacity());
- while (input_fifo.read (&time, &type, &size, buffer)) {
+ while (input_fifo.read (&time, &type, &size, &buffer[0])) {
_parser->set_timestamp (time);
for (uint32_t i = 0; i < size; ++i) {
_parser->scanner (buffer[i]);
}
void
-AsyncMIDIPort::parse (framecnt_t)
+AsyncMIDIPort::parse (MIDI::framecnt_t)
{
MIDI::byte buf[1];