From cb82302279a1e78add7106d23369744f78da15a1 Mon Sep 17 00:00:00 2001 From: Roy Macdonald Date: Tue, 18 Jul 2023 20:45:43 -0400 Subject: [PATCH] Updated soundPlayer example --- example-soundPlayerObject/src/ofApp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example-soundPlayerObject/src/ofApp.cpp b/example-soundPlayerObject/src/ofApp.cpp index be4844e..db8ff0f 100644 --- a/example-soundPlayerObject/src/ofApp.cpp +++ b/example-soundPlayerObject/src/ofApp.cpp @@ -97,10 +97,10 @@ void ofApp::setup(){ // set if you want to either have the player looping (playing over and over again) or not (stop once it reaches the its end). player.setLoop(true); - if(!player.getIsLooping()){ - // if the player is not looping you can register to the end event, which will get triggered when the player reaches the end of the file. - playerEndListener = player.endEvent.newListener(this, &ofApp::playerEnded); - } + // the endEvent gets triggered when it reaches the end of the file, regardless of it being + // in looping or not + playerEndListener = player.endEvent.newListener(this, &ofApp::playerEnded); + } //-------------------------------------------------------------- void ofApp::playerEnded(size_t & id){