Ignore:
Timestamp:
Oct 19, 2011, 11:26:02 AM (14 years ago)
Author:
dmik
Message:

Replace "\" with "/" in include statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/winmm/playsound.cpp

    r8470 r21720  
    2424#include <misc.h>
    2525#include <string.h>
    26 #include <win\debugtools.h>
     26#include <win/debugtools.h>
    2727
    2828#define DBG_LOCALLOG    DBG_playsound
     
    5151}
    5252
    53 static HMMIO    get_mmioFromProfile(UINT uFlags, LPCSTR lpszName) 
     53static HMMIO    get_mmioFromProfile(UINT uFlags, LPCSTR lpszName)
    5454{
    5555    char        str[128];
    5656    LPSTR       ptr;
    5757    HMMIO       hmmio;
    58    
     58
    5959    TRACE("searching in SystemSound List !\n");
    6060    GetProfileStringA("Sounds", (LPSTR)lpszName, "", str, sizeof(str));
     
    7878};
    7979
    80 static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg, 
    81                                         DWORD dwInstance, 
     80static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg,
     81                                        DWORD dwInstance,
    8282                                        DWORD dwParam1, DWORD dwParam2)
    8383{
     
    9898}
    9999
    100 static void PlaySound_WaitDone(struct playsound_data* s) 
     100static void PlaySound_WaitDone(struct playsound_data* s)
    101101{
    102102    for (;;) {
     
    106106        }
    107107        InterlockedIncrement((LPLONG)&s->dwEventCount);
    108        
     108
    109109        WaitForSingleObject(s->hEvent, INFINITE);
    110110    }
     
    141141        hmmio = 0;
    142142        if (uFlags & SND_ALIAS)
    143             if ((hmmio = get_mmioFromProfile(uFlags, lpszSoundName)) == 0) 
     143            if ((hmmio = get_mmioFromProfile(uFlags, lpszSoundName)) == 0)
    144144                return FALSE;
    145        
     145
    146146        if (uFlags & SND_FILENAME)
    147147            if ((hmmio=get_mmioFromFile(lpszSoundName)) == 0) return FALSE;
    148        
     148
    149149        if (PlaySound_SearchMode == 1) {
    150150            PlaySound_SearchMode = 0;
    151             if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0) 
     151            if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)
    152152                hmmio = get_mmioFromProfile(uFlags, lpszSoundName);
    153153        }
    154        
     154
    155155        if (PlaySound_SearchMode == 2) {
    156156            PlaySound_SearchMode = 0;
    157             if ((hmmio = get_mmioFromProfile(uFlags | SND_NODEFAULT, lpszSoundName)) == 0) 
    158                 if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)     
     157            if ((hmmio = get_mmioFromProfile(uFlags | SND_NODEFAULT, lpszSoundName)) == 0)
     158                if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)
    159159                    hmmio = get_mmioFromProfile(uFlags, lpszSoundName);
    160160        }
     
    197197        goto errCleanUp;
    198198
    199     TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", 
     199    TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n",
    200200          (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize);
    201201
     
    216216    waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L;
    217217    waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize;
    218     if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) || 
     218    if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) ||
    219219        waveOutPrepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR))) {
    220220        goto errCleanUp;
     
    260260}
    261261
    262 static DWORD WINAPI PlaySound_Thread(LPVOID arg) 
     262static DWORD WINAPI PlaySound_Thread(LPVOID arg)
    263263{
    264264    DWORD     res;
    265    
     265
    266266    for (;;) {
    267267        PlaySound_Playing = FALSE;
     
    273273        if (res != WAIT_OBJECT_0) continue;
    274274        PlaySound_Playing = TRUE;
    275        
     275
    276276        if ((PlaySound_fdwSound & SND_RESOURCE) == SND_RESOURCE) {
    277277            HRSRC       hRES;
     
    292292                continue;
    293293            }
    294             PlaySound_Result = proc_PlaySound((LPCSTR)ptr, 
     294            PlaySound_Result = proc_PlaySound((LPCSTR)ptr,
    295295                                              ((UINT16)PlaySound_fdwSound ^ SND_RESOURCE) | SND_MEMORY);
    296296            FreeResource(hGLOB);
     
    319319{
    320320    static LPSTR StrDup = NULL;
    321    
     321
    322322    TRACE("pszSound='%p' hmod=%04X fdwSound=%08lX\n",
    323323          pszSound, hmod, fdwSound);
    324    
     324
    325325    if (PlaySound_hThread == 0) { /* This is the first time they called us */
    326326        DWORD   id;
     
    331331        if ((PlaySound_hPlayEvent = CreateEventA(NULL, FALSE, FALSE, NULL)) == 0)
    332332            return FALSE;
    333         if ((PlaySound_hThread = CreateThread(NULL, 0, PlaySound_Thread, 0, 0, &id)) == 0) 
    334             return FALSE;
    335     }
    336    
    337     /* FIXME? I see no difference between SND_WAIT and SND_NOSTOP ! */ 
    338     if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && PlaySound_Playing) 
     333        if ((PlaySound_hThread = CreateThread(NULL, 0, PlaySound_Thread, 0, 0, &id)) == 0)
     334            return FALSE;
     335    }
     336
     337    /* FIXME? I see no difference between SND_WAIT and SND_NOSTOP ! */
     338    if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && PlaySound_Playing)
    339339        return FALSE;
    340    
     340
    341341    /* Trying to stop if playing */
    342342    if (PlaySound_Playing) PlaySound_Stop = TRUE;
    343    
     343
    344344    /* Waiting playing thread to get ready. I think 10 secs is ok & if not then leave*/
    345345    if (WaitForSingleObject(PlaySound_hReadyEvent, 1000*10) != WAIT_OBJECT_0)
    346346        return FALSE;
    347    
    348     if (!pszSound || (fdwSound & SND_PURGE)) 
     347
     348    if (!pszSound || (fdwSound & SND_PURGE))
    349349        return FALSE; /* We stoped playing so leaving */
    350    
     350
    351351    if (PlaySound_SearchMode != 1) PlaySound_SearchMode = 2;
    352352    if (!(fdwSound & SND_ASYNC)) {
    353         if (fdwSound & SND_LOOP) 
     353        if (fdwSound & SND_LOOP)
    354354            return FALSE;
    355355        PlaySound_pszSound = pszSound;
     
    358358        PlaySound_Result = FALSE;
    359359        SetEvent(PlaySound_hPlayEvent);
    360         if (WaitForSingleObject(PlaySound_hMiddleEvent, INFINITE) != WAIT_OBJECT_0) 
    361             return FALSE;
    362         if (WaitForSingleObject(PlaySound_hReadyEvent, INFINITE) != WAIT_OBJECT_0) 
     360        if (WaitForSingleObject(PlaySound_hMiddleEvent, INFINITE) != WAIT_OBJECT_0)
     361            return FALSE;
     362        if (WaitForSingleObject(PlaySound_hReadyEvent, INFINITE) != WAIT_OBJECT_0)
    363363            return FALSE;
    364364        return PlaySound_Result;
     
    371371            StrDup = NULL;
    372372        }
    373         if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) && 
     373        if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) &&
    374374                                          !((DWORD)pszSound >> 16)) || !pszSound)) {
    375375            StrDup = HEAP_strdupA(GetProcessHeap(), 0,pszSound);
     
    403403    LPSTR       pszSoundA;
    404404    BOOL        bSound;
    405    
    406     if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) && 
     405
     406    if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) &&
    407407                                      !((DWORD)pszSound >> 16)) || !pszSound)) {
    408408        pszSoundA = HEAP_strdupWtoA(GetProcessHeap(), 0,pszSound);
    409409        bSound = PlaySoundA(pszSoundA, hmod, fdwSound);
    410410        HeapFree(GetProcessHeap(), 0, pszSoundA);
    411     } else 
     411    } else
    412412        bSound = PlaySoundA((LPCSTR)pszSound, hmod, fdwSound);
    413    
     413
    414414    return bSound;
    415415}
Note: See TracChangeset for help on using the changeset viewer.