'libs/ardour' - Further platform specific changes
authorJohn Emmas <johne53@tiscali.co.uk>
Wed, 18 Sep 2013 11:27:39 +0000 (12:27 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Wed, 18 Sep 2013 11:27:39 +0000 (12:27 +0100)
libs/ardour/async_midi_port.cc
libs/ardour/globals.cc

index f282d238cc2617af75c93823372eda52c0d2839d..bd583328c30f1781a768d3268f27c1053bb64265 100644 (file)
@@ -52,7 +52,9 @@ AsyncMIDIPort::AsyncMIDIPort (string const & name, PortFlags flags)
        , _last_write_timestamp (0)
        , output_fifo (512)
        , input_fifo (1024)
+#ifndef PLATFORM_WINDOWS
        , xthread (true)
+#endif
 {
 }
 
@@ -116,12 +118,13 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
                for (MidiBuffer::iterator b = mb.begin(); b != mb.end(); ++b) {
                        input_fifo.write (when, (Evoral::EventType) 0, (*b).size(), (*b).buffer());
                }
-               
+
+#ifndef PLATFORM_WINDOWS
                if (!mb.empty()) {
                        xthread.wakeup ();
                }
+#endif
        }
-
 }
 
 void
index 8646b819f302d44ae3445994c3b49540b92c3f16..0cda9ebdf404fe81773763aad7e8f8610cbeaf87 100644 (file)
@@ -584,10 +584,21 @@ clock_gettime (int /*clk_id*/, struct timespec *t)
 microseconds_t
 ARDOUR::get_microseconds ()
 {
+#ifdef PLATFORM_WINDOWS
+       microseconds_t ret = 0;
+       LARGE_INTEGER freq, time;
+
+       if (QueryPerformanceFrequency(&freq))
+               if (QueryPerformanceCounter(&time))
+                       ret = (microseconds_t)((time.QuadPart * 1000000) / freq.QuadPart);
+
+       return ret;
+#else
        struct timespec ts;
        if (clock_gettime (CLOCK_MONOTONIC, &ts) != 0) {
                /* EEEK! */
                return 0;
        }
        return (microseconds_t) ts.tv_sec * 1000000 + (ts.tv_nsec/1000);
+#endif
 }