#include "pbd/ringbuffer.h"
#include "evoral/Event.hpp"
+#include "evoral/EventRingBuffer.hpp"
#include "midi++/types.h"
#include "midi++/parser.h"
#include "midi++/port.h"
#include "ardour/libardour_visibility.h"
-#include "ardour/event_ring_buffer.h"
#include "ardour/midi_port.h"
namespace ARDOUR {
/* clears async request communication channel */
void clear () {
-#ifndef PLATFORM_WINDOWS
- return xthread.drain ();
-#endif
+ _xthread.drain ();
}
+
+ CrossThreadChannel& xthread() {
+ return _xthread;
+ }
+
/* Not selectable; use ios() */
int selectable() const { return -1; }
-
- Glib::RefPtr<Glib::IOSource> ios() {
-#ifndef PLATFORM_WINDOWS
- return xthread.ios();
-#else
- return Glib::RefPtr<Glib::IOSource>(0);
-#endif
- }
void set_timer (boost::function<framecnt_t (void)>&);
static void set_process_thread (pthread_t);
bool have_timer;
boost::function<framecnt_t (void)> timer;
RingBuffer< Evoral::Event<double> > output_fifo;
- EventRingBuffer<MIDI::timestamp_t> input_fifo;
+ Evoral::EventRingBuffer<MIDI::timestamp_t> input_fifo;
Glib::Threads::Mutex output_fifo_lock;
-#ifndef PLATFORM_WINDOWS
- CrossThreadChannel xthread;
-#endif
+ CrossThreadChannel _xthread;
int create_port ();
void make_connections ();
void init (std::string const &, Flags);
- void flush_output_fifo (pframes_t);
+ void flush_output_fifo (pframes_t);
static pthread_t _process_thread;
};
using namespace std;
using namespace PBD;
+namespace Evoral {
+ template class EventRingBuffer<MIDI::timestamp_t>;
+}
+
pthread_t AsyncMIDIPort::_process_thread;
#define port_engine AudioEngine::instance()->port_engine()
, have_timer (false)
, output_fifo (512)
, input_fifo (1024)
-#ifndef PLATFORM_WINDOWS
- , xthread (true)
-#endif
+ , _xthread (true)
{
}
input_fifo.write (when, (Evoral::EventType) 0, (*b).size(), (*b).buffer());
}
-#ifndef PLATFORM_WINDOWS
if (!mb.empty()) {
- xthread.wakeup ();
+ _xthread.wakeup ();
}
-#endif
}
}