From: Johannes Anderwald Date: Sat, 4 Dec 2010 18:53:51 +0000 (+0000) Subject: [AUDIO-BRINGUP] X-Git-Tag: backups/ros-branch-0_3_13@51035~84^2~32 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f0b3c9997fa835450296744301763986833dab18 [AUDIO-BRINGUP] - Fix line ids of source lines - Fix calculating line id of source lines - MS sndvol32 is still crashing in user32 svn path=/branches/audio-bringup/; revision=49951 --- diff --git a/lib/drivers/sound/mmixer/controls.c b/lib/drivers/sound/mmixer/controls.c index 2406c5de3ac..835601e8fa9 100644 --- a/lib/drivers/sound/mmixer/controls.c +++ b/lib/drivers/sound/mmixer/controls.c @@ -564,7 +564,7 @@ MMixerBuildMixerSourceLine( SrcLine->Line.cbStruct = sizeof(MIXERLINEW); SrcLine->Line.dwDestination = 0; SrcLine->Line.dwSource = DstLine->Line.cConnections; - SrcLine->Line.dwLineID = (DstLine->Line.cConnections * 0x10000)+ (MixerInfo->MixCaps.cDestinations-1); + SrcLine->Line.dwLineID = (DstLine->Line.cConnections * SOURCE_LINE)+ (MixerInfo->MixCaps.cDestinations-1); SrcLine->Line.fdwLine = MIXERLINE_LINEF_ACTIVE | MIXERLINE_LINEF_SOURCE; SrcLine->Line.dwUser = 0; SrcLine->Line.cChannels = DstLine->Line.cChannels; diff --git a/lib/drivers/sound/mmixer/mixer.c b/lib/drivers/sound/mmixer/mixer.c index f88ac689389..6457c78aad1 100644 --- a/lib/drivers/sound/mmixer/mixer.c +++ b/lib/drivers/sound/mmixer/mixer.c @@ -209,8 +209,12 @@ MMixerGetLineInfo( } /* calculate destination line id */ - DestinationLineID = (MixerLine->dwSource * DESTINATION_LINE) + MixerLine->dwDestination; + DestinationLineID = (MixerLine->dwSource * SOURCE_LINE) + MixerLine->dwDestination; + DPRINT("MixerName %S cDestinations %lu MixerLineName %S cConnections %lu dwSource %lu dwDestination %lu ID %lx\n", MixerInfo->MixCaps.szPname, MixerInfo->MixCaps.cDestinations, + MixerLineSrc->Line.szName, MixerLineSrc->Line.cConnections, + MixerLine->dwSource, MixerLine->dwDestination, + DestinationLineID); /* get target destination line id */ MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, DestinationLineID); @@ -240,7 +244,7 @@ MMixerGetLineInfo( if (!MixerLineSrc) { /* invalid parameter */ - DPRINT1("MixerName %S Line not found %lu\n", MixerInfo->MixCaps.szPname, MixerLine->dwLineID); + DPRINT1("MMixerGetLineInfo: MixerName %S Line not found %lu\n", MixerInfo->MixCaps.szPname, MixerLine->dwLineID); return MM_STATUS_INVALID_PARAMETER; } @@ -329,6 +333,9 @@ MMixerGetLineControls( Flags &= ~MIXER_OBJECTF_HMIXER; + DPRINT("MMixerGetLineControls MixerId %lu Flags %lu\n", MixerId, Flags); + + if (Flags == MIXER_GETLINECONTROLSF_ALL) { /* cast to mixer info */ @@ -339,6 +346,7 @@ MMixerGetLineControls( if (!MixerLineSrc) { /* invalid line id */ + DPRINT("MMixerGetLineControls Line not found %lx\n", MixerLineControls->dwLineID); return MM_STATUS_INVALID_PARAMETER; } /* copy line control(s) */ @@ -351,20 +359,25 @@ MMixerGetLineControls( /* cast to mixer info */ MixerInfo = (LPMIXER_INFO)MixerHandle; + /* get mixer line */ MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, MixerLineControls->dwLineID); if (!MixerLineSrc) { /* invalid line id */ + DPRINT1("MMixerGetLineControls Line not found %lx\n", MixerLineControls->dwLineID); return MM_STATUS_INVALID_PARAMETER; } - ASSERT(MixerLineSrc); + /* sanity checks */ + ASSERT(MixerLineControls->cControls == 1); + ASSERT(MixerLineControls->cbmxctrl == sizeof(MIXERCONTROLW)); + ASSERT(MixerLineControls->pamxctrl != NULL); Index = 0; for(Index = 0; Index < MixerLineSrc->Line.cControls; Index++) { - DPRINT("dwControlType %x\n", MixerLineSrc->LineControls[Index].dwControlType); + DPRINT1("dwControlType %x\n", MixerLineSrc->LineControls[Index].dwControlType); if (MixerLineControls->dwControlType == MixerLineSrc->LineControls[Index].dwControlType) { /* found a control with that type */ @@ -385,15 +398,24 @@ MMixerGetLineControls( if (Status != MM_STATUS_SUCCESS) { /* invalid parameter */ + DPRINT("MMixerGetLineControls ControlID not found %lx\n", MixerLineControls->dwLineID); return MM_STATUS_INVALID_PARAMETER; } + ASSERT(MixerLineControls->cControls == 1); + ASSERT(MixerLineControls->cbmxctrl == sizeof(MIXERCONTROLW)); + ASSERT(MixerLineControls->pamxctrl != NULL); + + DPRINT("MMixerGetLineControls ControlID %lx ControlType %lx Name %S\n", MixerControl->dwControlID, MixerControl->dwControlType, MixerControl->szName); + /* copy the controls */ MixerContext->Copy(MixerLineControls->pamxctrl, MixerControl, sizeof(MIXERCONTROLW)); + MixerLineControls->pamxctrl->szName[MIXER_LONG_NAME_CHARS-1] = L'\0'; + MixerLineControls->pamxctrl->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0'; + return MM_STATUS_SUCCESS; } - - + UNIMPLEMENTED return MM_STATUS_NOT_IMPLEMENTED; } diff --git a/lib/drivers/sound/mmixer/priv.h b/lib/drivers/sound/mmixer/priv.h index 8a4855f8ca8..e36802b99c7 100644 --- a/lib/drivers/sound/mmixer/priv.h +++ b/lib/drivers/sound/mmixer/priv.h @@ -170,8 +170,8 @@ typedef struct }EVENT_NOTIFICATION_ENTRY, *PEVENT_NOTIFICATION_ENTRY; -#define DESTINATION_LINE 0xFFFF0000 - +#define DESTINATION_LINE (0xFFFF0000) +#define SOURCE_LINE (0x10000) ULONG MMixerGetFilterPinCount( IN PMIXER_CONTEXT MixerContext,