/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*/
/**
* Clip implemention for the SoftMixingMixer.
*
* @author Karl Helgason
*/
private int framesize;
private byte[] data;
public int read() throws IOException {
byte[] b = new byte[1];
if (ret < 0)
return ret;
return b[0] & 0xFF;
}
if (_loopcount != 0) {
int o = off;
if (_loopcount == 0)
break;
pos = bloopstart;
if (_loopcount != LOOP_CONTINUOUSLY)
_loopcount--;
}
}
if (_loopcount == 0) {
}
return o - off;
}
}
if (left == 0)
return -1;
return len;
}
};
private int offset;
private int bufferSize;
private float[] readbuffer;
private boolean open = false;
private int out_nrofchannels;
private int in_nrofchannels;
private boolean frameposition_sg = false;
private boolean active_sg = false;
private boolean active = false;
private boolean _active = false;
private boolean loop_sg = false;
private float _rightgain;
private float _leftgain;
private float _eff1gain;
private float _eff2gain;
}
protected void processControlLogic() {
if (active_sg) {
active_sg = false;
} else {
}
if (frameposition_sg) {
frameposition_sg = false;
} else {
}
if (loop_sg) {
}
}
}
if (_active) {
readbuffer = new float[readlen];
}
int ret = 0;
try {
if (ret == -1) {
_active = false;
return;
}
if (ret != in_nrofchannels)
} catch (IOException e) {
}
int in_c = in_nrofchannels;
}
if (out_nrofchannels != 1) {
if (in_nrofchannels == 1) {
}
} else {
}
}
}
if (_eff1gain > 0.0002) {
.array();
}
if (in_nrofchannels == 2) {
}
}
}
if (_eff2gain > 0.0002) {
.array();
}
if (in_nrofchannels == 2) {
}
}
}
}
}
public int getFrameLength() {
}
public long getMicrosecondLength() {
.getSampleRate()));
}
synchronized (control_mutex) {
if (isOpen()) {
if (active)
return;
active = true;
active_sg = true;
}
}
}
if (isOpen()) {
throw new IllegalStateException("Clip is already open with format "
}
throw new IllegalArgumentException("Invalid format : "
int len = 0;
if (ret == -1)
break;
if (ret == 0)
}
} else {
int r = 0;
if (r == 0)
}
}
}
throws LineUnavailableException {
synchronized (control_mutex) {
if (isOpen()) {
throw new IllegalStateException(
"Clip is already open with format " + getFormat()
+ " and frame lengh of " + getFrameLength());
}
throw new IllegalArgumentException("Invalid format : "
throw new IllegalArgumentException(
"Buffer size does not represent an integral number of sample frames!");
this.bufferSize = bufferSize;
loopstart = 0;
loopend = -1;
loop_sg = true;
mixer.implicitOpen = true;
}
open = true;
}
}
synchronized (control_mutex) {
frameposition_sg = true;
}
}
synchronized (control_mutex) {
if (end != -1) {
throw new IllegalArgumentException("Invalid loop points : "
throw new IllegalArgumentException("Invalid loop points : "
}
throw new IllegalArgumentException("Invalid loop points : "
if (0 < start)
throw new IllegalArgumentException("Invalid loop points : "
loop_sg = true;
}
}
.getSampleRate()) / 1000000.0)));
}
public int available() {
return 0;
}
public void drain() {
}
public void flush() {
}
public int getBufferSize() {
return bufferSize;
}
return format;
}
public int getFramePosition() {
synchronized (control_mutex) {
return frameposition;
}
}
public float getLevel() {
return AudioSystem.NOT_SPECIFIED;
}
public long getLongFramePosition() {
return getFramePosition();
}
public long getMicrosecondPosition() {
.getSampleRate()));
}
public boolean isActive() {
synchronized (control_mutex) {
return active;
}
}
public boolean isRunning() {
synchronized (control_mutex) {
return active;
}
}
public void start() {
synchronized (control_mutex) {
if (isOpen()) {
if (active)
return;
active = true;
active_sg = true;
loopcount = 0;
}
}
}
public void stop() {
synchronized (control_mutex) {
if (isOpen()) {
if (!active)
return;
active = false;
active_sg = true;
}
}
}
public void close() {
synchronized (control_mutex) {
if (!isOpen())
return;
stop();
open = false;
}
}
public boolean isOpen() {
return open;
}
throw new IllegalArgumentException(
"Illegal call to open() in interface Clip");
}
}
}