Fixes unmuting when unmuted.

Unifies scale reported with scale used for volume control.
Hack for Bass/Treble until better fix is complete.
This commit is contained in:
Ed Snow 2000-07-15 21:28:51 +00:00 committed by Alexandre Julliard
parent 1dde1e536a
commit 276495e3af
1 changed files with 11 additions and 4 deletions

View File

@ -149,6 +149,10 @@ static DWORD MIX_GetLineInfoFromIndex(LPMIXERLINEA lpMl, int devmask, DWORD idx)
lpMl->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; lpMl->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;
lpMl->fdwLine |= MIXERLINE_LINEF_SOURCE; lpMl->fdwLine |= MIXERLINE_LINEF_SOURCE;
break; break;
case SOUND_MIXER_BASS:
case SOUND_MIXER_TREBLE:
WARN("BASS/TREBLE not handled correctly.\n");
return MMSYSERR_NOERROR;
default: default:
WARN("Index %ld not handled.\n", idx); WARN("Index %ld not handled.\n", idx);
return MIXERR_INVALLINE; return MIXERR_INVALLINE;
@ -346,12 +350,11 @@ static void MIX_DoGetLineControls(LPMIXERCONTROLA mc, DWORD lineID, DWORD dwType
memset(&mc->Bounds, 0, sizeof(mc->Bounds)); memset(&mc->Bounds, 0, sizeof(mc->Bounds));
/* CONTROLTYPE_VOLUME uses the MIXER_CONTROLDETAILS_UNSIGNED struct, /* CONTROLTYPE_VOLUME uses the MIXER_CONTROLDETAILS_UNSIGNED struct,
* [0, 100] is the range supported by OSS * [0, 100] is the range supported by OSS
* FIXME: sounds like MIXERCONTROL_CONTROLTYPE_VOLUME is always between 0 and 65536 * whatever the min and max values are they must match
* whatever the min and max values are... * conversions done in (Get|Set)ControlDetails to stay in [0, 100] range
* look at conversions done in (Get|Set)ControlDetails to stay in [0, 100] range
*/ */
mc->Bounds.s1.dwMinimum = 0; mc->Bounds.s1.dwMinimum = 0;
mc->Bounds.s1.dwMaximum = 100; mc->Bounds.s1.dwMaximum = 65535;
memset(&mc->Metrics, 0, sizeof(mc->Metrics)); memset(&mc->Metrics, 0, sizeof(mc->Metrics));
break; break;
case MIXERCONTROL_CONTROLTYPE_MUTE: case MIXERCONTROL_CONTROLTYPE_MUTE:
@ -557,6 +560,10 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO
if (!MIX_SetVal(lineID, 0)) if (!MIX_SetVal(lineID, 0))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} else { } else {
if (MIX_Volume[lineID] == -1) {
ret = MMSYSERR_NOERROR;
break;
}
if (!MIX_SetVal(lineID, MIX_Volume[lineID])) if (!MIX_SetVal(lineID, MIX_Volume[lineID]))
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
MIX_Volume[lineID] = -1; MIX_Volume[lineID] = -1;