1 package com.melloware.jukes.gui.tool;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5
6 import javax.sound.sampled.SourceDataLine;
7
8 import javazoom.jlgui.basicplayer.BasicPlayer;
9 import javazoom.jlgui.basicplayer.BasicPlayerEvent;
10
11
12
13
14
15
16
17
18 public final class JukesPlayer extends BasicPlayer {
19
20
21
22 private static final Log LOG = LogFactory.getLog(JukesPlayer.class);
23
24
25
26
27 @Override
28 public void run() {
29 try {
30 super.run();
31 } catch (RuntimeException ex) {
32 LOG.error("JukesPlayer: Unexpected error occurred trying to play file.", ex);
33 notifyEvent(BasicPlayerEvent.STOPPED, getEncodedStreamPosition(), -1, null);
34 }
35 }
36
37 public SourceDataLine getSourceDataLine() {
38 return this.m_line;
39 }
40 }