public void setPlayer(Wavefile af) throws Exception{
clip = af.getClip();
clip.open();
fullLength = clip.getFrameLength();
endPoint = fullLength;
gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
playing = false;
clip.addLineListener(new LineListener(){
@Override
public void update(LineEvent arg0) {
while(playing){
int tempframe = clip.getFramePosition();
MakamBoxAnalysis.positionSlide.setValue(tempframe);
if (stopbutton!=null&&tempframe == fullLength){
stopbutton.doClick();
} else if(stopbutton!=null && tempframe>=endPoint){
playAgain();
} else if (tempframe == fullLength){
stop();
}
}
}
});
}
Player.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:MakamBox
作者:
评论列表
文章目录