| 400 | // ----------------------------------------------------------------------- |
| 401 | |
| 402 | void SamplePlayerTest::updateUI() |
| 403 | { |
| 404 | float gain = mGain->getValue(); |
| 405 | if( im::SliderFloat( "gain", &gain, 0, 1 ) ) { |
| 406 | mGain->setValue( gain ); |
| 407 | } |
| 408 | float pan = mPan->getPos(); |
| 409 | if( im::SliderFloat( "pan", &pan, 0, 1 ) ) { |
| 410 | mPan->setPos( pan ); |
| 411 | } |
| 412 | |
| 413 | im::Checkbox( "load async", &mLoadAsync ); |
| 414 | |
| 415 | im::Separator(); |
| 416 | im::Text( "SamplePlayer" ); |
| 417 | if( mSamplePlayerNode ) { |
| 418 | bool playerEnabled = mSamplePlayerNode->isEnabled(); |
| 419 | if( im::Checkbox( "enabled", &playerEnabled ) ) { |
| 420 | mSamplePlayerNode->setEnabled( playerEnabled ); |
| 421 | } |
| 422 | im::SameLine(); |
| 423 | bool loopEnabled = mSamplePlayerNode->isLoopEnabled(); |
| 424 | if( im::Checkbox( "loop", &loopEnabled ) ) { |
| 425 | mSamplePlayerNode->setLoopEnabled( loopEnabled ); |
| 426 | } |
| 427 | float readPos = (float)mSamplePlayerNode->getReadPositionTime(); |
| 428 | if( im::SliderFloat( "read pos (s)", &readPos, 0, mSamplePlayerNode->getNumSeconds() ) ) { |
| 429 | mSamplePlayerNode->seekToTime( readPos ); |
| 430 | } |
| 431 | float loopBegin = (float)mSamplePlayerNode->getLoopBeginTime(); |
| 432 | float loopEnd = (float)mSamplePlayerNode->getLoopEndTime(); |
| 433 | if( im::SliderFloat( "loop begin (s)", &loopBegin, 0, mSamplePlayerNode->getNumSeconds() ) ) { |
| 434 | loopBegin - min<float>( loopBegin, loopEnd ); |
| 435 | mSamplePlayerNode->setLoopBeginTime( loopBegin ); |
| 436 | } |
| 437 | if( im::SliderFloat( "loop end (s)", &loopEnd, 0, mSamplePlayerNode->getNumSeconds() ) ) { |
| 438 | loopEnd = max<float>( loopBegin, loopEnd ); |
| 439 | mSamplePlayerNode->setLoopEndTime( loopEnd ); |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | im::Separator(); |
| 444 | im::DragFloat( "start / stop delay (s)", &mTriggerDelaySeconds, 0.02f, 0.0f, 5.0f ); |
| 445 | |
| 446 | if( mSubTests[mCurrentSubTest] == "recorder" ) { |
| 447 | im::Separator(); |
| 448 | im::Text( "Recording" ); |
| 449 | im::Checkbox( "record", &mRecording ); |
| 450 | im::SameLine(); |
| 451 | im::Checkbox( "auto-resize", &mRecordAutoResize ); |
| 452 | |
| 453 | if( im::Button( "write to file" ) ) { |
| 454 | writeRecordedToFile(); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | if( im::ListBox( "sub-tests", &mCurrentSubTest, mSubTests, mSubTests.size() ) ) { |
| 459 | setupSubTest( mSubTests[mCurrentSubTest] ); |
nothing calls this directly
no test coverage detected