winealsa: Move DRVM_INIT to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
33d7dd9268
commit
a6211e590f
|
@ -2444,7 +2444,6 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
set_event_handle,
|
||||
is_started,
|
||||
get_prop_value,
|
||||
midi_init,
|
||||
midi_release,
|
||||
midi_out_message,
|
||||
midi_in_message,
|
||||
|
|
|
@ -400,27 +400,22 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
|
|||
}
|
||||
}
|
||||
|
||||
NTSTATUS midi_init(void *args)
|
||||
static UINT midi_init(void)
|
||||
{
|
||||
struct midi_init_params *params = args;
|
||||
static BOOL init_done;
|
||||
snd_seq_client_info_t *cinfo;
|
||||
snd_seq_port_info_t *pinfo;
|
||||
snd_seq_t *seq;
|
||||
|
||||
if (init_done) {
|
||||
*params->err = ERROR_ALREADY_INITIALIZED;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
if (init_done)
|
||||
return ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
TRACE("Initializing the MIDI variables.\n");
|
||||
init_done = TRUE;
|
||||
|
||||
/* try to open device */
|
||||
if (!(seq = seq_open(NULL))) {
|
||||
*params->err = ERROR_OPEN_FAILED;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
if (!(seq = seq_open(NULL)))
|
||||
return ERROR_OPEN_FAILED;
|
||||
|
||||
cinfo = calloc( 1, snd_seq_client_info_sizeof() );
|
||||
pinfo = calloc( 1, snd_seq_port_info_sizeof() );
|
||||
|
@ -454,11 +449,9 @@ NTSTATUS midi_init(void *args)
|
|||
free( cinfo );
|
||||
free( pinfo );
|
||||
|
||||
*params->err = NOERROR;
|
||||
|
||||
TRACE("End\n");
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
NTSTATUS midi_release(void *args)
|
||||
|
@ -1369,6 +1362,9 @@ NTSTATUS midi_out_message(void *args)
|
|||
|
||||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
@ -1424,6 +1420,9 @@ NTSTATUS midi_in_message(void *args)
|
|||
|
||||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
|
|
@ -59,22 +59,6 @@ static void notify_client(struct notify_context *notify)
|
|||
* MIDI entry points *
|
||||
*======================================================================*/
|
||||
|
||||
/**************************************************************************
|
||||
* ALSA_MidiInit [internal]
|
||||
*
|
||||
* Initializes the MIDI devices information variables
|
||||
*/
|
||||
static BOOL ALSA_MidiInit(void)
|
||||
{
|
||||
struct midi_init_params params;
|
||||
UINT err;
|
||||
|
||||
params.err = &err;
|
||||
ALSA_CALL(midi_init, ¶ms);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* midMessage (WINEALSA.@)
|
||||
*/
|
||||
|
@ -87,11 +71,6 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
|
||||
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
||||
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
||||
switch (wMsg) {
|
||||
case DRVM_INIT:
|
||||
ALSA_MidiInit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
params.dev_id = wDevID;
|
||||
params.msg = wMsg;
|
||||
|
@ -123,12 +102,6 @@ DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n",
|
||||
wDevID, wMsg, dwUser, dwParam1, dwParam2);
|
||||
|
||||
switch (wMsg) {
|
||||
case DRVM_INIT:
|
||||
ALSA_MidiInit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
params.dev_id = wDevID;
|
||||
params.msg = wMsg;
|
||||
params.user = dwUser;
|
||||
|
|
|
@ -207,11 +207,6 @@ struct get_prop_value_params
|
|||
unsigned int *buffer_size;
|
||||
};
|
||||
|
||||
struct midi_init_params
|
||||
{
|
||||
UINT *err;
|
||||
};
|
||||
|
||||
struct notify_context
|
||||
{
|
||||
BOOL send_notify;
|
||||
|
@ -278,14 +273,12 @@ enum alsa_funcs
|
|||
alsa_set_event_handle,
|
||||
alsa_is_started,
|
||||
alsa_get_prop_value,
|
||||
alsa_midi_init,
|
||||
alsa_midi_release,
|
||||
alsa_midi_out_message,
|
||||
alsa_midi_in_message,
|
||||
alsa_midi_notify_wait,
|
||||
};
|
||||
|
||||
NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN;
|
||||
NTSTATUS midi_release(void *args) DECLSPEC_HIDDEN;
|
||||
NTSTATUS midi_out_message(void *args) DECLSPEC_HIDDEN;
|
||||
NTSTATUS midi_in_message(void *args) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue