From 8a9cdd04c55ccac7c5d3186cdcf3ecd4e122410c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Jul 2013 12:58:44 -0400 Subject: Include pthread.h as it isn't included via jack headers on windows --- libs/midi++2/midi++/port.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs/midi++2/midi++/port.h') diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index 599fabaa87..439760115c 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -24,6 +24,8 @@ #include +#include + #include "pbd/xml++.h" #include "pbd/crossthread.h" #include "pbd/signals.h" -- cgit v1.2.3 From eddcc868ba7786a7039edd1a96acbcac83499007 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 13 Jul 2013 08:26:54 -0400 Subject: Disable non-realtime midi ports in windows build - THIS NEEDS FIXING --- libs/ardour/midi_ui.cc | 2 ++ libs/midi++2/jack_midi_port.cc | 6 ++++++ libs/midi++2/midi++/jack_midi_port.h | 10 +++++++++- libs/midi++2/midi++/port.h | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) (limited to 'libs/midi++2/midi++/port.h') diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc index 78da32e427..82261b58ec 100644 --- a/libs/ardour/midi_ui.cc +++ b/libs/ardour/midi_ui.cc @@ -104,7 +104,9 @@ MidiControlUI::midi_input_handler (IOCondition ioc, MIDI::Port* port) if (ioc & IO_IN) { +#ifndef WIN32 CrossThreadChannel::drain (port->selectable()); +#endif DEBUG_TRACE (DEBUG::MidiIO, string_compose ("data available on %1\n", port->name())); framepos_t now = _session.engine().frame_time(); diff --git a/libs/midi++2/jack_midi_port.cc b/libs/midi++2/jack_midi_port.cc index 57ca2b3629..3220ca5b55 100644 --- a/libs/midi++2/jack_midi_port.cc +++ b/libs/midi++2/jack_midi_port.cc @@ -58,7 +58,9 @@ JackMIDIPort::JackMIDIPort (string const & name, Flags flags, jack_client_t* jac , _last_write_timestamp (0) , output_fifo (512) , input_fifo (1024) +#ifndef WIN32 , xthread (true) +#endif { assert (jack_client); init (name, flags); @@ -73,7 +75,9 @@ JackMIDIPort::JackMIDIPort (const XMLNode& node, jack_client_t* jack_client) , _last_write_timestamp (0) , output_fifo (512) , input_fifo (1024) +#ifndef WIN32 , xthread (true) +#endif { assert (jack_client); @@ -170,7 +174,9 @@ JackMIDIPort::cycle_start (pframes_t nframes) } if (event_count) { +#ifndef WIN32 xthread.wakeup (); +#endif } } } diff --git a/libs/midi++2/midi++/jack_midi_port.h b/libs/midi++2/midi++/jack_midi_port.h index a8859387a4..f91c7dab83 100644 --- a/libs/midi++2/midi++/jack_midi_port.h +++ b/libs/midi++2/midi++/jack_midi_port.h @@ -57,7 +57,13 @@ class JackMIDIPort : public Port { int write (const byte *msg, size_t msglen, timestamp_t timestamp); int read (byte *buf, size_t bufsize); void drain (int check_interval_usecs); - int selectable () const { return xthread.selectable(); } + int selectable () const { +#ifdef WIN32 + return false; +#else + return xthread.selectable(); +#endif + } pframes_t nframes_this_cycle() const { return _nframes_this_cycle; } @@ -80,7 +86,9 @@ private: RingBuffer< Evoral::Event > output_fifo; Evoral::EventRingBuffer input_fifo; Glib::Threads::Mutex output_fifo_lock; +#ifndef WIN32 CrossThreadChannel xthread; +#endif int create_port (); diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index 439760115c..d4f03b593e 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -27,7 +27,9 @@ #include #include "pbd/xml++.h" +#ifndef WIN32 #include "pbd/crossthread.h" +#endif #include "pbd/signals.h" #include "pbd/ringbuffer.h" -- cgit v1.2.3 From e5ab8c1c9e0474cf09192f012553efc3f04c58f0 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Thu, 25 Jul 2013 07:45:24 +0100 Subject: 'libs/midi++2' - Platform specific includes --- libs/midi++2/ipmidi_port.cc | 12 ++++++------ libs/midi++2/jack_midi_port.cc | 6 +++--- libs/midi++2/midi++/ipmidi_port.h | 2 +- libs/midi++2/midi++/jack_midi_port.h | 4 ++-- libs/midi++2/midi++/port.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'libs/midi++2/midi++/port.h') diff --git a/libs/midi++2/ipmidi_port.cc b/libs/midi++2/ipmidi_port.cc index 59606bffb2..4c0282f1f7 100644 --- a/libs/midi++2/ipmidi_port.cc +++ b/libs/midi++2/ipmidi_port.cc @@ -29,13 +29,13 @@ #undef O_NONBLOCK #define O_NONBLOCK 0 #endif -#if defined(WIN32) +#if defined(PLATFORM_WINDOWS) #include #else #include #endif -#if defined(WIN32) +#if defined(PLATFORM_WINDOWS) static WSADATA g_wsaData; typedef int socklen_t; #else @@ -120,7 +120,7 @@ get_address (int sock, struct in_addr *inaddr, const string& ifname ) { // Get interface address from supplied name. -#if !defined(WIN32) +#if !defined(PLATFORM_WINDOWS) struct ifreq ifr; ::strncpy(ifr.ifr_name, ifname.c_str(), sizeof(ifr.ifr_name)); @@ -149,13 +149,13 @@ get_address (int sock, struct in_addr *inaddr, const string& ifname ) return false; -#endif // !WIN32 +#endif // !PLATFORM_WINDOWS' } bool IPMIDIPort::open_sockets (int base_port, const string& ifname) { -#if !defined(WIN32) +#if !defined(PLATFORM_WINDOWS) int protonum = 0; struct protoent *proto = ::getprotobyname("IP"); @@ -254,7 +254,7 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname) return true; #else return false; -#endif // !WIN32 +#endif // !PLATFORM_WINDOWS' } int diff --git a/libs/midi++2/jack_midi_port.cc b/libs/midi++2/jack_midi_port.cc index cb0d271837..38ec4d35c7 100644 --- a/libs/midi++2/jack_midi_port.cc +++ b/libs/midi++2/jack_midi_port.cc @@ -58,7 +58,7 @@ JackMIDIPort::JackMIDIPort (string const & name, Flags flags, jack_client_t* jac , _last_write_timestamp (0) , output_fifo (512) , input_fifo (1024) -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS , xthread (true) #endif { @@ -75,7 +75,7 @@ JackMIDIPort::JackMIDIPort (const XMLNode& node, jack_client_t* jack_client) , _last_write_timestamp (0) , output_fifo (512) , input_fifo (1024) -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS , xthread (true) #endif { @@ -174,7 +174,7 @@ JackMIDIPort::cycle_start (pframes_t nframes) } if (event_count) { -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS xthread.wakeup (); #endif } diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h index c077170026..a4adb14cf4 100644 --- a/libs/midi++2/midi++/ipmidi_port.h +++ b/libs/midi++2/midi++/ipmidi_port.h @@ -21,7 +21,7 @@ #include #include -#if defined(WIN32) +#if defined(PLATFORM_WINDOWS) #include #elif defined(__FREE_BSD__) #include diff --git a/libs/midi++2/midi++/jack_midi_port.h b/libs/midi++2/midi++/jack_midi_port.h index f91c7dab83..284df0ef2d 100644 --- a/libs/midi++2/midi++/jack_midi_port.h +++ b/libs/midi++2/midi++/jack_midi_port.h @@ -58,7 +58,7 @@ class JackMIDIPort : public Port { int read (byte *buf, size_t bufsize); void drain (int check_interval_usecs); int selectable () const { -#ifdef WIN32 +#ifdef PLATFORM_WINDOWS return false; #else return xthread.selectable(); @@ -86,7 +86,7 @@ private: RingBuffer< Evoral::Event > output_fifo; Evoral::EventRingBuffer input_fifo; Glib::Threads::Mutex output_fifo_lock; -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS CrossThreadChannel xthread; #endif diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index d4f03b593e..153cfb0529 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -27,7 +27,7 @@ #include #include "pbd/xml++.h" -#ifndef WIN32 +#ifndef PLATFORM_WINDOWS #include "pbd/crossthread.h" #endif #include "pbd/signals.h" -- cgit v1.2.3