本文整理汇总了Java中javax.sound.sampled.LineEvent.Type方法的典型用法代码示例。如果您正苦于以下问题:Java LineEvent.Type方法的具体用法?Java LineEvent.Type怎么用?Java LineEvent.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sound.sampled.LineEvent
的用法示例。
在下文中一共展示了LineEvent.Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import javax.sound.sampled.LineEvent; //导入方法依赖的package包/类
@Override
public void update(LineEvent event) {
LineEvent.Type type = event.getType();
if (type == LineEvent.Type.STOP) {
clip.close();
}
}
示例2: update
import javax.sound.sampled.LineEvent; //导入方法依赖的package包/类
/**
* Monitors the source data line playback state and broadcasts audio events
* to the registered listener as the state changes
*/
@Override
public void update(LineEvent event)
{
LineEvent.Type type = event.getType();
if(type == LineEvent.Type.START)
{
mAudioEventBroadcaster.broadcast(mAudioStartEvent);
}
else if(type == LineEvent.Type.STOP)
{
mAudioEventBroadcaster.broadcast(mAudioStopEvent);
}
}
示例3: update
import javax.sound.sampled.LineEvent; //导入方法依赖的package包/类
@Override
public void update(LineEvent event) {
LineEvent.Type type = event.getType();
if (type == LineEvent.Type.STOP) {
if (audioClip != null) {
audioClip.close();
audioClip.removeLineListener(this);
audioClip = null;
}
if (enabled) {
sleep(500);
play(musicLoader.getNextFile());
}
}
}
示例4: update
import javax.sound.sampled.LineEvent; //导入方法依赖的package包/类
@Override
public synchronized void update(LineEvent event) {
LineEvent.Type eventType = event.getType();
if (eventType == LineEvent.Type.STOP || eventType == LineEvent.Type.CLOSE) {
done = true;
notifyAll();
}
}
示例5: fireListenerUpdate
import javax.sound.sampled.LineEvent; //导入方法依赖的package包/类
public void fireListenerUpdate(LineEvent.Type type){
for(Enumeration e = listeners.elements(); e.hasMoreElements() ;){
LineListener listener=(LineListener)e.nextElement();
listener.update(new LineEvent(this,type,position));
}
}