MCPcopy Create free account
hub / github.com/cinder/Cinder / mouseDown

Method mouseDown

samples/_audio/VoiceBasic/src/VoiceBasicApp.cpp:28–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void 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
44void VoiceBasicApp::keyDown( KeyEvent event )
45{

Callers

nothing calls this directly

Calls 8

getWindowHeightFunction · 0.85
getWindowWidthFunction · 0.85
getPosMethod · 0.45
setVolumeMethod · 0.45
setPanMethod · 0.45
isPlayingMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected