diff options
Diffstat (limited to 'songdbj/javazoom/jl/player/AudioDevice.java')
-rw-r--r-- | songdbj/javazoom/jl/player/AudioDevice.java | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/songdbj/javazoom/jl/player/AudioDevice.java b/songdbj/javazoom/jl/player/AudioDevice.java deleted file mode 100644 index 45c28600e6..0000000000 --- a/songdbj/javazoom/jl/player/AudioDevice.java +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * 11/19/04 1.0 moved to LGPL. | ||
3 | * 29/01/00 Initial version. mdm@techie.com | ||
4 | *----------------------------------------------------------------------- | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Library General Public License as published | ||
7 | * by the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU Library General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU Library General Public | ||
16 | * License along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | *---------------------------------------------------------------------- | ||
19 | */ | ||
20 | |||
21 | package javazoom.jl.player; | ||
22 | |||
23 | import javazoom.jl.decoder.Decoder; | ||
24 | import javazoom.jl.decoder.JavaLayerException; | ||
25 | |||
26 | /** | ||
27 | * The <code>AudioDevice</code> interface provides an abstraction for | ||
28 | * a device capable of sounding audio samples. Samples are written to | ||
29 | * the device wia the write() method. The device assumes | ||
30 | * that these samples are signed 16-bit samples taken at the output frequency | ||
31 | * of the decoder. If the decoder outputs more than one channel, the samples for | ||
32 | * each channel are assumed to appear consecutively, with the lower numbered | ||
33 | * channels preceeding higher-numbered channels. E.g. if there are two | ||
34 | * channels, the samples will appear in this order: | ||
35 | * <pre><code> | ||
36 | * | ||
37 | * l0, r0, l1, r1, l2, r2... | ||
38 | * | ||
39 | * where | ||
40 | * l<i>x</i> indicates the <i>x</i>th sample on channel 0 | ||
41 | * r<i>x</i> indicates the <i>x</i>th sample on channel 1 | ||
42 | * </code></pre> | ||
43 | * | ||
44 | * @since 0.0.8 | ||
45 | * @author Mat McGowan | ||
46 | */ | ||
47 | public interface AudioDevice | ||
48 | { | ||
49 | /** | ||
50 | * Prepares the AudioDevice for playback of audio samples. | ||
51 | * @param decoder The decoder that will be providing the audio | ||
52 | * samples. | ||
53 | * | ||
54 | * If the audio device is already open, this method returns silently. | ||
55 | * | ||
56 | */ | ||
57 | public void open(Decoder decoder) throws JavaLayerException; | ||
58 | |||
59 | /** | ||
60 | * Retrieves the open state of this audio device. | ||
61 | * | ||
62 | * @return <code>true</code> if this audio device is open and playing | ||
63 | * audio samples, or <code>false</code> otherwise. | ||
64 | */ | ||
65 | public boolean isOpen(); | ||
66 | |||
67 | /** | ||
68 | * Writes a number of samples to this <code>AudioDevice</code>. | ||
69 | * | ||
70 | * @param samples The array of signed 16-bit samples to write | ||
71 | * to the audio device. | ||
72 | * @param offs The offset of the first sample. | ||
73 | * @param len The number of samples to write. | ||
74 | * | ||
75 | * This method may return prior to the samples actually being played | ||
76 | * by the audio device. | ||
77 | */ | ||
78 | public void write(short[] samples, int offs, int len) throws JavaLayerException; | ||
79 | |||
80 | |||
81 | /** | ||
82 | * Closes this audio device. Any currently playing audio is stopped | ||
83 | * as soon as possible. Any previously written audio data that has not been heard | ||
84 | * is discarded. | ||
85 | * | ||
86 | * The implementation should ensure that any threads currently blocking | ||
87 | * on the device (e.g. during a <code>write</code> or <code>flush</code> | ||
88 | * operation should be unblocked by this method. | ||
89 | */ | ||
90 | public void close(); | ||
91 | |||
92 | |||
93 | /** | ||
94 | * Blocks until all audio samples previously written to this audio device have | ||
95 | * been heard. | ||
96 | */ | ||
97 | public void flush(); | ||
98 | |||
99 | /** | ||
100 | * Retrieves the current playback position in milliseconds. | ||
101 | */ | ||
102 | public int getPosition(); | ||
103 | } | ||