Changeset 19126


Ignore:
Timestamp:
Jun 5, 2002, 1:44:11 PM (23 years ago)
Author:
sandervl
Message:

Fixed DART waveout resume

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/winmm/waveoutdart.cpp

    r19122 r19126  
    1 /* $Id: waveoutdart.cpp,v 1.9 2002-06-05 09:19:30 sandervl Exp $ */
     1/* $Id: waveoutdart.cpp,v 1.10 2002-06-05 11:44:11 sandervl Exp $ */
    22
    33/*
     
    337337{
    338338    MCI_GENERIC_PARMS Params;
     339    int i, curbuf;
    339340
    340341    dprintf(("DartWaveOut::resume"));
     
    345346        return(MMSYSERR_NOERROR);
    346347    }
    347 
    348     State = STATE_PLAYING;
    349348    wmutex.leave();
    350349
    351     memset(&Params, 0, sizeof(Params));
    352 
    353     // Resume the playback.
    354     mymciSendCommand(DeviceId, MCI_RESUME, MCI_WAIT, (PVOID)&Params, 0);
     350    //Only write buffers to dart if mixer has been initialized; if not, then
     351    //the first buffer write will do this for us.
     352    if(fMixerSetup == TRUE)
     353    {
     354        wmutex.enter();
     355        State     = STATE_PLAYING;
     356        fUnderrun = FALSE;
     357        wmutex.leave();
     358        curbuf = curPlayBuf;
     359
     360        // MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector!
     361        USHORT selTIB = GetFS(); // save current FS selector
     362
     363        for(i=0;i<PREFILLBUF_DART;i++)
     364        {
     365            dprintf(("restart: write buffer at %x size %d", MixBuffer[curbuf].pBuffer, MixBuffer[curbuf].ulBufferLength));
     366            MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, &MixBuffer[curbuf], 1);
     367            if(++curbuf == PREFILLBUF_DART)
     368                curbuf = 0;
     369        }
     370        SetFS(selTIB);           // switch back to the saved FS selector
     371    }
    355372
    356373    return(MMSYSERR_NOERROR);
     
    360377MMRESULT DartWaveOut::stop()
    361378{
    362  MCI_GENERIC_PARMS Params;
     379    MCI_GENERIC_PARMS Params;
    363380
    364381    dprintf(("DartWaveOut::stop %s", (State == STATE_PLAYING) ? "playing" : "stopped"));
     
    383400MMRESULT DartWaveOut::reset()
    384401{
    385  MCI_GENERIC_PARMS Params;
    386  LPWAVEHDR tmpwavehdr;
     402     MCI_GENERIC_PARMS Params;
     403    LPWAVEHDR tmpwavehdr;
    387404
    388405    dprintf(("DartWaveOut::reset %s", (State == STATE_PLAYING) ? "playing" : "stopped"));
Note: See TracChangeset for help on using the changeset viewer.