Skip to content

Commit

Permalink
Sound player end notification now working
Browse files Browse the repository at this point in the history
  • Loading branch information
roymacdonald committed Jul 19, 2023
1 parent ebacf7b commit a8f50fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ofxMultiSoundPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ void ofxMultiSoundPlayer::setNumInstances(const size_t & num){
}

}
void ofxMultiSoundPlayer::onInstanceEnd(size_t&){
void ofxMultiSoundPlayer::onInstanceEnd(size_t& i){
checkPaused();
ofNotifyEvent(endEvent, i, this);
}
//========================GETTERS===============================
//--------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion src/ofxSingleSoundPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ void ofxSingleSoundPlayer::stop(){
//--------------------------------------------------------------
void ofxSingleSoundPlayer::update(ofEventArgs&){
if(bNotifyEnd){
ofNotifyEvent(endEvent, _id, this);
auto i = _id;// make a copy so it is not possible to modify it through the callback, as it is passed by nonconst reference
ofNotifyEvent(endEvent, i, this);
bNotifyEnd = false;
}
if(bNeedsPreprocessBuffer){
Expand Down

0 comments on commit a8f50fb

Please sign in to comment.