projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
try enabling windows MME MIDI sysex support
[ardour.git]
/
libs
/
backends
/
portaudio
/
winmmemidi_input_device.cc
diff --git
a/libs/backends/portaudio/winmmemidi_input_device.cc
b/libs/backends/portaudio/winmmemidi_input_device.cc
index 3b52bcefd213c5b647e78092b0919aa36bbb97da..9fcee83efb4aa9dec47926bd1068f693f47f1b31 100644
(file)
--- a/
libs/backends/portaudio/winmmemidi_input_device.cc
+++ b/
libs/backends/portaudio/winmmemidi_input_device.cc
@@
-22,12
+22,11
@@
#include <cmath>
#include "pbd/compose.h"
#include <cmath>
#include "pbd/compose.h"
+#include "pbd/windows_timer_utils.h"
+#include "pbd/windows_mmcss.h"
-#include "win_utils.h"
#include "midi_util.h"
#include "midi_util.h"
-#include "mmcss.h"
-
#include "debug.h"
static const uint32_t MIDI_BUFFER_SIZE = 32768;
#include "debug.h"
static const uint32_t MIDI_BUFFER_SIZE = 32768;
@@
-37,6
+36,7
@@
namespace ARDOUR {
WinMMEMidiInputDevice::WinMMEMidiInputDevice (int index)
: m_handle(0)
WinMMEMidiInputDevice::WinMMEMidiInputDevice (int index)
: m_handle(0)
+ , m_started(false)
, m_midi_buffer(new RingBuffer<uint8_t>(MIDI_BUFFER_SIZE))
, m_sysex_buffer(new uint8_t[SYSEX_BUFFER_SIZE])
{
, m_midi_buffer(new RingBuffer<uint8_t>(MIDI_BUFFER_SIZE))
, m_sysex_buffer(new uint8_t[SYSEX_BUFFER_SIZE])
{
@@
-182,6
+182,7
@@
WinMMEMidiInputDevice::winmm_input_callback(HMIDIIN handle,
static HANDLE input_thread = GetCurrentThread ();
static bool priority_boosted = false;
static HANDLE input_thread = GetCurrentThread ();
static bool priority_boosted = false;
+#if 0 // GetThreadId() is Vista or later only.
if (input_thread != GetCurrentThread ()) {
DWORD otid = GetThreadId (input_thread);
DWORD ntid = GetThreadId (GetCurrentThread ());
if (input_thread != GetCurrentThread ()) {
DWORD otid = GetThreadId (input_thread);
DWORD ntid = GetThreadId (GetCurrentThread ());
@@
-191,12
+192,13
@@
WinMMEMidiInputDevice::winmm_input_callback(HMIDIIN handle,
DEBUG_THREADS (string_compose (
"WinMME input Thread ID Changed: was %1, now %2\n", otid, ntid));
}
DEBUG_THREADS (string_compose (
"WinMME input Thread ID Changed: was %1, now %2\n", otid, ntid));
}
+#endif
HANDLE task_handle;
if (!priority_boosted) {
HANDLE task_handle;
if (!priority_boosted) {
-
mmcss
::set_thread_characteristics ("Pro Audio", &task_handle);
-
mmcss::set_thread_priority (task_handle, mmcss
::AVRT_PRIORITY_HIGH);
+
PBD::MMCSS
::set_thread_characteristics ("Pro Audio", &task_handle);
+
PBD::MMCSS::set_thread_priority (task_handle, PBD::MMCSS
::AVRT_PRIORITY_HIGH);
priority_boosted = true;
}
#endif
priority_boosted = true;
}
#endif
@@
-245,7
+247,6
@@
void
WinMMEMidiInputDevice::handle_sysex_msg (MIDIHDR* const midi_header,
uint32_t timestamp)
{
WinMMEMidiInputDevice::handle_sysex_msg (MIDIHDR* const midi_header,
uint32_t timestamp)
{
-#ifdef ENABLE_SYSEX
LPMIDIHDR header = (LPMIDIHDR)midi_header;
size_t byte_count = header->dwBytesRecorded;
LPMIDIHDR header = (LPMIDIHDR)midi_header;
size_t byte_count = header->dwBytesRecorded;
@@
-267,7
+268,6
@@
WinMMEMidiInputDevice::handle_sysex_msg (MIDIHDR* const midi_header,
if (result != MMSYSERR_NOERROR) {
DEBUG_MIDI (get_error_string (result));
}
if (result != MMSYSERR_NOERROR) {
DEBUG_MIDI (get_error_string (result));
}
-#endif
}
// fix param order
}
// fix param order
@@
-343,7
+343,7
@@
WinMMEMidiInputDevice::enqueue_midi_msg (const uint8_t* midi_data,
}
// don't use winmme timestamps for now
}
// don't use winmme timestamps for now
- uint64_t ts =
utils
::get_microseconds ();
+ uint64_t ts =
PBD
::get_microseconds ();
DEBUG_TIMING (string_compose (
"Enqueing MIDI data device: %1 with timestamp: %2 and size %3\n",
DEBUG_TIMING (string_compose (
"Enqueing MIDI data device: %1 with timestamp: %2 and size %3\n",