Changeset 266 for OCO/trunk/drv16/waveplay.cpp
- Timestamp:
- Nov 4, 2007, 8:19:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/drv16/waveplay.cpp
r253 r266 140 140 StreamId = 0UL; 141 141 open_strategy = 0UL; 142 #ifdef DEBUG 143 dprintf(("OSS16_WAVECLOSE: Success\n")); 144 #endif /* DEBUG */ 142 145 return TRUE; 143 146 } else 147 #ifdef DEBUG 148 dprintf(("OSS16_WAVECLOSE: Error\n")); 149 #endif /* DEBUG */ 144 150 return FALSE; 145 151 } … … 188 194 #ifdef DEBUG 189 195 dprintf(("WAVEPLAY::ConfigDev1 SampleRate %d", pConfigInfo->ulHwSampleRate)); 196 dprintf(("WAVEPLAY::ConfigDev1 ulFirstBufSize %d", ulFirstBufSize)); 197 dprintf(("WAVEPLAY::ConfigDev1 ulFragsize %d", pConfigInfo->ulFragsize)); 190 198 #endif 191 199 … … 195 203 DebugInt3(); 196 204 ulFirstBufSize = 8192; //should never happen! 205 #ifdef DEBUG 206 dprintf(("Arg - shouldn't happen")); 207 #endif /* DEBUG */ 197 208 } 198 209 } … … 200 211 //convert size of first buffer 201 212 ulFirstBufSize = ConvertLength(ulFirstBufSize, pConfigInfo); 213 #ifdef DEBUG 214 dprintf(("WAVEPLAY::ConfigDev2 ulFirstBufSize %d", ulFirstBufSize)); 215 #endif /* DEBUG */ 202 216 } 203 217 204 218 //Must call this method (i.e. resets sample rate conversion position) 205 219 WAVEAUDIO::ConfigDev(StreamId, pConfigInfo, ulFirstBufSize); 220 #ifdef DEBUG 221 dprintf(("WAVEPLAY::ConfigDev3 ulFirstBufSize %d", ulFirstBufSize)); 222 #endif /* DEBUG */ 206 223 207 224 //get real sample format used to program the audio hardware (taking conversion into account) 208 225 QuerySampleFormat(OPERATION_PLAY, pConfigInfo); 226 #ifdef DEBUG 227 dprintf(("WAVEPLAY::ConfigDev4 ulFirstBufSize %d", ulFirstBufSize)); 228 #endif /* DEBUG */ 209 229 210 230 //convert consume rate 211 231 ulPCMConsumeRate = ConvertLength(pConfigInfo->ulPCMConsumeRate, pConfigInfo); 212 213 dprintf(("WAVEPLAY::ConfigDev: cons rate %d, buf size %d init rate %d", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate)); 232 #ifdef DEBUG 233 dprintf(("WAVEPLAY::ConfigDev5 ulFirstBufSize %d", ulFirstBufSize)); 234 dprintf(("WAVEPLAY::ConfigDev5 ulPCMConsumeRate %d", ulPCMConsumeRate)); 235 236 dprintf(("WAVEPLAY::ConfigDev: cons rate %d buf size %d init rate %d", ulPCMConsumeRate, ulFirstBufSize, pConfigInfo->ulHwSampleRate)); 237 dprintf(("WAVEPLAY::ConfigDev6 ulFirstBufSize %d", ulFirstBufSize)); 238 #endif /* DEBUG */ 214 239 215 240 fragsize = ulPCMConsumeRate/64; //start with 64 irqs/sec … … 240 265 #ifdef DEBUG 241 266 dprintf(("WAVEPLAY::ConfigDev: SampleRate %d", pConfigInfo->ulHwSampleRate)); 267 dprintf(("WAVEPLAY::ConfigDev2 fragsize %d", fragsize)); 242 268 #endif 243 269 hwparam.ulSampleRate = pConfigInfo->ulHwSampleRate; … … 245 271 hwparam.ulNumChannels = pConfigInfo->ulHwNumChannels; 246 272 hwparam.ulDataType = QueryOSSDataFormat(OPERATION_PLAY, pConfigInfo->ulDataType, pConfigInfo->ulHwBitsPerSample); 247 if((rc = (int)OSS16_WaveSetFormat(StreamId, &hwparam)) != OSSERR_SUCCESS) {248 #ifdef DEBUG 249 dprintf(("WAVEPLAY:ConfigDev:OSS16_WaveSetFormat error. rc = %d",rc));273 rc = (int)OSS16_WaveSetFormat(StreamId, &hwparam); 274 #ifdef DEBUG 275 dprintf(("WAVEPLAY:ConfigDev:OSS16_WaveSetFormat . rc = %d",rc)); 250 276 dprintf(("WAVEPLAY:ConfigDev:samp rate %d",hwparam.ulSampleRate)); 251 277 dprintf(("WAVEPLAY:ConfigDev:bits per sample %d",hwparam.ulBitsPerSample)); … … 254 280 255 281 #endif 282 if( rc != OSSERR_SUCCESS) { 256 283 // DevHelp_Beep(500, 100); 257 284 DebugInt3(); … … 290 317 if(pConfigInfo->usConversion == CONVERT_NONE) 291 318 { 319 #ifdef DEBUG 320 dprintf(("Transfer. NoConv ulB %d",ulBytesToTransfer)); 321 #endif /* DEBUG */ 292 322 if(AddBuffer(StreamId, pConfigInfo, pUserBuffer, ulBytesToTransfer, pulBytesTransferred) == FALSE) 293 323 { … … 365 395 pConfigInfo->ulSRatePosition -= pConfigInfo->ulSRateIncrement; 366 396 } 367 dprintf2(("WAVEPLAY::AddBuffer %lx %lx %lx -> nothing left", ulBytesToTransfer, pConfigInfo->ulSRatePosition, pConfigInfo->ulSRateIncrement)); 397 #ifdef DEBUG 398 dprintf(("WAVEPLAY::AddBuffer %lx %lx %lx -> nothing left", ulBytesToTransfer, pConfigInfo->ulSRatePosition, pConfigInfo->ulSRateIncrement)); 399 #endif /* DEBUG */ 368 400 return TRUE; 369 401 } … … 377 409 dprintf2(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed due to full buffer", ulCvtBufferSize, (USHORT)rc)); 378 410 } 379 // else dprintf(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed", ulCvtBufferSize, (USHORT)rc)); 411 #ifdef DEBUG 412 else dprintf(("WAVEPLAY::AddBuffer; OSS16_WaveAddBuffer %lx %x failed", ulCvtBufferSize, (USHORT)rc)); 413 #endif /* DEBUG */ 380 414 *pulBytesTransferred = 0; 381 415 return FALSE; … … 423 457 if(OSS16_WaveGetPos(StreamId, &ulCurBytesProcessed) != OSSERR_SUCCESS) { 424 458 *pulStreamPosition = 0; 459 #ifdef DEBUG 460 dprintf(("OSS16_WAVEPLAY::GetPosition: Failed")); 461 #endif /* DEBUG */ 425 462 return FALSE; 426 463 } … … 442 479 if(OSS16_WaveGetSpace(StreamId, &space) != OSSERR_SUCCESS) { 443 480 *pulStreamSpace = 0; 481 #ifdef DEBUG 482 dprintf(("OSS16_WAVEPLAY::GetSpace: Failed")); 483 #endif /* DEBUG */ 444 484 return FALSE; 445 485 }
Note:
See TracChangeset
for help on using the changeset viewer.