mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
Merge 50de723d1c
into c5325f5016
This commit is contained in:
commit
e8ecb6423e
2 changed files with 28 additions and 35 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue