@@ -64,11 +64,8 @@ JackWinMMEInputPort::JackWinMMEInputPort(const char *alias_name, | |||||
goto delete_sysex_buffer; | goto delete_sysex_buffer; | ||||
} | } | ||||
sysex_header.dwBufferLength = max_bytes; | sysex_header.dwBufferLength = max_bytes; | ||||
sysex_header.dwBytesRecorded = 0; | |||||
sysex_header.dwFlags = 0; | sysex_header.dwFlags = 0; | ||||
sysex_header.dwUser = 0; | |||||
sysex_header.lpData = (LPSTR)(((LPBYTE) &sysex_header) + sizeof(MIDIHDR)); | sysex_header.lpData = (LPSTR)(((LPBYTE) &sysex_header) + sizeof(MIDIHDR)); | ||||
sysex_header.lpNext = 0; | |||||
result = midiInPrepareHeader(handle, &sysex_header, sizeof(MIDIHDR)); | result = midiInPrepareHeader(handle, &sysex_header, sizeof(MIDIHDR)); | ||||
if (result != MMSYSERR_NOERROR) { | if (result != MMSYSERR_NOERROR) { | ||||
GetInErrorString(result, error_message); | GetInErrorString(result, error_message); | ||||
@@ -104,7 +101,7 @@ JackWinMMEInputPort::JackWinMMEInputPort(const char *alias_name, | |||||
result = midiInUnprepareHeader(handle, &sysex_header, sizeof(MIDIHDR)); | result = midiInUnprepareHeader(handle, &sysex_header, sizeof(MIDIHDR)); | ||||
if (result != MMSYSERR_NOERROR) { | if (result != MMSYSERR_NOERROR) { | ||||
WriteInError("JackWinMMEInputPort [constructor]", | WriteInError("JackWinMMEInputPort [constructor]", | ||||
"midiInUnprepareHeader", result); | |||||
"midiInUnprepareHeader", result); | |||||
} | } | ||||
close_handle: | close_handle: | ||||
result = midiInClose(handle); | result = midiInClose(handle); | ||||
@@ -184,11 +184,8 @@ JackWinMMEOutputPort::Execute() | |||||
} | } | ||||
MIDIHDR header; | MIDIHDR header; | ||||
header.dwBufferLength = size; | header.dwBufferLength = size; | ||||
header.dwBytesRecorded = size; | |||||
header.dwFlags = 0; | header.dwFlags = 0; | ||||
header.dwOffset = 0; | |||||
header.dwUser = 0; | |||||
header.lpData = (LPSTR)data; | |||||
header.lpData = (LPSTR) data; | |||||
result = midiOutPrepareHeader(handle, &header, sizeof(MIDIHDR)); | result = midiOutPrepareHeader(handle, &header, sizeof(MIDIHDR)); | ||||
if (result != MMSYSERR_NOERROR) { | if (result != MMSYSERR_NOERROR) { | ||||
WriteOutError("JackWinMMEOutputPort::Execute", | WriteOutError("JackWinMMEOutputPort::Execute", | ||||
@@ -215,7 +212,6 @@ JackWinMMEOutputPort::Execute() | |||||
"midiOutUnprepareHeader", result); | "midiOutUnprepareHeader", result); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
@@ -236,7 +232,7 @@ JackWinMMEOutputPort::HandleMessage(UINT message, DWORD_PTR param1, | |||||
jack_info("JackWinMMEOutputPort::HandleMessage - MIDI device opened."); | jack_info("JackWinMMEOutputPort::HandleMessage - MIDI device opened."); | ||||
break; | break; | ||||
case MOM_POSITIONCB: | case MOM_POSITIONCB: | ||||
LPMIDIHDR header = (LPMIDIHDR) param2; | |||||
LPMIDIHDR header = (LPMIDIHDR) param1; | |||||
jack_info("JackWinMMEOutputPort::HandleMessage - %d bytes out of %d " | jack_info("JackWinMMEOutputPort::HandleMessage - %d bytes out of %d " | ||||
"bytes of the current sysex message have been sent.", | "bytes of the current sysex message have been sent.", | ||||
header->dwOffset, header->dwBytesRecorded); | header->dwOffset, header->dwBytesRecorded); | ||||