progress on seeking

This commit is contained in:
Harrison Deng 2018-06-29 02:11:29 -05:00
parent aceaa7c89f
commit 4321a07f66
2 changed files with 22 additions and 0 deletions

View File

@ -15,6 +15,8 @@ public class RhythmBulletAudioThread extends Thread {
private short[] pcm;
private volatile boolean terminated;
private volatile boolean playing;
private volatile long framesPlayed;
private volatile float framesToSkip;
public RhythmBulletAudioThread(int windowSize, VisualizableMusic vm) {
music = vm;
@ -39,6 +41,7 @@ public class RhythmBulletAudioThread extends Thread {
ocl.onCompletion(music);
}
super.run();
}
@ -77,4 +80,10 @@ public class RhythmBulletAudioThread extends Thread {
public void setOnCompletionListener(OnCompletionListener ocl) {
this.ocl = ocl;
}
public void jumpToFrame(long frame) {
if (framesPlayed > frame) {
}
}
}

View File

@ -59,4 +59,17 @@ public interface PCMProcessor extends Disposable {
* @return the pan value.
*/
public float getPan();
/**
* resets the current input stream to the beginning.
* Not thread safe and should be called in the same thread as the one doing the playback.
*/
public void resetStream();
/**
* Skip this amount of frames.
* Not thread safe since this should be called in the same thread as the one doing the playback.
* @param framesToSkip
*/
public void skipFrames(long framesToSkip);
}