Changeset 178 for sbliveos2/trunk/drv16/wavestrm.cpp
- Timestamp:
- Apr 30, 2001, 11:08:00 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/drv16/wavestrm.cpp
r168 r178 25 25 #include <os2me.h> 26 26 #include <audio.h> // for #define MIDI 27 #include <include.h> 27 28 28 29 #include "wavestrm.hpp" … … 154 155 // if this is a write stream call _vFillAudioBuf 155 156 // 156 void WAVESTREAM::AddBuffers(void) 157 #pragma off (unreferenced) 158 void WAVESTREAM::AddBuffers(BOOL fFirst) 159 #pragma on (unreferenced) 157 160 { 158 161 ULONG space, byteswritten; … … 303 306 ReturnBuffer(); 304 307 } 305 AddBuffers( );308 AddBuffers(FALSE); 306 309 break; 307 310 } … … 316 319 } 317 320 318 ULONG WAVESTREAM::Write(PSTREAMBUF pbuf, ULONG uLength) 321 #pragma off (unreferenced) 322 ULONG WAVESTREAM::Write(PSTREAMBUF pbuf, ULONG uLength, BOOL fLooping) 323 #pragma on (unreferenced) 319 324 { 320 325 PSTREAMBUFFER pStreamBuf = new STREAMBUFFER(uLength, pbuf); … … 330 335 fUnderrun = FALSE; 331 336 OSS16_StreamReset(this); 332 AddBuffers( );337 AddBuffers(TRUE); 333 338 if(ulStreamType == STREAM_WAVE_PLAY) 334 339 OSS16_SetWaveOutVol(this, volume); … … 399 404 } 400 405 406 ULONG WAVESTREAM::GetCurrentWritePos(void) 407 { 408 ULONG writepos = 0; 409 410 cli(); 411 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhDone.Tail(); 412 413 if(!pTemp) { 414 pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 415 } 416 if(pTemp) { 417 writepos = pTemp->ulBuffpos; 418 } 419 sti(); 420 return writepos; 421 } 422 401 423 // 402 424 // SetCurrentTime … … 415 437 { 416 438 PSTREAMBUFFER pTemp = (PSTREAMBUFFER)qhInProcess.Head(); 417 ULONG fragsize;418 439 419 440 // configure the wave device … … 445 466 //Adding the first buffer also starts playback 446 467 if(ulStreamType == STREAM_WAVE_PLAY) { 447 AddBuffers( );468 AddBuffers(TRUE); 448 469 } 449 470 else { … … 464 485 465 486 } 487 466 488 ULONG WAVESTREAM::StopStream(PCONTROL_PARM pControl) 467 489 { … … 521 543 ulStreamState = STREAM_STREAMING; 522 544 //Adding the first buffer also starts playback 523 AddBuffers( );545 AddBuffers(TRUE); 524 546 525 547 return NO_ERROR; … … 527 549 } 528 550 529 void WAVESTREAM::SetInputSrc(int src) 530 { 531 inputsrc = src; 532 } 533 534 void WAVESTREAM::SetInputGain(ULONG gain) 535 { 536 inputgain = gain; 537 } 538 539 void WAVESTREAM::SetVolume(ULONG volume) 540 { 541 this->volume = volume; 542 if(ulStreamState == STREAM_STREAMING && ulStreamType == STREAM_WAVE_PLAY) { 543 OSS16_SetWaveOutVol(this, volume); 551 552 BOOL WAVESTREAM::SetProperty(int type, ULONG value, ULONG reserved) 553 { 554 switch(type) { 555 case PROPERTY_VOLUME: 556 volume = value; 557 if(ulStreamState == STREAM_STREAMING && ulStreamType == STREAM_WAVE_PLAY) { 558 OSS16_SetWaveOutVol(this, volume); 559 } 560 break; 561 562 case PROPERTY_INPUTSRC: 563 inputsrc = value; 564 break; 565 566 case PROPERTY_INPUTGAIN: 567 inputgain = value; 568 break; 569 570 default: 571 return STREAM::SetProperty(type, value, reserved); 572 573 } 574 return TRUE; 575 } 576 577 ULONG WAVESTREAM::GetProperty(int type) 578 { 579 switch(type) { 580 case PROPERTY_FREQUENCY: 581 return _configinfo.ulSampleRate; 582 583 case PROPERTY_INPUTSRC: 584 return inputsrc; 585 586 case PROPERTY_INPUTGAIN: 587 return inputgain; 588 589 default: 590 return STREAM::GetProperty(type); 544 591 } 545 592 }
Note:
See TracChangeset
for help on using the changeset viewer.