summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/async_midi_port.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-12-03 20:53:49 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-12-03 20:53:49 -0500
commitd762ed8c22edb1007647b5540fa5059993f59f8c (patch)
treeb0adfcdecb5158c30970af94679c1ab0f047cd4e /libs/ardour/ardour/async_midi_port.h
parentf72b87b44841b38f1046619b1a607b6a525a8d25 (diff)
alter Async MIDI port implementation to use crossthreadchannel on all platforms
Diffstat (limited to 'libs/ardour/ardour/async_midi_port.h')
-rw-r--r--libs/ardour/ardour/async_midi_port.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/libs/ardour/ardour/async_midi_port.h b/libs/ardour/ardour/async_midi_port.h
index 7fab9e4186..fde8110c19 100644
--- a/libs/ardour/ardour/async_midi_port.h
+++ b/libs/ardour/ardour/async_midi_port.h
@@ -30,13 +30,13 @@
#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 {
@@ -62,20 +62,15 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
/* 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);
@@ -88,11 +83,9 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
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 ();
@@ -106,7 +99,7 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::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;
};