Java Code Examples for javax.sound.sampled.LineEvent#Type

The following examples show how to use javax.sound.sampled.LineEvent#Type . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Sound.java    From Lunar with MIT License 5 votes vote down vote up
@Override
public void update(LineEvent event) {
    LineEvent.Type type = event.getType();
    if (type == LineEvent.Type.STOP) {
        clip.close();
    }
}
 
Example 2
Source File: MusicPlayer.java    From WorldGrower with GNU General Public License v3.0 5 votes vote down vote up
@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());
		}
	}
}
 
Example 3
Source File: Mixer.java    From mmscomputing with GNU Lesser General Public License v3.0 4 votes vote down vote up
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));
  }
}