Skip to content

Commit 427ffd7

Browse files
authored
Merge pull request #59 from edap/patch-2
Add pause functionality to the example
2 parents 7bc8999 + eae5b0e commit 427ffd7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

example-soundPlayerObject/src/ofApp.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ void ofApp::draw(){
151151
//--------------------------------------------------------------
152152
void ofApp::mouseMoved(int x, int y ){}
153153
//--------------------------------------------------------------
154-
void ofApp::keyPressed(int key){}
154+
void ofApp::keyPressed(int key){
155+
if (key == 'p') {
156+
player.setPaused(true);
157+
} else if (key == 'c') {
158+
player.setPaused(false);
159+
}
160+
}
155161
//--------------------------------------------------------------
156162
void ofApp::keyReleased(int key){}
157163
//--------------------------------------------------------------

0 commit comments

Comments
 (0)