mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 09:13:39 +00:00
midimap: Introduce XP form and prefer it.
Since XP form doesn't support channel mappings, old form is remained for compatiblity. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51505 Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1e02ef4027
commit
dbf3b3b6bf
|
@ -36,7 +36,15 @@
|
|||
/*
|
||||
* Here's how Windows stores the midiOut mapping information.
|
||||
*
|
||||
* Full form (in HKU) is:
|
||||
* Windows XP form (in HKU) is:
|
||||
*
|
||||
* [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap]
|
||||
* "szPname"="TiMidity port 0"
|
||||
* (incomplete)
|
||||
*
|
||||
* szPname: name of midiOut device to use.
|
||||
*
|
||||
* If szPname isn't defined, we use Windows 2000 form (also in HKU):
|
||||
*
|
||||
* [Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap] 988836060
|
||||
* "AutoScheme"=dword:00000000
|
||||
|
@ -214,33 +222,41 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom)
|
|||
else
|
||||
{
|
||||
DWORD type, size, out;
|
||||
WCHAR buffer[256];
|
||||
WCHAR buffer[256];
|
||||
|
||||
ret = 2;
|
||||
size = sizeof(out);
|
||||
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
|
||||
size = sizeof(buffer);
|
||||
if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size))
|
||||
{
|
||||
size = sizeof(buffer);
|
||||
if (!RegQueryValueExW(hKey, L"CurrentScheme", 0, &type, (void*)buffer, &size))
|
||||
{
|
||||
if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
|
||||
}
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
|
||||
}
|
||||
if (ret == 2)
|
||||
else
|
||||
{
|
||||
size = sizeof(buffer);
|
||||
if (!RegQueryValueExW(hKey, L"CurrentInstrument", 0, &type, (void*)buffer, &size) && *buffer)
|
||||
ret = 2;
|
||||
size = sizeof(out);
|
||||
if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out)
|
||||
{
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
|
||||
size = sizeof(buffer);
|
||||
if (!RegQueryValueExW(hKey, L"CurrentScheme", 0, &type, (void*)buffer, &size))
|
||||
{
|
||||
if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer)))
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
if (ret == 2)
|
||||
{
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
|
||||
size = sizeof(buffer);
|
||||
if (!RegQueryValueExW(hKey, L"CurrentInstrument", 0, &type, (void*)buffer, &size) && *buffer)
|
||||
{
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue