Changeset 21878 for branches/gcc-kmk/src


Ignore:
Timestamp:
Dec 13, 2011, 11:17:52 AM (14 years ago)
Author:
dmik
Message:

Port DSOUND to GCC/kBuild.

Location:
branches/gcc-kmk/src
Files:
1 added
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/Makefile.kmk

    r21877 r21878  
    4040include $(PATH_SUB_CURRENT)/dplay/Makefile.kmk
    4141include $(PATH_SUB_CURRENT)/dplayx/Makefile.kmk
     42include $(PATH_SUB_CURRENT)/dsound/Makefile.kmk
    4243include $(PATH_SUB_CURRENT)/crypt32/Makefile.kmk
    4344include $(PATH_SUB_CURRENT)/ctl3d32/Makefile.kmk
  • branches/gcc-kmk/src/dsound/DAudioNotify.h

    r5608 r21878  
    4646};
    4747
     48HRESULT __stdcall DAudioNotifyQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
     49ULONG   __stdcall DAudioNotifyAddRef(THIS);
     50ULONG   __stdcall DAudioNotifyRelease(THIS);
     51HRESULT __stdcall DAudioNotifySetNotificationPositions(THIS, DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies);
     52
    4853#endif //__DAUDIONOTIFY_H__
  • branches/gcc-kmk/src/dsound/OS23DBuffer.h

    r3099 r21878  
    5858};
    5959
     60HRESULT __stdcall Sound3DBufferQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
     61ULONG   __stdcall Sound3DBufferAddRef(THIS);
     62ULONG   __stdcall Sound3DBufferRelease(THIS);
     63HRESULT __stdcall Sound3DBufferGetAllParameters(THIS, LPDS3DBUFFER lpDs3dBuffer);
     64HRESULT __stdcall Sound3DBufferSetAllParameters(THIS, LPCDS3DBUFFER lpcDs3dBuffer, DWORD dwApply);
     65HRESULT __stdcall Sound3DBufferGetMaxDistance(THIS, LPD3DVALUE lpflMaxDistance);
     66HRESULT __stdcall Sound3DBufferGetMinDistance(THIS, LPD3DVALUE lpflMinDistance);
     67HRESULT __stdcall Sound3DBufferSetMaxDistance(THIS, D3DVALUE flMaxDistance, DWORD dwApply);
     68HRESULT __stdcall Sound3DBufferSetMinDistance(THIS, D3DVALUE flMinDistance, DWORD dwApply);
     69HRESULT __stdcall Sound3DBufferGetMode(THIS, LPDWORD lpdwMode);
     70HRESULT __stdcall Sound3DBufferSetMode(THIS, DWORD dwMode, DWORD dwApply);
     71HRESULT __stdcall Sound3DBufferGetPosition(THIS, LPD3DVECTOR lpvPosition);
     72HRESULT __stdcall Sound3DBufferSetPosition(THIS, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
     73HRESULT __stdcall Sound3DBufferGetConeAngles(THIS, LPDWORD lpdwInsideConeAngle, LPDWORD lpdwOutsideConeAngle);
     74HRESULT __stdcall Sound3DBufferSetConeAngles(THIS, DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply);
     75HRESULT __stdcall Sound3DBufferGetConeOrientation(THIS, LPD3DVECTOR lpvOrientation);
     76HRESULT __stdcall Sound3DBufferSetConeOrientation(THIS, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
     77HRESULT __stdcall Sound3DBufferGetConeOutsideVolume(THIS, LPLONG lplConeOutsideVolume);
     78HRESULT __stdcall Sound3DBufferSetConeOutsideVolume(THIS, LONG lConeOutsideVolume, DWORD dwApply);
     79HRESULT __stdcall Sound3DBufferGetVelocity(THIS, LPD3DVECTOR lpvVelocity);
     80HRESULT __stdcall Sound3DBufferSetVelocity(THIS, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
     81
    6082#endif
  • branches/gcc-kmk/src/dsound/OS23DListener.h

    r3099 r21878  
    5555};
    5656
     57HRESULT __stdcall Sound3DListenerQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
     58ULONG   __stdcall Sound3DListenerAddRef(THIS);
     59ULONG   __stdcall Sound3DListenerRelease(THIS);
     60HRESULT __stdcall Sound3DListenerGetAllParameters(THIS, LPDS3DLISTENER lpListener);
     61HRESULT __stdcall Sound3DListenerSetAllParameters(THIS, LPCDS3DLISTENER lpcListener, DWORD dwApply);
     62HRESULT __stdcall Sound3DListenerCommitDeferredSettings(THIS);
     63HRESULT __stdcall Sound3DListenerGetDistanceFactor(THIS, LPD3DVALUE lpflDistanceFactor);
     64HRESULT __stdcall Sound3DListenerSetDistanceFactor(THIS, D3DVALUE flDistanceFactor, DWORD dwApply);
     65HRESULT __stdcall Sound3DListenerGetDopplerFactor(THIS, LPD3DVALUE lpflDopplerFactor);
     66HRESULT __stdcall Sound3DListenerSetDopplerFactor(THIS, D3DVALUE flDopplerFactor, DWORD dwApply);
     67HRESULT __stdcall Sound3DListenerGetOrientation(THIS, LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop);
     68HRESULT __stdcall Sound3DListenerSetOrientation(THIS, D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply);
     69HRESULT __stdcall Sound3DListenerGetPosition(THIS, LPD3DVECTOR lpvPosition);
     70HRESULT __stdcall Sound3DListenerSetPosition(THIS, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
     71HRESULT __stdcall Sound3DListenerGetRolloffFactor(THIS, LPD3DVALUE lpflRolloffFactor);
     72HRESULT __stdcall Sound3DListenerSetRolloffFactor(THIS, D3DVALUE flRolloffFactor, DWORD dwApply);
     73HRESULT __stdcall Sound3DListenerGetVelocity(THIS, LPD3DVECTOR lpvVelocity);
     74HRESULT __stdcall Sound3DListenerSetVelocity(THIS, D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply);
     75
    5776#endif
  • branches/gcc-kmk/src/dsound/OS2PrimBuff.h

    r5285 r21878  
    7474};
    7575
     76HRESULT __stdcall PrimBufQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
     77ULONG   __stdcall PrimBufAddRef(THIS);
     78ULONG   __stdcall PrimBufRelease(THIS);
    7679HRESULT __stdcall PrimBufGetCaps(THIS_ LPDSBCAPS );
    7780HRESULT __stdcall PrimBufGetCurrentPosition(THIS_ LPDWORD,LPDWORD ) ;
  • branches/gcc-kmk/src/dsound/dsound.def

    r21692 r21878  
    66EXPORTS
    77
    8    DirectSoundCreate     = _OS2DirectSoundCreate@12                @1
    9    DirectSoundEnumerateA = _OS2DirectSoundEnumerateA@8             @2
    10    DirectSoundEnumerateW = _OS2DirectSoundEnumerateW@8             @3
    11    DirectSoundCaptureCreate     = _OS2DirectSoundCreate@12         @6
    12    DirectSoundCaptureEnumerateA = _OS2DirectSoundEnumerateA@8      @7
    13    DirectSoundCaptureEnumerateW = _OS2DirectSoundEnumerateW@8      @8
     8   DirectSoundCreate     = "_OS2DirectSoundCreate@12"              @1
     9   DirectSoundEnumerateA = "_OS2DirectSoundEnumerateA@8"           @2
     10   DirectSoundEnumerateW = "_OS2DirectSoundEnumerateW@8"           @3
     11   DirectSoundCaptureCreate     = "_OS2DirectSoundCreate@12"       @6
     12   DirectSoundCaptureEnumerateA = "_OS2DirectSoundEnumerateA@8"    @7
     13   DirectSoundCaptureEnumerateW = "_OS2DirectSoundEnumerateW@8"    @8
    1414
    15    DllCanUnloadNow   = _DSOUNDDllCanUnloadNow@0                    @4
    16    DllGetClassObject = _DSOUNDDllGetClassObject@12                 @5
     15   DllCanUnloadNow   = "_DSOUNDDllCanUnloadNow@0"                  @4
     16   DllGetClassObject = "_DSOUNDDllGetClassObject@12"               @5
    1717
  • branches/gcc-kmk/src/dsound/initterm.cpp

    r21842 r21878  
    1 /* $Id: initdsound.cpp,v 1.1 2002-09-14 08:31:25 sandervl Exp $
     1/* $Id: initterm.cpp,v 1.18 2002-09-14 08:31:25 sandervl Exp $
    22 *
    3  * DLL entry point
     3 * DSOUND DLL entry point
    44 *
    55 * Copyright 1998 Sander van Leeuwen
    66 * Copyright 1998 Peter Fitzsimmons
    77 *
    8  *
    98 * Project Odin Software License can be found in LICENSE.TXT
    10  *
    119 */
    1210
    13 /*-------------------------------------------------------------*/
    14 /* INITERM.C -- Source for a custom dynamic link library       */
    15 /*              initialization and termination (_DLL_InitTerm) */
    16 /*              function.                                      */
    17 /*                                                             */
    18 /* When called to perform initialization, this sample function */
    19 /* gets storage for an array of integers, and initializes its  */
    20 /* elements with random integers.  At termination time, it     */
    21 /* frees the array.  Substitute your own special processing.   */
    22 /*-------------------------------------------------------------*/
    23 
    24 
    25 /* Include files */
    2611#define  INCL_DOSMODULEMGR
    2712#define  INCL_DOSPROCESS
     
    4328#include "initdsound.h"
    4429
    45 extern "C" {
    46  //Win32 resource table (produced by wrc)
    47  extern DWORD _Resource_PEResTab;
    48 }
     30// Win32 resource table (produced by wrc)
     31extern DWORD dsound_PEResTab;
    4932
    5033static HMODULE dllHandle = 0;
    5134static HMODULE MMPMLibraryHandle = 0;
     35
     36char dsoundPath[CCHMAXPATH] = "";
    5237
    5338BOOL fdsMMPMAvailable = TRUE;
     
    6247                                      WORD    wLength) = NULL;
    6348
    64 
    65 //******************************************************************************
    66 //******************************************************************************
    6749BOOL WINAPI LibMainDSound(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    6850{
    69   char   szError[CCHMAXPATH];
    70   HKEY   hKey;
     51    char   szError[CCHMAXPATH];
     52    HKEY   hKey;
    7153
    72    switch (fdwReason)
    73    {
    74    case DLL_PROCESS_ATTACH:
     54    switch (fdwReason)
     55    {
     56    case DLL_PROCESS_ATTACH:
    7557
    76         if(fdsMMPMAvailable == TRUE)
    77         {//if audio access wasn't disabled already, check if mmpm2 is installed
     58        if(fdsMMPMAvailable == TRUE)
     59        {
     60            // if audio access wasn't disabled already, check if mmpm2 is installed
    7861            // try to load the MDM library, not MMPM directly!!!
    7962            if (DosLoadModule(szError, sizeof(szError),
     
    8265                // this system has no MMPM :-(
    8366                fdsMMPMAvailable = FALSE;
    84             } 
     67            }
    8568            else
    8669            {
     
    8972                                     1, /* ORD_MCISENDCOMMAND */
    9073                                     NULL,
    91                                     (PFN*)&pfnDSmciSendCommand) != NO_ERROR)
     74                                     (PFN*)&pfnDSmciSendCommand) != NO_ERROR)
    9275                {
    9376                    fdsMMPMAvailable = FALSE;
    94                 } 
     77                }
    9578                else
    9679                {
     
    11396        }
    11497
    115         if(fdsMMPMAvailable && RegOpenKeyA(HKEY_LOCAL_MACHINE, CUSTOM_BUILD_OPTIONS_KEY, &hKey) == 0) 
     98        if(fdsMMPMAvailable && RegOpenKeyA(HKEY_LOCAL_MACHINE, CUSTOM_BUILD_OPTIONS_KEY, &hKey) == 0)
    11699        {
    117100            DWORD dwSize, dwType;
     
    135118        return TRUE;
    136119
    137    case DLL_THREAD_ATTACH:
    138    case DLL_THREAD_DETACH:
     120    case DLL_THREAD_ATTACH:
     121    case DLL_THREAD_DETACH:
    139122        return TRUE;
    140123
    141    case DLL_PROCESS_DETACH:
     124    case DLL_PROCESS_DETACH:
    142125        if(MMPMLibraryHandle) DosFreeModule(MMPMLibraryHandle);
    143126        return TRUE;
    144    }
    145    return FALSE;
     127    }
     128    return FALSE;
    146129}
    147 /****************************************************************************/
    148 /* _DLL_InitTerm is the function that gets called by the operating system   */
    149 /* loader when it loads and frees this DLL for each process that accesses   */
    150 /* this DLL.  However, it only gets called the first time the DLL is loaded */
    151 /* and the last time it is freed for a particular process.  The system      */
    152 /* linkage convention MUST be used because the operating system loader is   */
    153 /* calling this function.                                                   */
    154 /****************************************************************************/
    155 ULONG APIENTRY inittermDSound(ULONG hModule, ULONG ulFlag)
    156 {
    157 
    158    /*-------------------------------------------------------------------------*/
    159    /* If ulFlag is zero then the DLL is being loaded so initialization should */
    160    /* be performed.  If ulFlag is 1 then the DLL is being freed so            */
    161    /* termination should be performed.                                        */
    162    /*-------------------------------------------------------------------------*/
    163 
    164    switch (ulFlag) {
    165       case 0 :
    166       {
    167          dllHandle = RegisterLxDll(hModule, LibMainDSound, (PVOID)&_Resource_PEResTab);
    168          if(dllHandle == 0)
    169                 return 0UL;
    170 
    171          dprintf(("dsound init %s %s (%x)", __DATE__, __TIME__, inittermDSound));
    172          break;
    173       }
    174 
    175       case 1 :
    176          if(dllHandle) {
    177                 UnregisterLxDll(dllHandle);
    178          }
    179          break;
    180       default  :
    181          return 0UL;
    182    }
    183 
    184    /***********************************************************/
    185    /* A non-zero value must be returned to indicate success.  */
    186    /***********************************************************/
    187    return 1UL;
    188 }
    189 //******************************************************************************
    190 //******************************************************************************
    191130
    192131DWORD APIENTRY dsmciSendCommand(WORD   wDeviceID,
     
    205144    return ret;
    206145}
    207 //******************************************************************************
    208 //******************************************************************************
     146
    209147DWORD APIENTRY dsmciGetErrorString(DWORD   dwError,
    210148                                   LPSTR   lpstrBuffer,
     
    220158    return ret;
    221159}
    222 //******************************************************************************
    223 //******************************************************************************
     160
     161ULONG SYSTEM DLL_InitDSound(ULONG hModule)
     162{
     163    DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath);
     164    char *endofpath = strrchr(dsoundPath, '\\');
     165    if (endofpath)
     166        *(endofpath+1) = 0;
     167
     168    CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
     169
     170    dllHandle = RegisterLxDll(hModule, LibMainDSound, (PVOID)&dsound_PEResTab);
     171    if(dllHandle == 0)
     172        return -1;
     173
     174    dprintf(("dsound init %s %s (%x)", __DATE__, __TIME__, DLL_InitDSound));
     175
     176    return 0;
     177}
     178
     179void SYSTEM DLL_TermDSound(ULONG hModule)
     180{
     181    if (dllHandle)
     182       UnregisterLxDll(dllHandle);
     183}
     184
     185ULONG SYSTEM DLL_Init(ULONG hModule)
     186{
     187    if (DLL_InitDefault(hModule) == -1)
     188        return -1;
     189    return DLL_InitDSound(hModule);
     190}
     191
     192void SYSTEM DLL_Term(ULONG hModule)
     193{
     194    DLL_TermDSound(hModule);
     195    DLL_TermDefault(hModule);
     196}
  • branches/gcc-kmk/src/dsound/os2notify.h

    r21692 r21878  
    4646};
    4747
     48HRESULT __stdcall SoundNotifyQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
     49ULONG   __stdcall SoundNotifyAddRef(THIS);
     50ULONG   __stdcall SoundNotifyRelease(THIS);
     51HRESULT __stdcall SoundNotifySetNotificationPositions(THIS, DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies);
     52
    4853#endif
  • branches/gcc-kmk/src/dsound/os2sndbuffer.h

    r21692 r21878  
    4343    ~OS2IDirectSoundBuffer();
    4444
    45     static void OS2IDirectSoundBuffer::DestroyAllBuffers(); // called when DSound is closed
     45    static void DestroyAllBuffers(); // called when DSound is closed
    4646
    4747    int     Referenced;
Note: See TracChangeset for help on using the changeset viewer.