Skip to content

Commit

Permalink
sampler is now parameter for is_done listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisppaul committed Jun 19, 2024
1 parent 7abfde3 commit 765cc95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/wellen/SamplerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package wellen;

import wellen.dsp.Sampler;

public interface SamplerListener {
void is_done();
void is_done(Sampler pSampler);
}
3 changes: 2 additions & 1 deletion src/wellen/dsp/Sampler.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public float output() {

if (fDirectionForward ? (mCurrentIndex >= fOutPoint) : (mCurrentIndex <= fInPoint)) {
notifyListeners("reached end");
fIsPlaying = false;
return 0.0f;
} else {
fIsFlaggedDone = false;
Expand Down Expand Up @@ -444,7 +445,7 @@ private int last_index() {
private void notifyListeners(String event) {
if (!fIsFlaggedDone) {
for (SamplerListener l : fSamplerListeners) {
l.is_done();
l.is_done(this);
}
}
fIsFlaggedDone = true;
Expand Down

0 comments on commit 765cc95

Please sign in to comment.