diff options
Diffstat (limited to 'songdbj/org/tritonus/share/sampled/AudioSystemShadow.java')
-rw-r--r-- | songdbj/org/tritonus/share/sampled/AudioSystemShadow.java | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/songdbj/org/tritonus/share/sampled/AudioSystemShadow.java b/songdbj/org/tritonus/share/sampled/AudioSystemShadow.java deleted file mode 100644 index 70b4e9ebd7..0000000000 --- a/songdbj/org/tritonus/share/sampled/AudioSystemShadow.java +++ /dev/null | |||
@@ -1,115 +0,0 @@ | |||
1 | /* | ||
2 | * AudioSystemShadow.java | ||
3 | * | ||
4 | * This file is part of Tritonus: http://www.tritonus.org/ | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * Copyright (c) 1999, 2000 by Matthias Pfisterer | ||
9 | * | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU Library General Public License as published | ||
13 | * by the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU Library General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Library General Public | ||
22 | * License along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | |<--- this code is formatted to fit into 80 columns --->| | ||
29 | */ | ||
30 | |||
31 | package org.tritonus.share.sampled; | ||
32 | |||
33 | import java.io.File; | ||
34 | import java.io.OutputStream; | ||
35 | import java.io.IOException; | ||
36 | |||
37 | import javax.sound.sampled.AudioFileFormat; | ||
38 | import javax.sound.sampled.AudioFormat; | ||
39 | |||
40 | import org.tritonus.share.sampled.file.AudioOutputStream; | ||
41 | import org.tritonus.share.sampled.file.TDataOutputStream; | ||
42 | import org.tritonus.share.sampled.file.TSeekableDataOutputStream; | ||
43 | import org.tritonus.share.sampled.file.TNonSeekableDataOutputStream; | ||
44 | import org.tritonus.sampled.file.AiffAudioOutputStream; | ||
45 | import org.tritonus.sampled.file.AuAudioOutputStream; | ||
46 | import org.tritonus.sampled.file.WaveAudioOutputStream; | ||
47 | |||
48 | |||
49 | |||
50 | /** Experminatal area for AudioSystem. | ||
51 | * This class is used to host features that may become part of the | ||
52 | * Java Sound API (In which case they will be moved to AudioSystem). | ||
53 | */ | ||
54 | public class AudioSystemShadow | ||
55 | { | ||
56 | public static TDataOutputStream getDataOutputStream(File file) | ||
57 | throws IOException | ||
58 | { | ||
59 | return new TSeekableDataOutputStream(file); | ||
60 | } | ||
61 | |||
62 | |||
63 | |||
64 | public static TDataOutputStream getDataOutputStream(OutputStream stream) | ||
65 | throws IOException | ||
66 | { | ||
67 | return new TNonSeekableDataOutputStream(stream); | ||
68 | } | ||
69 | |||
70 | |||
71 | |||
72 | // TODO: lLengthInBytes actually should be lLengthInFrames (design problem of A.O.S.) | ||
73 | public static AudioOutputStream getAudioOutputStream(AudioFileFormat.Type type, AudioFormat audioFormat, long lLengthInBytes, TDataOutputStream dataOutputStream) | ||
74 | { | ||
75 | AudioOutputStream audioOutputStream = null; | ||
76 | |||
77 | if (type.equals(AudioFileFormat.Type.AIFF) || | ||
78 | type.equals(AudioFileFormat.Type.AIFF)) | ||
79 | { | ||
80 | audioOutputStream = new AiffAudioOutputStream(audioFormat, type, lLengthInBytes, dataOutputStream); | ||
81 | } | ||
82 | else if (type.equals(AudioFileFormat.Type.AU)) | ||
83 | { | ||
84 | audioOutputStream = new AuAudioOutputStream(audioFormat, lLengthInBytes, dataOutputStream); | ||
85 | } | ||
86 | else if (type.equals(AudioFileFormat.Type.WAVE)) | ||
87 | { | ||
88 | audioOutputStream = new WaveAudioOutputStream(audioFormat, lLengthInBytes, dataOutputStream); | ||
89 | } | ||
90 | return audioOutputStream; | ||
91 | } | ||
92 | |||
93 | |||
94 | |||
95 | public static AudioOutputStream getAudioOutputStream(AudioFileFormat.Type type, AudioFormat audioFormat, long lLengthInBytes, File file) | ||
96 | throws IOException | ||
97 | { | ||
98 | TDataOutputStream dataOutputStream = getDataOutputStream(file); | ||
99 | AudioOutputStream audioOutputStream = getAudioOutputStream(type, audioFormat, lLengthInBytes, dataOutputStream); | ||
100 | return audioOutputStream; | ||
101 | } | ||
102 | |||
103 | |||
104 | |||
105 | public static AudioOutputStream getAudioOutputStream(AudioFileFormat.Type type, AudioFormat audioFormat, long lLengthInBytes, OutputStream outputStream) | ||
106 | throws IOException | ||
107 | { | ||
108 | TDataOutputStream dataOutputStream = getDataOutputStream(outputStream); | ||
109 | AudioOutputStream audioOutputStream = getAudioOutputStream(type, audioFormat, lLengthInBytes, dataOutputStream); | ||
110 | return audioOutputStream; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | |||
115 | /*** AudioSystemShadow.java ***/ | ||