#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 "mmcss.h"
-
#include "debug.h"
static const uint32_t MIDI_BUFFER_SIZE = 32768;
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])
{
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 ());
DEBUG_THREADS (string_compose (
"WinMME input Thread ID Changed: was %1, now %2\n", otid, ntid));
}
+#endif
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
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;
if (result != MMSYSERR_NOERROR) {
DEBUG_MIDI (get_error_string (result));
}
-#endif
}
// fix param order
}
// 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",