[AUDIO-BRINGUP]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 9 Dec 2010 11:33:58 +0000 (11:33 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 9 Dec 2010 11:33:58 +0000 (11:33 +0000)
- Respect channel count which defines if the control acts uniform or per channel
- Fix bug in MMixerSetGetMuxControlDetails

svn path=/branches/audio-bringup/; revision=49993

lib/drivers/sound/mmixer/TODO [new file with mode: 0644]
lib/drivers/sound/mmixer/controls.c
lib/drivers/sound/mmixer/sup.c

diff --git a/lib/drivers/sound/mmixer/TODO b/lib/drivers/sound/mmixer/TODO
new file mode 100644 (file)
index 0000000..05cf9c2
--- /dev/null
@@ -0,0 +1,6 @@
+=== MMIXER TASKS ===\r
+\r
+- Add hacks for source lines, such that Wave Mixer line always has a volume control\r
+- Support custom mixer controls\r
+- Assign mixer controls after all controls have been assigned (starting on the destination lines)\r
+- TESTING & BUGFIXING
\ No newline at end of file
index a0ba67a..e7bd288 100644 (file)
@@ -35,7 +35,8 @@ MMixerAddMixerControl(
     IN HANDLE hMixer,
     IN PTOPOLOGY Topology,
     IN ULONG NodeIndex,
     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;
 {
     LPGUID NodeType;
     KSP_NODE Node;
@@ -66,7 +67,7 @@ MMixerAddMixerControl(
     /* store control type */
     MixerControl->Control.dwControlType = MMixerGetControlTypeFromTopologyNode(NodeType);
 
     /* 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 */
     MixerControl->Control.cMultipleItems = 0;
 
     /* setup request to retrieve name */
@@ -136,7 +137,7 @@ MMixerAddMixerControl(
         MixerControl->Control.Bounds.dwMaximum = NodesCount - 1;
         MixerControl->Control.Metrics.dwReserved[0] = NodesCount;
         MixerControl->Control.cMultipleItems = NodesCount;
         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)
     {
     }
     else if (MixerControl->Control.dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE)
     {
@@ -695,9 +696,14 @@ MMixerAddMixerControlsToMixerLineByNodeIndexArray(
             /* calculate maximum channels */
             DstLine->Line.cChannels = min(DstLine->Line.cChannels, MaxChannels);
         }
             /* calculate maximum channels */
             DstLine->Line.cChannels = min(DstLine->Line.cChannels, MaxChannels);
         }
+        else
+        {
+            /* use default of one channel */
+            MaxChannels = 1;
+        }
 
         /* now add the mixer control */
 
         /* 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)
         {
 
         if (Status == MM_STATUS_SUCCESS)
         {
index 7526ef6..9052e94 100644 (file)
@@ -536,6 +536,14 @@ MMixerSetGetMuxControlDetails(
                 return Status;
             }
 
                 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);
 
             /* get logical pin nodes */
             MMixerGetConnectedFromLogicalTopologyPins(MixerData->Topology, MixerControl->NodeID, &LogicalNodesCount, LogicalNodes);