--- old/src/share/classes/sun/audio/AudioData.java 2014-07-15 11:37:49.000000000 +0400 +++ /dev/null 2014-07-15 11:37:49.000000000 +0400 @@ -1,100 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.audio; - -import java.io.*; -import java.util.Arrays; - -import javax.sound.sampled.*; - - -/** - * A clip of audio data. This data can be used to construct an - * AudioDataStream, which can be played.
- *
- * @author Arthur van Hoff
- * @author Kara Kytle
- * @see AudioDataStream
- * @see AudioPlayer
- */
-
- /*
- * the idea here is that the AudioData object encapsulates the
- * data you need to play an audio clip based on a defined set
- * of data. to do this, you require the audio data (a byte
- * array rather than an arbitrary input stream) and a format
- * object.
- */
-
-
-public final class AudioData {
-
- private static final AudioFormat DEFAULT_FORMAT =
- new AudioFormat(AudioFormat.Encoding.ULAW,
- 8000, // sample rate
- 8, // sample size in bits
- 1, // channels
- 1, // frame size in bytes
- 8000, // frame rate
- true ); // bigendian (irrelevant for 8-bit data)
-
- AudioFormat format; // carry forth the format array amusement
- byte buffer[];
-
- /**
- * Constructor
- */
- public AudioData(final byte[] buffer) {
- // if we cannot extract valid format information, we resort to assuming
- // the data will be 8k mono u-law in order to provide maximal backwards
- // compatibility....
- this(DEFAULT_FORMAT, buffer);
-
- // okay, we need to extract the format and the byte buffer of data
- try {
- AudioInputStream ais = AudioSystem.getAudioInputStream(new ByteArrayInputStream(buffer));
- this.format = ais.getFormat();
- ais.close();
- // $$fb 2002-10-27: buffer contains the file header now!
- } catch (IOException e) {
- // use default format
- } catch (UnsupportedAudioFileException e1 ) {
- // use default format
- }
- }
-
-
- /**
- * Non-public constructor; this is the one we use in ADS and CADS
- * constructors.
- */
- AudioData(final AudioFormat format, final byte[] buffer) {
- this.format = format;
- if (buffer != null) {
- this.buffer = Arrays.copyOf(buffer, buffer.length);
- }
- }
-}
--- old/src/share/classes/sun/audio/AudioDataStream.java 2014-07-15 11:37:50.000000000 +0400
+++ /dev/null 2014-07-15 11:37:50.000000000 +0400
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.*;
-
-/**
- * An input stream to play AudioData.
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- * @author Kara Kytle
- */
-public class AudioDataStream extends ByteArrayInputStream {
-
- private final AudioData ad;
-
- /**
- * Constructor
- */
- public AudioDataStream(final AudioData data) {
-
- super(data.buffer);
- this.ad = data;
- }
-
- final AudioData getAudioData() {
- return ad;
- }
-}
--- old/src/share/classes/sun/audio/AudioDevice.java 2014-07-15 11:37:50.000000000 +0400
+++ /dev/null 2014-07-15 11:37:50.000000000 +0400
@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.util.Hashtable;
-import java.util.Vector;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedInputStream;
-
-import javax.sound.sampled.*;
-import javax.sound.midi.*;
-import com.sun.media.sound.DataPusher;
-import com.sun.media.sound.Toolkit;
-
-/**
- * This class provides an interface to the Headspace Audio engine through
- * the Java Sound API.
- *
- * This class emulates systems with multiple audio channels, mixing
- * multiple streams for the workstation's single-channel device.
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioStream
- * @see AudioStreamSequence
- * @see ContinuousAudioDataStream
- * @author David Rivas
- * @author Kara Kytle
- * @author Jan Borgersen
- * @author Florian Bomers
- */
-
-public final class AudioDevice {
-
- private boolean DEBUG = false /*true*/ ;
-
- private Vector
- * For example:
- *
- * For example:
- *
- * AudioPlayer.player.start(audiostream);
- *
- * To stop playing an audio stream use:
- *
- * AudioPlayer.player.stop(audiostream);
- *
- * To play an audio stream from a URL use:
- *
- * AudioStream audiostream = new AudioStream(url.openStream());
- * AudioPlayer.player.start(audiostream);
- *
- * To play a continuous sound you first have to
- * create an AudioData instance and use it to construct a
- * ContinuousAudioDataStream.
- * For example:
- *
- * AudioData data = new AudioStream(url.openStream()).getData();
- * ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- * AudioPlayer.player.start(audiostream);
- *
- *
- * @see AudioData
- * @see AudioDataStream
- * @see AudioDevice
- * @see AudioStream
- * @author Arthur van Hoff, Thomas Ball
- */
-
-public final class AudioPlayer extends Thread {
-
- private final AudioDevice devAudio;
- private final static boolean DEBUG = false /*true*/;
-
- /**
- * The default audio player. This audio player is initialized
- * automatically.
- */
- public static final AudioPlayer player = getAudioPlayer();
-
- private static ThreadGroup getAudioThreadGroup() {
-
- if(DEBUG) { System.out.println("AudioPlayer.getAudioThreadGroup()"); }
- ThreadGroup g = currentThread().getThreadGroup();
- while ((g.getParent() != null) &&
- (g.getParent().getParent() != null)) {
- g = g.getParent();
- }
- return g;
- }
-
- /**
- * Create an AudioPlayer thread in a privileged block.
- */
-
- private static AudioPlayer getAudioPlayer() {
-
- if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); }
- PrivilegedAction
- * Vector v = new Vector();
- * v.addElement(audiostream1);
- * v.addElement(audiostream2);
- * AudioStreamSequence audiostream = new AudioStreamSequence(v.elements());
- * AudioPlayer.player.start(audiostream);
- *
- * @see AudioPlayer
- * @author Arthur van Hoff
- */
-public final class AudioStreamSequence extends SequenceInputStream {
- /**
- * Create an AudioStreamSequence given an
- * enumeration of streams.
- */
- public AudioStreamSequence(Enumeration extends InputStream> e) {
- super(e);
- }
-}
--- old/src/share/classes/sun/audio/AudioTranslatorStream.java 2014-07-15 11:37:53.000000000 +0400
+++ /dev/null 2014-07-15 11:37:53.000000000 +0400
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Translator for native audio formats (not implemented in this release).
- *
- */
-public final class AudioTranslatorStream extends NativeAudioStream {
-
- private final int length = 0;
-
- public AudioTranslatorStream(InputStream in) throws IOException {
- super(in);
- // No translators supported yet.
- throw new InvalidAudioFormatException();
- }
-
- public int getLength() {
- return length;
- }
- }
--- old/src/share/classes/sun/audio/ContinuousAudioDataStream.java 2014-07-15 11:37:53.000000000 +0400
+++ /dev/null 2014-07-15 11:37:53.000000000 +0400
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-/**
- * Create a continuous audio stream. This wraps a stream
- * around an AudioData object, the stream is restarted
- * at the beginning everytime the end is reached, thus
- * creating continuous sound.
- * AudioData data = AudioData.getAudioData(url);
- * ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
- * AudioPlayer.player.start(audiostream);
- *
- *
- * @see AudioPlayer
- * @see AudioData
- * @author Arthur van Hoff
- */
-
-public final class ContinuousAudioDataStream extends AudioDataStream {
-
-
- /**
- * Create a continuous stream of audio.
- */
- public ContinuousAudioDataStream(AudioData data) {
-
- super(data);
- }
-
-
- public int read() {
-
- int i = super.read();
-
- if (i == -1) {
- reset();
- i = super.read();
- }
-
- return i;
- }
-
-
- public int read(byte ab[], int i1, int j) {
-
- int k;
-
- for (k = 0; k < j; ) {
- int i2 = super.read(ab, i1 + k, j - k);
- if (i2 >= 0) k += i2;
- else reset();
- }
-
- return k;
- }
- }
--- old/src/share/classes/sun/audio/InvalidAudioFormatException.java 2014-07-15 11:37:53.000000000 +0400
+++ /dev/null 2014-07-15 11:37:53.000000000 +0400
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-import java.io.IOException;
-
-/**
- * Signals an invalid audio stream for the stream handler.
- */
-@SuppressWarnings("serial") // JDK-implementation class
-final class InvalidAudioFormatException extends IOException {
-
-
- /**
- * Constructor.
- */
- InvalidAudioFormatException() {
- super();
- }
-
- /**
- * Constructor with a detail message.
- */
- InvalidAudioFormatException(String s) {
- super(s);
- }
-}
--- old/src/share/classes/sun/audio/NativeAudioStream.java 2014-07-15 11:37:54.000000000 +0400
+++ /dev/null 2014-07-15 11:37:54.000000000 +0400
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.audio;
-
-import java.io.InputStream;
-import java.io.DataInputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-
-/**
- * A Sun-specific AudioStream that supports native audio formats.
- *
- */
-
- /*
- * note: this file used to do the real header reading and
- * format verification for .au files (the only kind supported).
- * now we are way more cool than that and don't need this
- * functionality here; i'm just gutting this class and letting
- * it contain an ACIS instead (so now it should work for
- * all the data types we support....).
- */
-
-public
- class NativeAudioStream extends FilterInputStream {
-
-
- public NativeAudioStream(InputStream in) throws IOException {
-
- super(in);
- }
-
- public int getLength() {
- return 0;
- }
- }