Commit 05731b14 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winecoreaudio: Move midi_in_start and midi_in_stop to the unixlib.

parent 15bb0e79
...@@ -851,6 +851,33 @@ static DWORD midi_in_get_num_devs(void) ...@@ -851,6 +851,33 @@ static DWORD midi_in_get_num_devs(void)
return num_srcs; return num_srcs;
} }
static DWORD midi_in_start(WORD dev_id)
{
TRACE("%d\n", dev_id);
if (dev_id >= num_srcs)
{
WARN("bad device ID : %d\n", dev_id);
return MMSYSERR_BADDEVICEID;
}
srcs[dev_id].state = 1;
srcs[dev_id].startTime = NtGetTickCount();
return MMSYSERR_NOERROR;
}
static DWORD midi_in_stop(WORD dev_id)
{
TRACE("%d\n", dev_id);
if (dev_id >= num_srcs)
{
WARN("bad device ID : %d\n", dev_id);
return MMSYSERR_BADDEVICEID;
}
srcs[dev_id].state = 0;
return MMSYSERR_NOERROR;
}
NTSTATUS midi_out_message(void *args) NTSTATUS midi_out_message(void *args)
{ {
struct midi_out_message_params *params = args; struct midi_out_message_params *params = args;
...@@ -938,6 +965,12 @@ NTSTATUS midi_in_message(void *args) ...@@ -938,6 +965,12 @@ NTSTATUS midi_in_message(void *args)
case MIDM_GETNUMDEVS: case MIDM_GETNUMDEVS:
*params->err = midi_in_get_num_devs(); *params->err = midi_in_get_num_devs();
break; break;
case MIDM_START:
*params->err = midi_in_start(params->dev_id);
break;
case MIDM_STOP:
*params->err = midi_in_stop(params->dev_id);
break;
default: default:
TRACE("Unsupported message\n"); TRACE("Unsupported message\n");
*params->err = MMSYSERR_NOTSUPPORTED; *params->err = MMSYSERR_NOTSUPPORTED;
......
...@@ -194,30 +194,6 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) ...@@ -194,30 +194,6 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
static DWORD MIDIIn_Start(WORD wDevID)
{
TRACE("%d\n", wDevID);
if (wDevID >= MIDIIn_NumDevs) {
WARN("bad device ID : %d\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
sources[wDevID].state = 1;
sources[wDevID].startTime = GetTickCount();
return MMSYSERR_NOERROR;
}
static DWORD MIDIIn_Stop(WORD wDevID)
{
TRACE("%d\n", wDevID);
if (wDevID >= MIDIIn_NumDevs) {
WARN("bad device ID : %d\n", wDevID);
return MMSYSERR_BADDEVICEID;
}
sources[wDevID].state = 0;
return MMSYSERR_NOERROR;
}
static DWORD MIDIIn_Reset(WORD wDevID) static DWORD MIDIIn_Reset(WORD wDevID)
{ {
DWORD dwTime = GetTickCount(); DWORD dwTime = GetTickCount();
...@@ -414,10 +390,6 @@ DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWOR ...@@ -414,10 +390,6 @@ DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWOR
switch (wMsg) { switch (wMsg) {
case MIDM_ADDBUFFER: case MIDM_ADDBUFFER:
return MIDIIn_AddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2); return MIDIIn_AddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_START:
return MIDIIn_Start(wDevID);
case MIDM_STOP:
return MIDIIn_Stop(wDevID);
case MIDM_RESET: case MIDM_RESET:
return MIDIIn_Reset(wDevID); return MIDIIn_Reset(wDevID);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment