[ros-diffs] [janderwald] 49993: [AUDIO-BRINGUP] - Respect channel count which defines if the control acts uniform or per channel - Fix bug in MMixerSetGetMuxControlDetails

janderwald at svn.reactos.org janderwald at svn.reactos.org
Thu Dec 9 11:34:00 UTC 2010


Author: janderwald
Date: Thu Dec  9 11:33:58 2010
New Revision: 49993

URL: http://svn.reactos.org/svn/reactos?rev=49993&view=rev
Log:
[AUDIO-BRINGUP]
- Respect channel count which defines if the control acts uniform or per channel
- Fix bug in MMixerSetGetMuxControlDetails

Added:
    branches/audio-bringup/lib/drivers/sound/mmixer/TODO
Modified:
    branches/audio-bringup/lib/drivers/sound/mmixer/controls.c
    branches/audio-bringup/lib/drivers/sound/mmixer/sup.c

Added: branches/audio-bringup/lib/drivers/sound/mmixer/TODO
URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/lib/drivers/sound/mmixer/TODO?rev=49993&view=auto
==============================================================================
--- branches/audio-bringup/lib/drivers/sound/mmixer/TODO (added)
+++ branches/audio-bringup/lib/drivers/sound/mmixer/TODO [iso-8859-1] Thu Dec  9 11:33:58 2010
@@ -1,0 +1,6 @@
+=== MMIXER TASKS ===
+
+- Add hacks for source lines, such that Wave Mixer line always has a volume control
+- Support custom mixer controls
+- Assign mixer controls after all controls have been assigned (starting on the destination lines)
+- TESTING & BUGFIXING

Modified: branches/audio-bringup/lib/drivers/sound/mmixer/controls.c
URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/lib/drivers/sound/mmixer/controls.c?rev=49993&r1=49992&r2=49993&view=diff
==============================================================================
--- branches/audio-bringup/lib/drivers/sound/mmixer/controls.c [iso-8859-1] (original)
+++ branches/audio-bringup/lib/drivers/sound/mmixer/controls.c [iso-8859-1] Thu Dec  9 11:33:58 2010
@@ -35,7 +35,8 @@
     IN HANDLE hMixer,
     IN PTOPOLOGY Topology,
     IN ULONG NodeIndex,
-    IN LPMIXERLINE_EXT MixerLine)
+    IN LPMIXERLINE_EXT MixerLine,
+    IN ULONG MaxChannels)
 {
     LPGUID NodeType;
     KSP_NODE Node;
@@ -66,7 +67,7 @@
     /* store control type */
     MixerControl->Control.dwControlType = MMixerGetControlTypeFromTopologyNode(NodeType);
 
-    MixerControl->Control.fdwControl = MIXERCONTROL_CONTROLF_UNIFORM; /* FIXME */
+    MixerControl->Control.fdwControl = (MaxChannels > 1 ? 0 : MIXERCONTROL_CONTROLF_UNIFORM);
     MixerControl->Control.cMultipleItems = 0;
 
     /* setup request to retrieve name */
@@ -136,7 +137,7 @@
         MixerControl->Control.Bounds.dwMaximum = NodesCount - 1;
         MixerControl->Control.Metrics.dwReserved[0] = NodesCount;
         MixerControl->Control.cMultipleItems = NodesCount;
-        MixerControl->Control.fdwControl |= MIXERCONTROL_CONTROLF_MULTIPLE;
+        MixerControl->Control.fdwControl |= MIXERCONTROL_CONTROLF_UNIFORM | MIXERCONTROL_CONTROLF_MULTIPLE;
     }
     else if (MixerControl->Control.dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE)
     {
@@ -695,9 +696,14 @@
             /* calculate maximum channels */
             DstLine->Line.cChannels = min(DstLine->Line.cChannels, MaxChannels);
         }
+        else
+        {
+            /* use default of one channel */
+            MaxChannels = 1;
+        }
 
         /* now add the mixer control */
-        Status = MMixerAddMixerControl(MixerContext, MixerInfo, hMixer, Topology, Nodes[Index], DstLine);
+        Status = MMixerAddMixerControl(MixerContext, MixerInfo, hMixer, Topology, Nodes[Index], DstLine, MaxChannels);
 
         if (Status == MM_STATUS_SUCCESS)
         {

Modified: branches/audio-bringup/lib/drivers/sound/mmixer/sup.c
URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/lib/drivers/sound/mmixer/sup.c?rev=49993&r1=49992&r2=49993&view=diff
==============================================================================
--- branches/audio-bringup/lib/drivers/sound/mmixer/sup.c [iso-8859-1] (original)
+++ branches/audio-bringup/lib/drivers/sound/mmixer/sup.c [iso-8859-1] Thu Dec  9 11:33:58 2010
@@ -536,6 +536,14 @@
                 return Status;
             }
 
+            /* gets the corresponding mixer data */
+            MixerData = MMixerGetMixerDataByDeviceHandle(MixerContext, MixerControl->hDevice);
+
+            /* sanity check */
+            ASSERT(MixerData);
+            ASSERT(MixerData->Topology);
+            ASSERT(MixerData->MixerInfo == MixerInfo);
+
             /* get logical pin nodes */
             MMixerGetConnectedFromLogicalTopologyPins(MixerData->Topology, MixerControl->NodeID, &LogicalNodesCount, LogicalNodes);
 




More information about the Ros-diffs mailing list