Author: janderwald
Date: Fri Dec  3 11:47:43 2010
New Revision: 49919

URL: http://svn.reactos.org/svn/reactos?rev=49919&view=rev
Log:
[AUDIO-BRINGUP]
- Check if library has already been initialized
- Remove function macro for legacy (wdmaud.sys connection)

Modified:
    branches/audio-bringup/dll/win32/wdmaud.drv/   (props changed)
    branches/audio-bringup/dll/win32/wdmaud.drv/mmixer.c
    branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.c
    branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.rbuild

Propchange: branches/audio-bringup/dll/win32/wdmaud.drv/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec  3 11:47:43 2010
@@ -2,4 +2,4 @@
 
/branches/reactos-yarotows/dll/win32/wdmaud.drv:46372,46848,46966,47800,48026,48064
 /branches/ros-amd64-bringup/dll/win32/wdmaud.drv:36852
 
/branches/ros-amd64-bringup/reactos/dll/win32/wdmaud.drv:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882
-/trunk/reactos/dll/win32/wdmaud.drv:49194-49490
+/trunk/reactos/dll/win32/wdmaud.drv:49194-49917

Modified: branches/audio-bringup/dll/win32/wdmaud.drv/mmixer.c
URL: 
http://svn.reactos.org/svn/reactos/branches/audio-bringup/dll/win32/wdmaud.drv/mmixer.c?rev=49919&r1=49918&r2=49919&view=diff
==============================================================================
--- branches/audio-bringup/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] (original)
+++ branches/audio-bringup/dll/win32/wdmaud.drv/mmixer.c [iso-8859-1] Fri Dec  
3 11:47:43 2010
@@ -16,6 +16,10 @@
     PSOUND_OVERLAPPED Overlap;
     LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
 }IO_PACKET, *LPIO_PACKET;
+
+BOOL MMixerLibraryInitialized = FALSE;
+
+
 
 PVOID Alloc(ULONG NumBytes);
 MIXER_STATUS Close(HANDLE hDevice);
@@ -331,6 +335,13 @@
     HDEVINFO DeviceHandle;
     MIXER_STATUS Status;
 
+    if (MMixerLibraryInitialized)
+    {
+        /* library is already initialized */
+        return TRUE;
+    }
+
+
     /* create a device list */
     DeviceHandle = SetupDiGetClassDevs(&CategoryGuid,
                                        NULL,
@@ -356,6 +367,9 @@
         DPRINT1("Failed to initialize mixer library with %x\n", Status);
         return FALSE;
     }
+
+    /* library is now initialized */
+    MMixerLibraryInitialized = TRUE;
 
     /* completed successfully */
     return TRUE;

Modified: branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.c
URL: 
http://svn.reactos.org/svn/reactos/branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.c?rev=49919&r1=49918&r2=49919&view=diff
==============================================================================
--- branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original)
+++ branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Fri Dec  
3 11:47:43 2010
@@ -14,13 +14,6 @@
 
 #include "wdmaud.h"
 
-
-#ifndef USE_MMIXER_LIB
-#define FUNC_NAME(x) x##ByLegacy
-#else
-#define FUNC_NAME(x) x##ByMMixer
-#endif
-
 MMRESULT
 QueryWdmWaveDeviceFormatSupport(
     IN  PSOUND_DEVICE Device,
@@ -43,7 +36,7 @@
 
     VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) );
 
-    Result = FUNC_NAME(WdmAudGetNumWdmDevs)(DeviceType, &DeviceCount);
+    Result = WdmAudGetNumWdmDevsByMMixer(DeviceType, &DeviceCount);
 
     if ( ! MMSUCCESS(Result) )
     {
@@ -66,35 +59,35 @@
 
         /* Set up our function table */
         ZeroMemory(&FuncTable, sizeof(MMFUNCTION_TABLE));
-        FuncTable.GetCapabilities = FUNC_NAME(WdmAudGetCapabilities);
+        FuncTable.GetCapabilities = WdmAudGetCapabilitiesByMMixer;
         FuncTable.QueryWaveFormatSupport = QueryWdmWaveDeviceFormatSupport; 
//FIXME
-        FuncTable.Open = FUNC_NAME(WdmAudOpenSoundDevice);
-        FuncTable.Close = FUNC_NAME(WdmAudCloseSoundDevice);
-        FuncTable.GetDeviceInterfaceString = 
FUNC_NAME(WdmAudGetDeviceInterfaceString);
+        FuncTable.Open = WdmAudOpenSoundDeviceByMMixer;
+        FuncTable.Close = WdmAudCloseSoundDeviceByMMixer;
+        FuncTable.GetDeviceInterfaceString = 
WdmAudGetDeviceInterfaceStringByMMixer;
 
         if (DeviceType == MIXER_DEVICE_TYPE)
         {
-            FuncTable.SetWaveFormat = FUNC_NAME(WdmAudSetMixerDeviceFormat);
-            FuncTable.QueryMixerInfo = FUNC_NAME(WdmAudQueryMixerInfo);
+            FuncTable.SetWaveFormat = WdmAudSetMixerDeviceFormatByMMixer;
+            FuncTable.QueryMixerInfo = WdmAudQueryMixerInfoByMMixer;
         }
         else if (DeviceType == WAVE_IN_DEVICE_TYPE || DeviceType == 
WAVE_OUT_DEVICE_TYPE)
         {
-            FuncTable.SetWaveFormat = FUNC_NAME(WdmAudSetWaveDeviceFormat);
-            FuncTable.SetState = FUNC_NAME(WdmAudSetWaveState);
-            FuncTable.ResetStream = FUNC_NAME(WdmAudResetStream);
-            FuncTable.GetPos = FUNC_NAME(WdmAudGetWavePosition);
+            FuncTable.SetWaveFormat = WdmAudSetWaveDeviceFormatByMMixer;
+            FuncTable.SetState = WdmAudSetWaveStateByMMixer;
+            FuncTable.ResetStream = WdmAudResetStreamByMMixer;
+            FuncTable.GetPos = WdmAudGetWavePositionByMMixer;
 
 #ifndef USERMODE_MIXER
-            FuncTable.CommitWaveBuffer = FUNC_NAME(WdmAudCommitWaveBuffer);
+            FuncTable.CommitWaveBuffer = WdmAudCommitWaveBufferByMMixer;
 #else
             FuncTable.CommitWaveBuffer = WriteFileEx_Remixer;
 #endif
         }
         else if (DeviceType == MIDI_IN_DEVICE_TYPE || DeviceType == 
MIDI_OUT_DEVICE_TYPE)
         {
-            FuncTable.SetWaveFormat = FUNC_NAME(WdmAudSetMixerDeviceFormat);
-            FuncTable.SetState = FUNC_NAME(WdmAudSetWaveState);
-            FuncTable.GetPos = FUNC_NAME(WdmAudGetWavePosition);
+            FuncTable.SetWaveFormat = WdmAudSetWaveDeviceFormatByMMixer;
+            FuncTable.SetState = WdmAudSetWaveStateByMMixer;
+            FuncTable.GetPos = WdmAudGetWavePositionByMMixer;
         }
 
         SetSoundDeviceFunctionTable(SoundDevice, &FuncTable);
@@ -127,7 +120,7 @@
             if ( ! MMSUCCESS(Result) )
                 return 0L;
 
-            Result = FUNC_NAME(WdmAudOpenSoundDevice)(NULL, &Handle);
+            Result = WdmAudOpenSoundDeviceByMMixer(NULL, &Handle);
 
             if ( Result != MMSYSERR_NOERROR )
             {
@@ -155,7 +148,7 @@
         {
             SND_TRACE(L"DRV_FREE\n");
 
-            FUNC_NAME(WdmAudCleanup)();
+            WdmAudCleanupByMMixer();
 
             /* TODO: Clean up the path names! */
             UnlistAllSoundDevices();

Modified: branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.rbuild
URL: 
http://svn.reactos.org/svn/reactos/branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.rbuild?rev=49919&r1=49918&r2=49919&view=diff
==============================================================================
--- branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] 
(original)
+++ branches/audio-bringup/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] Fri 
Dec  3 11:47:43 2010
@@ -4,7 +4,6 @@
        <include base="ReactOS">include/reactos/libs/sound</include>
        <include base="mmixer">.</include>
        <include base="libsamplerate">.</include>
-       <define name="NDEBUG">1</define>
        <define name="USE_MMIXER_LIB">1</define>
        <!-- <define name="USERMODE_MIXER">1</define> Enable this line to for 
usermode mixing support -->
        <library>mmebuddy</library>


Reply via email to