Changeset 9902
- Timestamp:
- Mar 5, 2003, 3:49:04 PM (22 years ago)
- Location:
- trunk/src/winmm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/winmm/os2timer.cpp ¶
r6933 r9902 1 /* $Id: os2timer.cpp,v 1. 19 2001-10-03 13:47:58sandervl Exp $ */1 /* $Id: os2timer.cpp,v 1.20 2003-03-05 14:49:03 sandervl Exp $ */ 2 2 3 3 /* … … 24 24 #include <win32api.h> 25 25 #include <wprocess.h> 26 #include <misc.h> 26 #include <dbglog.h> 27 #include <vmutex.h> 27 28 28 29 #include "time.h" … … 36 37 * Structures * 37 38 ****************************************************************************/ 38 39 static VMutex timeMutex; 39 40 40 41 /**************************************************************************** … … 70 71 dwPeriod)); 71 72 73 timeMutex.enter(); 72 74 // add to linked list 73 75 OS2TimerResolution *timeRes = OS2TimerResolution::sTimerResolutions; … … 83 85 else 84 86 OS2TimerResolution::sTimerResolutions = this; 87 88 timeMutex.leave(); 85 89 86 90 this->dwPeriod = dwPeriod; … … 106 110 107 111 112 timeMutex.enter(); 113 108 114 // remove from linked list 109 115 OS2TimerResolution *timeRes = OS2TimerResolution::sTimerResolutions; … … 121 127 else 122 128 OS2TimerResolution::sTimerResolutions = timeRes->next; 129 130 timeMutex.leave(); 123 131 } 124 132 … … 166 174 dwPeriod)); 167 175 176 timeMutex.enter(); 168 177 OS2TimerResolution* timeRes = OS2TimerResolution::sTimerResolutions; 169 178 … … 178 187 { 179 188 delete timeRes; // so delete that object 189 timeMutex.leave(); 180 190 return TRUE; // OK, can remove the entry 181 191 } 182 192 } 193 timeMutex.leave(); 194 183 195 return FALSE; // nope, mismatch ! 184 196 } … … 199 211 int OS2TimerResolution::queryCurrentResolution() 200 212 { 213 timeMutex.enter(); 201 214 OS2TimerResolution *timeRes = OS2TimerResolution::sTimerResolutions; 202 215 int iMin = -1; … … 210 223 iMin = timeRes->dwPeriod; 211 224 } 225 timeMutex.leave(); 212 226 213 227 dprintf(("WINMM:OS2Timer: OS2TimerResolution::queryCurrentResolution == %08xh\n", … … 230 244 this)); 231 245 246 timeMutex.enter(); 232 247 OS2Timer *timer = OS2Timer::timers; 233 248 … … 242 257 else 243 258 timers = this; 259 timeMutex.leave(); 244 260 245 261 // create timer semaphore … … 274 290 this)); 275 291 292 KillTimer(); 293 294 timeMutex.enter(); 276 295 OS2Timer *timer = OS2Timer::timers; 277 296 278 KillTimer();279 280 297 if(timer != this) 281 298 { … … 288 305 else 289 306 timers = timer->next; 307 308 timeMutex.leave(); 290 309 } 291 310 /******************************************************************************/ -
TabularUnified trunk/src/winmm/waveindart.cpp ¶
r8572 r9902 1 /* $Id: waveindart.cpp,v 1. 5 2002-06-05 11:05:56sandervl Exp $ */1 /* $Id: waveindart.cpp,v 1.6 2003-03-05 14:49:04 sandervl Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 2001 Sander van Leeuwen (sandervl@xs4all.nl) 7 7 * 8 * TODO: mulaw, alaw & adpcm 8 9 * 9 10 * Project Odin Software License can be found in LICENSE.TXT … … 46 47 LONG APIENTRY WaveInHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags); 47 48 48 //TODO: mulaw, alaw & adpcm 49 static BOOL fwaveInFixedBuffers = FALSE; 50 51 //****************************************************************************** 52 // ODIN_waveInSetFixedBuffers 53 // 54 // Tell WINMM to use DART buffers of the same size as the first buffer delivered 55 // by waveInAddBuffer 56 // 57 //****************************************************************************** 58 void WIN32API ODIN_waveInSetFixedBuffers() 59 { 60 fwaveInFixedBuffers = TRUE; 61 } 49 62 /******************************************************************************/ 50 63 /******************************************************************************/ … … 208 221 LPWAVEHDR pwh = wavehdr; 209 222 if(pwh) { 210 dprintf(("mix setup %d, %d\n", pwh->dwBufferLength, pwh->dwBufferLength)); 211 212 ulBufSize = pwh->dwBufferLength/2; 223 if(fwaveInFixedBuffers) { 224 ulBufSize = pwh->dwBufferLength; 225 } 226 else 227 { 228 dprintf(("mix setup %d, %d\n", pwh->dwBufferLength, pwh->dwBufferLength)); 229 230 ulBufSize = pwh->dwBufferLength/2; 231 } 213 232 if(ulBufSize > minbufsize) { 214 233 dprintf(("set buffer size to %d bytes (org size = %d)", minbufsize, pwh->dwBufferLength)); … … 388 407 ULONG rc, nrbytes; 389 408 409 if(State == STATE_STOPPED) { 410 dprintf(("Not recording; return 0 position")); 411 return 0; 412 } 413 390 414 mciStatus.ulItem = MCI_STATUS_POSITION; 391 415 rc = mymciSendCommand(DeviceId, MCI_STATUS, MCI_STATUS_ITEM|MCI_WAIT, (PVOID)&mciStatus, 0); -
TabularUnified trunk/src/winmm/waveinoutbase.cpp ¶
r9671 r9902 1 /* $Id: waveinoutbase.cpp,v 1. 5 2003-01-14 19:38:38sandervl Exp $ */1 /* $Id: waveinoutbase.cpp,v 1.6 2003-03-05 14:49:04 sandervl Exp $ */ 2 2 3 3 /* … … 140 140 break; 141 141 142 case CALLBACK_NULL: 143 break; //no callback 144 142 145 default: 143 146 dprintf(("WARNING: Unknown callback type %x %x", fdwOpen, dwCallback)); -
TabularUnified trunk/src/winmm/waveoutdart.cpp ¶
r9012 r9902 1 /* $Id: waveoutdart.cpp,v 1.1 5 2002-08-16 10:09:49sandervl Exp $ */1 /* $Id: waveoutdart.cpp,v 1.16 2003-03-05 14:49:04 sandervl Exp $ */ 2 2 3 3 /* … … 53 53 static BOOL fFixedWaveBufferSize = FALSE; 54 54 55 /******************************************************************************/ 56 //Call to tell winmm to expect simple fixed size buffers, so 57 //it doesn't have to use very small DART buffers; this will 58 //only work in very specific cases; it is not a good general 59 //purpose solution) 60 /******************************************************************************/ 61 void WIN32API SetFixedWaveBufferSize() 55 //****************************************************************************** 56 // ODIN_waveOutSetFixedBuffers 57 // 58 // Tell WINMM to use DART buffers of the same size as the first buffer delivered 59 // by waveOutWrite 60 // 61 // NOTE: This will only work in very specific cases; it is not a good general 62 // purpose solution. 63 // 64 //****************************************************************************** 65 void WIN32API ODIN_waveOutSetFixedBuffers(); 62 66 { 63 67 fFixedWaveBufferSize = TRUE; … … 224 228 else ulBufSize = 1024; 225 229 #endif 226 227 230 MixSetupParms->ulBufferSize = ulBufSize; 228 231 … … 467 470 ULONG rc, nrbytes; 468 471 472 if(State == STATE_STOPPED) { 473 dprintf(("Not playing; return 0 position")); 474 return 0; 475 } 476 469 477 mciStatus.ulItem = MCI_STATUS_POSITION; 470 478 rc = mymciSendCommand(DeviceId, MCI_STATUS, MCI_STATUS_ITEM|MCI_WAIT, (PVOID)&mciStatus, 0);
Note:
See TracChangeset
for help on using the changeset viewer.