disable unused windows-vst / ALSA-MIDI code
[ardour.git] / libs / midi++2 / ipmidi_port.cc
index 0ef0a9952a5780ed5b2de9ae8f7a64a313c25a98..c90a3dbe6fd133a2200c21cf4ce38fd9e92ed2e6 100644 (file)
@@ -1,5 +1,7 @@
 /*
-    Copyright (C) 2012 Paul Davie
+    Copyright (C) 2012 Paul Davis
+
+    Using code from Rui Nuno Capela's qmidinet as inspiration.
     
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -244,10 +246,11 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
 }
 
 int
-IPMIDIPort::write (byte* msg, size_t msglen, timestamp_t /* ignored */) {
+IPMIDIPort::write (const byte* msg, size_t msglen, timestamp_t /* ignored */) {
 
        if (sockout) {
-               if (::sendto (sockout, (char *) msg, msglen, 0, (struct sockaddr *) &addrout, sizeof(struct sockaddr_in)) < 0) {
+               Glib::Threads::Mutex::Lock lm (write_lock);
+               if (::sendto (sockout, (const char *) msg, msglen, 0, (struct sockaddr *) &addrout, sizeof(struct sockaddr_in)) < 0) {
                        ::perror("sendto");
                        return -1;
                }
@@ -257,7 +260,7 @@ IPMIDIPort::write (byte* msg, size_t msglen, timestamp_t /* ignored */) {
 }
 
 int
-IPMIDIPort::read (byte* buf, size_t bufsize)
+IPMIDIPort::read (byte* /*buf*/, size_t /*bufsize*/)
 {
        /* nothing to do here - all handled by parse() */
        return 0;