Cosmetic fixes.
This commit is contained in:
parent
d6bbbeb990
commit
b874293530
|
@ -1471,7 +1471,7 @@ static DWORD MIDI_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
|
|||
*======================================================================*/
|
||||
|
||||
/**************************************************************************
|
||||
* MCIMIDI_DriverProc32 [sample driver]
|
||||
* MCIMIDI_DriverProc [sample driver]
|
||||
*/
|
||||
LONG MCIMIDI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||
DWORD dwParam1, DWORD dwParam2)
|
||||
|
|
|
@ -228,10 +228,6 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA l
|
|||
wmw->waveDesc.lpFormat = (LPWAVEFORMAT)&wmw->WaveFormat;
|
||||
wmw->dwPosition = 0;
|
||||
|
||||
/* By default the device will be opened for output, the MCI_CUE function is there to
|
||||
* change from output to input and back
|
||||
*/
|
||||
dwRet = wodMessage(wDevID, WODM_OPEN, 0, (DWORD)&wmw->waveDesc, CALLBACK_NULL);
|
||||
wmw->dwStatus = MCI_MODE_STOP;
|
||||
} else {
|
||||
wmw->nUseCount--;
|
||||
|
@ -239,7 +235,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA l
|
|||
mmioClose(wmw->hFile, 0);
|
||||
wmw->hFile = 0;
|
||||
}
|
||||
return 0;
|
||||
return dwRet;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -329,13 +325,11 @@ static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
|
|||
TRACE(mciwave, "(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
|
||||
|
||||
if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID;
|
||||
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
||||
|
||||
if (wmw->dwStatus != MCI_MODE_STOP) {
|
||||
dwRet = WAVE_mciStop(wDevID, MCI_WAIT, lpParms);
|
||||
}
|
||||
|
||||
wmw->dwStatus = MCI_MODE_STOP;
|
||||
wmw->nUseCount--;
|
||||
|
||||
if (wmw->nUseCount == 0) {
|
||||
|
@ -350,7 +344,7 @@ static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
|
|||
if (mmRet != MMSYSERR_NOERROR) dwRet = MCIERR_INTERNAL;
|
||||
}
|
||||
|
||||
if (dwFlags & MCI_NOTIFY) {
|
||||
if ((dwFlags & MCI_NOTIFY) && lpParms) {
|
||||
TRACE(mciwave, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||
mciDriverNotify16((HWND16)LOWORD(lpParms->dwCallback),
|
||||
wmw->wNotifyDeviceID,
|
||||
|
@ -403,6 +397,15 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||
/* go back to begining of chunk */
|
||||
mmioSeek(wmw->hFile, wmw->dwFileOffset, SEEK_SET); /* >= 0 */
|
||||
|
||||
/* By default the device will be opened for output, the MCI_CUE function is there to
|
||||
* change from output to input and back
|
||||
*/
|
||||
dwRet = wodMessage(wDevID, WODM_OPEN, 0, (DWORD)&wmw->waveDesc, CALLBACK_NULL);
|
||||
if (dwRet != 0) {
|
||||
TRACE(mciwave, "Can't open low level audio device %ld\n", dwRet);
|
||||
return MCIERR_DEVICE_OPEN;
|
||||
}
|
||||
|
||||
/* at 22050 bytes per sec => 30 ms by block */
|
||||
bufsize = 10240;
|
||||
hData = GlobalAlloc16(GMEM_MOVEABLE, bufsize);
|
||||
|
@ -415,10 +418,11 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||
wmw->WaveHdr.dwUser = 0L;
|
||||
wmw->WaveHdr.dwFlags = 0L;
|
||||
wmw->WaveHdr.dwLoops = 0L;
|
||||
dwRet = wodMessage(wDevID, WODM_PREPARE, 0, (DWORD)&wmw->WaveHdr, sizeof(WAVEHDR));
|
||||
count = mmioRead(wmw->hFile, wmw->WaveHdr.lpData, bufsize);
|
||||
TRACE(mciwave, "mmioRead bufsize=%ld count=%ld\n", bufsize, count);
|
||||
if (count < 1) break;
|
||||
if (count < 1)
|
||||
break;
|
||||
dwRet = wodMessage(wDevID, WODM_PREPARE, 0, (DWORD)&wmw->WaveHdr, sizeof(WAVEHDR));
|
||||
wmw->WaveHdr.dwBufferLength = count;
|
||||
wmw->WaveHdr.dwBytesRecorded = 0;
|
||||
TRACE(mciwave, "before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n",
|
||||
|
@ -439,6 +443,10 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||
GlobalFree16(hData);
|
||||
wmw->WaveHdr.lpData = NULL;
|
||||
}
|
||||
|
||||
wodMessage(wDevID, WODM_STOP, 0, 0L, 0L);
|
||||
wodMessage(wDevID, WODM_CLOSE, 0, 0L, 0L);
|
||||
|
||||
wmw->dwStatus = MCI_MODE_STOP;
|
||||
if (lpParms && (dwFlags & MCI_NOTIFY)) {
|
||||
TRACE(mciwave, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
||||
|
@ -894,7 +902,7 @@ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* WAVE_DriverProc32 [sample driver]
|
||||
* MCIWAVE_DriverProc [sample driver]
|
||||
*/
|
||||
LONG MCIWAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
||||
DWORD dwParam1, DWORD dwParam2)
|
||||
|
|
|
@ -761,7 +761,7 @@ UINT WINAPI mmioAdvance(HMMIO hmmio,MMIOINFO*lpmmioinfo,UINT uFlags)
|
|||
mmioSendMessage(hmmio, MMIOM_READ,
|
||||
(LPARAM) lpmmioinfo->pchBuffer,
|
||||
(LPARAM) lpmmioinfo->cchBuffer);
|
||||
#if 0 /* mmioFlush32 already did the writing */
|
||||
#if 0 /* mmioFlush already did the writing */
|
||||
if (uFlags == MMIO_WRITE)
|
||||
mmioSendMessage(hmmio, MMIOM_WRITE,
|
||||
(LPARAM) lpmmioinfo->pchBuffer,
|
||||
|
@ -795,7 +795,7 @@ UINT16 WINAPI mmioAdvance16(HMMIO16 hmmio,MMIOINFO16*lpmmioinfo,UINT16 uFlags)
|
|||
mmioSendMessage(hmmio, MMIOM_READ,
|
||||
(LPARAM) lpmmioinfo->pchBuffer,
|
||||
(LPARAM) lpmmioinfo->cchBuffer);
|
||||
#if 0 /* mmioFlush32 already did the writing */
|
||||
#if 0 /* mmioFlush already did the writing */
|
||||
if (uFlags == MMIO_WRITE)
|
||||
mmioSendMessage(hmmio, MMIOM_WRITE,
|
||||
(LPARAM) lpmmioinfo->pchBuffer,
|
||||
|
@ -866,7 +866,7 @@ LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc,
|
|||
}
|
||||
|
||||
/**************************************************************************
|
||||
* mmioInstallIOProc32A [WINMM.120]
|
||||
* mmioInstallIOProcA [WINMM.120]
|
||||
*/
|
||||
LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc,
|
||||
LPMMIOPROC pIOProc, DWORD dwFlags)
|
||||
|
@ -1090,7 +1090,7 @@ UINT16 WINAPI mmioCreateChunk16(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags)
|
|||
lpck->dwFlags = MMIO_DIRTY;
|
||||
|
||||
ix = mmioWrite(hmmio, (LPSTR)lpck, lpck->dwDataOffset - dwOldPos);
|
||||
TRACE(mmio, "after _lwrite32 ix = %ld req = %ld, errno = %d\n",ix,lpck->dwDataOffset - dwOldPos,errno);
|
||||
TRACE(mmio, "after mmioWrite ix = %ld req = %ld, errno = %d\n",ix,lpck->dwDataOffset - dwOldPos,errno);
|
||||
if (ix < lpck->dwDataOffset - dwOldPos) {
|
||||
|
||||
mmioSeek(hmmio, dwOldPos, SEEK_SET);
|
||||
|
|
Loading…
Reference in New Issue