Return silence from read_from_sources() if we try to read a channel that our source...
[ardour.git] / libs / midi++2 / midi++ / ipmidi_port.h
index bf949bd60129cf962d9f936fd460221b934e257a..32cf1163e6ffdddb82a43428e2da8f707e1a5e72 100644 (file)
@@ -28,6 +28,8 @@
 #include <net/if.h>
 #endif
 
+#include <glibmm/thread.h>
+
 #include <jack/types.h>
 
 #include "pbd/xml++.h"
@@ -35,9 +37,6 @@
 #include "pbd/signals.h"
 #include "pbd/ringbuffer.h"
 
-#include "evoral/Event.hpp"
-#include "evoral/EventRingBuffer.hpp"
-
 #include "midi++/types.h"
 #include "midi++/parser.h"
 #include "midi++/port.h"
@@ -53,7 +52,7 @@ class IPMIDIPort : public Port {
     XMLNode& get_state () const;
     void set_state (const XMLNode&);
     
-    int write (byte *msg, size_t msglen, timestamp_t timestamp);
+    int write (const byte *msg, size_t msglen, timestamp_t timestamp);
     int read (byte *buf, size_t bufsize);
     void parse (framecnt_t timestamp);
     int selectable () const;
@@ -64,7 +63,8 @@ private:
     int sockin;
     int sockout;
     struct sockaddr_in addrout;
-    
+    Glib::Mutex write_lock;    
+
     bool open_sockets (int base_port, const std::string& ifname);
     void close_sockets ();