winealsa.drv: Clean up initialisation.
This commit is contained in:
parent
3beb1b6a11
commit
755c25d84e
|
@ -725,8 +725,7 @@ LRESULT CALLBACK ALSA_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
|||
|
||||
switch(wMsg) {
|
||||
#ifdef HAVE_ALSA
|
||||
case DRV_LOAD: ALSA_WaveInit();
|
||||
ALSA_MidiInit();
|
||||
case DRV_LOAD:
|
||||
case DRV_FREE:
|
||||
case DRV_OPEN:
|
||||
case DRV_CLOSE:
|
||||
|
|
|
@ -199,10 +199,7 @@ DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc);
|
|||
DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv);
|
||||
DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc);
|
||||
|
||||
/* midi.c */
|
||||
extern LONG ALSA_MidiInit(void);
|
||||
|
||||
/* waveinit.c */
|
||||
extern LONG ALSA_WaveInit(void);
|
||||
extern void ALSA_WaveInit(void);
|
||||
|
||||
#endif /* __ALSA_H */
|
||||
|
|
|
@ -1222,8 +1222,6 @@ static void ALSA_AddMidiPort(snd_seq_client_info_t* cinfo, snd_seq_port_info_t*
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_ALSA */
|
||||
|
||||
|
||||
/*======================================================================*
|
||||
* MIDI entry points *
|
||||
|
@ -1234,9 +1232,8 @@ static void ALSA_AddMidiPort(snd_seq_client_info_t* cinfo, snd_seq_port_info_t*
|
|||
*
|
||||
* Initializes the MIDI devices information variables
|
||||
*/
|
||||
LONG ALSA_MidiInit(void)
|
||||
static LONG ALSA_MidiInit(void)
|
||||
{
|
||||
#ifdef HAVE_ALSA
|
||||
static BOOL bInitDone = FALSE;
|
||||
snd_seq_client_info_t *cinfo;
|
||||
snd_seq_port_info_t *pinfo;
|
||||
|
@ -1290,10 +1287,11 @@ LONG ALSA_MidiInit(void)
|
|||
HeapFree( GetProcessHeap(), 0, pinfo );
|
||||
|
||||
TRACE("End\n");
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
* midMessage (WINEALSA.@)
|
||||
*/
|
||||
|
@ -1305,6 +1303,7 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
switch (wMsg) {
|
||||
#ifdef HAVE_ALSA
|
||||
case DRVM_INIT:
|
||||
ALSA_MidiInit();
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
@ -1349,6 +1348,7 @@ DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
switch (wMsg) {
|
||||
#ifdef HAVE_ALSA
|
||||
case DRVM_INIT:
|
||||
ALSA_MidiInit();
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
|
|
@ -750,6 +750,7 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
|
||||
switch (wMsg) {
|
||||
case DRVM_INIT:
|
||||
ALSA_WaveInit();
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
|
|
@ -962,7 +962,7 @@ static int ALSA_AddUserSpecifiedDevice(const char *ctlname, const char *pcmname)
|
|||
** is a way to exactly specify the devices used by Wine.
|
||||
**
|
||||
*/
|
||||
LONG ALSA_WaveInit(void)
|
||||
void ALSA_WaveInit(void)
|
||||
{
|
||||
DWORD rc;
|
||||
BOOL AutoScanCards = TRUE;
|
||||
|
@ -971,6 +971,10 @@ LONG ALSA_WaveInit(void)
|
|||
DWORD DeviceCount = 0;
|
||||
HKEY key = 0;
|
||||
int i;
|
||||
static int loaded;
|
||||
|
||||
if (loaded++)
|
||||
return;
|
||||
|
||||
/* @@ Wine registry key: HKCU\Software\Wine\Alsa Driver */
|
||||
rc = RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Wine\\Alsa Driver", 0, KEY_QUERY_VALUE, &key);
|
||||
|
@ -983,7 +987,7 @@ LONG ALSA_WaveInit(void)
|
|||
}
|
||||
|
||||
if (AutoScanCards)
|
||||
rc = ALSA_PerformDefaultScan(UseDirectHW, AutoScanDevices);
|
||||
ALSA_PerformDefaultScan(UseDirectHW, AutoScanDevices);
|
||||
|
||||
for (i = 0; i < DeviceCount; i++)
|
||||
{
|
||||
|
@ -1005,8 +1009,6 @@ LONG ALSA_WaveInit(void)
|
|||
|
||||
if (key)
|
||||
RegCloseKey(key);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
#endif /* HAVE_ALSA */
|
||||
|
|
|
@ -1169,6 +1169,7 @@ DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
|
|||
|
||||
switch (wMsg) {
|
||||
case DRVM_INIT:
|
||||
ALSA_WaveInit();
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
case DRVM_DISABLE:
|
||||
|
|
Loading…
Reference in New Issue