This commit is contained in:
Oleg Dubinskiy 2025-03-30 17:18:26 +02:00 committed by GitHub
commit e8ecb6423e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 35 deletions

View file

@ -190,7 +190,7 @@ MMixerAddMixerControl(
DPRINT("NodeIndex %u Range Min %d Max %d Steps %x UMin %x UMax %x\n", NodeIndex, Range->Bounds.SignedMinimum, Range->Bounds.SignedMaximum, Range->SteppingDelta, Range->Bounds.UnsignedMinimum, Range->Bounds.UnsignedMaximum);
MaxRange = Range->Bounds.UnsignedMaximum - Range->Bounds.UnsignedMinimum;
MaxRange = Range->Bounds.SignedMaximum - Range->Bounds.SignedMinimum;
if (MaxRange)
{

View file

@ -671,10 +671,9 @@ MMixerSetGetVolumeControlDetails(
IN LPMIXERCONTROLDETAILS MixerControlDetails,
LPMIXERLINE_EXT MixerLine)
{
LPMIXERCONTROLDETAILS_UNSIGNED Input;
LPMIXERCONTROLDETAILS_SIGNED Input;
LONG Value;
ULONG Index, Channel = 0;
ULONG dwValue;
ULONG Index, Channel;
MIXER_STATUS Status;
LPMIXERVOLUME_DATA VolumeData;
@ -685,47 +684,41 @@ MMixerSetGetVolumeControlDetails(
if (!VolumeData)
return MM_STATUS_UNSUCCESSFUL;
/* get input */
Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
/* Get input */
Input = (LPMIXERCONTROLDETAILS_SIGNED)MixerControlDetails->paDetails;
if (!Input)
return MM_STATUS_UNSUCCESSFUL; /* to prevent dereferencing NULL */
return MM_STATUS_UNSUCCESSFUL; /* To prevent dereferencing NULL */
if (bSet)
/* Loop for each channel */
for (Channel = 0; Channel < MixerControlDetails->cChannels; Channel++)
{
/* FIXME SEH */
Value = Input->dwValue;
Index = Value / VolumeData->InputSteppingDelta;
if (Index >= VolumeData->ValuesCount)
if (bSet)
{
DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
return MM_STATUS_INVALID_PARAMETER;
/* FIXME SEH */
Index = Input[Channel].lValue / VolumeData->InputSteppingDelta;
if (Index >= VolumeData->ValuesCount)
{
DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
return MM_STATUS_INVALID_PARAMETER;
}
Value = VolumeData->Values[Index];
}
Value = VolumeData->Values[Index];
/* Get/set control details */
Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, NodeId, bSet, KSPROPERTY_AUDIO_VOLUMELEVEL, Channel, &Value);
if (!bSet)
{
/* FIXME SEH */
Input[Channel].lValue = MMixerGetVolumeControlIndex(VolumeData, Value);
}
}
/* set control details */
if (bSet)
{
/* TODO */
Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, NodeId, bSet, KSPROPERTY_AUDIO_VOLUMELEVEL, 0, &Value);
Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, NodeId, bSet, KSPROPERTY_AUDIO_VOLUMELEVEL, 1, &Value);
}
else
{
Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, NodeId, bSet, KSPROPERTY_AUDIO_VOLUMELEVEL, Channel, &Value);
}
if (!bSet)
{
dwValue = MMixerGetVolumeControlIndex(VolumeData, (LONG)Value);
/* FIXME SEH */
Input->dwValue = dwValue;
}
else
{
/* notify clients of a line change MM_MIXM_CONTROL_CHANGE with MixerControl->dwControlID */
/* Notify clients of a line change MM_MIXM_CONTROL_CHANGE with MixerControl->dwControlID */
MMixerNotifyControlChange(MixerContext, MixerInfo, MM_MIXM_CONTROL_CHANGE, MixerControl->Control.dwControlID);
}
return Status;