- Timestamp:
- Nov 24, 2000, 1:14:07 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/winmm/dwaveout.cpp
r4172 r4687 1 /* $Id: dwaveout.cpp,v 1. 29 2000-09-03 09:35:14 sandervlExp $ */1 /* $Id: dwaveout.cpp,v 1.30 2000-11-24 12:14:07 phaller Exp $ */ 2 2 3 3 /* … … 8 8 * 9 9 * Project Odin Software License can be found in LICENSE.TXT 10 * 11 * Note: 12 * 2000/11/24 PH MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector! 10 13 * 11 14 */ … … 424 427 425 428 //write buffers to DART; starts playback 426 MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, 427 MixBuffer, 428 PREFILLBUF_DART); 429 { 430 // MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector! 431 USHORT selTIB = GetFS(); // save current FS selector 432 433 MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, 434 MixBuffer, 435 PREFILLBUF_DART); 436 SetFS(selTIB); // switch back to the saved FS selector 437 } 429 438 dprintf(("Dart playing\n")); 430 439 } … … 516 525 MMRESULT DartWaveOut::restart() 517 526 { 518 int i, curbuf; 519 520 dprintf(("DartWaveOut::restart")); 521 if(State == STATE_PLAYING) { 522 return(MMSYSERR_NOERROR); 527 int i, curbuf; 528 529 dprintf(("DartWaveOut::restart")); 530 if(State == STATE_PLAYING) 531 return(MMSYSERR_NOERROR); 532 533 //Only write buffers to dart if mixer has been initialized; if not, then 534 //the first buffer write will do this for us. 535 if(fMixerSetup == TRUE) 536 { 537 wmutex->enter(VMUTEX_WAIT_FOREVER); 538 State = STATE_PLAYING; 539 fUnderrun = FALSE; 540 wmutex->leave(); 541 curbuf = curPlayBuf; 542 543 // MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector! 544 USHORT selTIB = GetFS(); // save current FS selector 545 546 for(i=0;i<PREFILLBUF_DART;i++) 547 { 548 MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, &MixBuffer[curbuf], 1); 549 if(++curbuf == PREFILLBUF_DART) 550 curbuf = 0; 523 551 } 524 //Only write buffers to dart if mixer has been initialized; if not, then 525 //the first buffer write will do this for us. 526 if(fMixerSetup == TRUE) { 527 wmutex->enter(VMUTEX_WAIT_FOREVER); 528 State = STATE_PLAYING; 529 fUnderrun = FALSE; 530 wmutex->leave(); 531 curbuf = curPlayBuf; 532 533 for(i=0;i<PREFILLBUF_DART;i++) { 534 MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, &MixBuffer[curbuf], 1); 535 if(++curbuf == PREFILLBUF_DART) { 536 curbuf = 0; 537 } 538 } 539 } 540 return(MMSYSERR_NOERROR); 552 553 SetFS(selTIB); // switch back to the saved FS selector 554 } 555 return(MMSYSERR_NOERROR); 541 556 } 542 557 /******************************************************************************/ … … 747 762 748 763 wmutex->leave(); 764 749 765 //Transfer buffer to DART 766 // MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector! 767 USHORT selTIB = GetFS(); // save current FS selector 750 768 MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, &MixBuffer[curPlayBuf], 1); 769 SetFS(selTIB); // switch back to the saved FS selector 751 770 } 752 771 /******************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.