add a bit of debugging to JACK transport code
[ardour.git] / libs / backends / portaudio / winmmemidi_output_device.cc
index 2f6ad018958120e2cdfb6aa20c2b55c29e2b22d5..8d699f25cc82cc18111e2ed2fac98e10b32f8ade 100644 (file)
@@ -1,5 +1,7 @@
 /*
- * Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2015 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
  *
  * 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
@@ -11,9 +13,9 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "winmmemidi_output_device.h"
 
 #include "pbd/debug.h"
 #include "pbd/compose.h"
+#include "pbd/pthread_utils.h"
 #include "pbd/windows_timer_utils.h"
 #include "pbd/windows_mmcss.h"
 
-#include "rt_thread.h"
 #include "midi_util.h"
 
 #include "debug.h"
@@ -45,7 +47,7 @@ WinMMEMidiOutputDevice::WinMMEMidiOutputDevice (int index)
        , m_enabled(false)
        , m_thread_running(false)
        , m_thread_quit(false)
-       , m_midi_buffer(new RingBuffer<uint8_t>(MIDI_BUFFER_SIZE))
+       , m_midi_buffer(new PBD::RingBuffer<uint8_t>(MIDI_BUFFER_SIZE))
 {
        DEBUG_MIDI (string_compose ("Creating midi output device index: %1\n", index));
 
@@ -230,7 +232,7 @@ WinMMEMidiOutputDevice::start_midi_output_thread ()
        size_t stacksize = 100000;
 
        // TODO Use native threads
-       if (_realtime_pthread_create (SCHED_FIFO, -21, stacksize,
+       if (pbd_realtime_pthread_create (PBD_SCHED_FIFO, -21, stacksize,
                                &m_output_thread_handle, midi_output_thread, this)) {
                return false;
        }
@@ -430,10 +432,10 @@ WinMMEMidiOutputDevice::midi_output_thread ()
                switch (h.size) {
                case 3:
                        message |= (((DWORD)data[2]) << 16);
-               // Fallthrough on purpose.
+                       /* fallthrough */
                case 2:
                        message |= (((DWORD)data[1]) << 8);
-               // Fallthrough on purpose.
+                       /* fallthrough */
                case 1:
                        message |= (DWORD)data[0];
                        result = midiOutShortMsg (m_handle, message);