Ignore:
Timestamp:
Jan 15, 2000, 11:02:50 PM (26 years ago)
Author:
sandervl
Message:

JW: Updated to Wine level 20000109 + corrected compile errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/mciwave/mciwave.cpp

    r2308 r2456  
    3131    LPWAVEFORMATEX              lpWaveFormat;
    3232    BOOL                        fInput;         /* FALSE = Output, TRUE = Input */
    33     WORD                        dwStatus;       /* one from MCI_MODE_xxxx */
     33    volatile WORD               dwStatus;       /* one from MCI_MODE_xxxx */
    3434    DWORD                       dwMciTimeFormat;/* One of the supported MCI_FORMAT_xxxx */
    3535    DWORD                       dwFileOffset;   /* Offset of chunk in mmio file */
     
    3838    HANDLE                      hEvent;         /* for synchronization */
    3939    DWORD                       dwEventCount;   /* for synchronization */
    40 } WINE_MCIWAVE, *PWINE_MCIWAVE;
     40} WINE_MCIWAVE;
    4141
    4242/* ===================================================================
     
    128128static  DWORD   WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
    129129{
    130     WINE_MCIWAVE*       wmw = PWINE_MCIWAVE(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCIWAVE)));
     130    WINE_MCIWAVE*       wmw = (WINE_MCIWAVE*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCIWAVE));
    131131
    132132    if (!wmw)
     
    435435                dwRet = (wmw->fInput) ? waveInReset(wmw->hWave) : waveOutReset(wmw->hWave);
    436436        }
    437         while (((volatile WINE_MCIWAVE*)wmw)->dwStatus != MCI_MODE_STOP)
     437        while (wmw->dwStatus != MCI_MODE_STOP)
    438438            Sleep(10);
    439439        break;
     
    553553    }
    554554   
     555        if (wmw->dwStatus == MCI_MODE_PAUSE) {
     556            /* FIXME: parameters (start/end) in lpParams may not be used */
     557            return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms);
     558        }
     559   
     560    /** This function will be called again by a thread when async is used.
     561     * We have to set MCI_MODE_PLAY before we do this so that the app can spin
     562     * on MCI_STATUS, so we have to allow it here if we're not going to start this thread.
     563     */
     564    if ((wmw->dwStatus != MCI_MODE_STOP) && ((wmw->dwStatus != MCI_MODE_PLAY) && (dwFlags & MCI_WAIT))) {
     565        return MCIERR_INTERNAL;
     566    }
     567
     568    wmw->dwStatus = MCI_MODE_PLAY;
     569   
    555570    if (!(dwFlags & MCI_WAIT)) {
    556571        return MCI_SendCommandAsync(wmw->wNotifyDeviceID, MCI_PLAY, dwFlags,
    557572                                    (DWORD)lpParms, sizeof(MCI_PLAY_PARMS));
    558     }
    559 
    560     if (wmw->dwStatus != MCI_MODE_STOP) {
    561         if (wmw->dwStatus == MCI_MODE_PAUSE) {
    562             /* FIXME: parameters (start/end) in lpParams may not be used */
    563             return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms);
    564         }
    565         return MCIERR_INTERNAL;
    566573    }
    567574
     
    628635
    629636    TRACE("Playing (normalized) from byte=%lu for %lu bytes\n", wmw->dwPosition, left);
    630     wmw->dwStatus = MCI_MODE_PLAY;
    631637   
    632638    /* FIXME: this doesn't work if wmw->dwPosition != 0 */
     
    719725    }
    720726    bufsize = 64000;
    721     waveHdr.lpData = (CHAR*)HeapAlloc(GetProcessHeap(), 0, bufsize);
     727    waveHdr.lpData = (char*)HeapAlloc(GetProcessHeap(), 0, bufsize);
    722728    waveHdr.dwBufferLength = bufsize;
    723729    waveHdr.dwUser = 0L;
Note: See TracChangeset for help on using the changeset viewer.