本文整理匯總了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));
}
}