| 26 | } |
| 27 | |
| 28 | void VoiceBasicApp::mouseDown( MouseEvent event ) |
| 29 | { |
| 30 | // scale volume and pan from window coordinates to 0:1 |
| 31 | float volume = 1.0f - (float)event.getPos().y / (float)getWindowHeight(); |
| 32 | float pan = (float)event.getPos().x / (float)getWindowWidth(); |
| 33 | |
| 34 | mVoice->setVolume( volume ); |
| 35 | mVoice->setPan( pan ); |
| 36 | |
| 37 | // By stopping the Voice first if it is already playing, start will play from the beginning |
| 38 | if( mVoice->isPlaying() ) |
| 39 | mVoice->stop(); |
| 40 | |
| 41 | mVoice->start(); |
| 42 | } |
| 43 | |
| 44 | void VoiceBasicApp::keyDown( KeyEvent event ) |
| 45 | { |
nothing calls this directly
no test coverage detected