--- old/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingClip.java 2016-08-12 17:02:46.000000000 +0300 +++ new/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingClip.java 2016-08-12 17:02:46.000000000 +0300 @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.media.sound; import java.io.ByteArrayOutputStream; @@ -52,6 +53,7 @@ private final InputStream datastream = new InputStream() { + @Override public int read() throws IOException { byte[] b = new byte[1]; int ret = read(b); @@ -60,6 +62,7 @@ return b[0] & 0xFF; } + @Override public int read(byte[] b, int off, int len) throws IOException { if (_loopcount != 0) { @@ -166,6 +169,7 @@ super(mixer, info); } + @Override protected void processControlLogic() { _rightgain = rightgain; @@ -203,6 +207,7 @@ } + @Override protected void processAudioLogic(SoftAudioBuffer[] buffers) { if (_active) { float[] left = buffers[SoftMixingMainMixer.CHANNEL_LEFT].array(); @@ -273,15 +278,18 @@ } } + @Override public int getFrameLength() { return bufferSize / format.getFrameSize(); } + @Override public long getMicrosecondLength() { return (long) (getFrameLength() * (1000000.0 / (double) getFormat() .getSampleRate())); } + @Override public void loop(int count) { LineEvent event = null; @@ -302,8 +310,9 @@ } + @Override public void open(AudioInputStream stream) throws LineUnavailableException, - IOException { + IOException { if (isOpen()) { throw new IllegalStateException("Clip is already open with format " + getFormat() + " and frame lengh of " + getFrameLength()); @@ -342,6 +351,7 @@ } + @Override public void open(AudioFormat format, byte[] data, int offset, int bufferSize) throws LineUnavailableException { synchronized (control_mutex) { @@ -385,6 +395,7 @@ } + @Override public void setFramePosition(int frames) { synchronized (control_mutex) { frameposition_sg = true; @@ -392,6 +403,7 @@ } } + @Override public void setLoopPoints(int start, int end) { synchronized (control_mutex) { if (end != -1) { @@ -414,60 +426,73 @@ } } + @Override public void setMicrosecondPosition(long microseconds) { setFramePosition((int) (microseconds * (((double) getFormat() .getSampleRate()) / 1000000.0))); } + @Override public int available() { return 0; } + @Override public void drain() { } + @Override public void flush() { } + @Override public int getBufferSize() { return bufferSize; } + @Override public AudioFormat getFormat() { return format; } + @Override public int getFramePosition() { synchronized (control_mutex) { return frameposition; } } + @Override public float getLevel() { return AudioSystem.NOT_SPECIFIED; } + @Override public long getLongFramePosition() { return getFramePosition(); } + @Override public long getMicrosecondPosition() { return (long) (getFramePosition() * (1000000.0 / (double) getFormat() .getSampleRate())); } + @Override public boolean isActive() { synchronized (control_mutex) { return active; } } + @Override public boolean isRunning() { synchronized (control_mutex) { return active; } } + @Override public void start() { LineEvent event = null; @@ -488,6 +513,7 @@ sendEvent(event); } + @Override public void stop() { LineEvent event = null; @@ -506,6 +532,7 @@ sendEvent(event); } + @Override public void close() { LineEvent event = null; @@ -526,10 +553,12 @@ } + @Override public boolean isOpen() { return open; } + @Override public void open() throws LineUnavailableException { if (data == null) { throw new IllegalArgumentException(