/*
* 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.
*/
/**
* Software audio mixer
*
* @author Karl Helgason
*/
Info() {
}
}
boolean implicitOpen = false;
private boolean open = false;
private final boolean jitter_correction = false;
public SoftMixingMixer() {
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, false));
}
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, true));
AudioSystem.NOT_SPECIFIED, false));
AudioSystem.NOT_SPECIFIED, true));
}
.size()]);
}
if (!isLineSupported(info))
}
}
}
return AudioSystem.NOT_SPECIFIED;
return AudioSystem.NOT_SPECIFIED;
return 0;
}
return info;
}
return localArray;
}
int i;
}
}
}
Line[] localLines;
synchronized (control_mutex) {
return new Line[0];
localLines[i] = sourceLines[i];
}
}
return localLines;
}
}
}
return new Line[0];
}
return true;
}
}
}
return false;
}
return false;
}
throw new IllegalArgumentException(
"Synchronization not supported by this mixer.");
}
throw new IllegalArgumentException(
"Synchronization not supported by this mixer.");
}
synchronized (control_mutex) {
}
}
return;
}
}
public void close() {
if (!isOpen())
return;
synchronized (control_mutex) {
}
}
if (pusher_to_be_closed != null) {
// Pusher must not be closed synchronized against control_mutex
// this may result in synchronized conflict between pusher and
// current thread.
try {
} catch (IOException e) {
e.printStackTrace();
}
}
synchronized (control_mutex) {
open = false;
if (sourceDataLine != null) {
}
}
}
throw new IllegalArgumentException("Unsupported control type : "
+ control);
}
return new Control[0];
}
}
return false;
}
public boolean isOpen() {
synchronized (control_mutex) {
return open;
}
}
if (isOpen()) {
implicitOpen = false;
return;
}
}
if (isOpen()) {
implicitOpen = false;
return;
}
synchronized (control_mutex) {
try {
synchronized (SoftMixingMixerProvider.mutex) {
.currentThread();
}
try {
if (defaultmixer != null)
{
// Search for suitable line
{
{
break idealFound;
}
}
}
}
if(idealformat != null)
{
}
}
} finally {
synchronized (SoftMixingMixerProvider.mutex) {
}
}
throw new IllegalArgumentException("No line matching "
}
// Remember that we opened that line
// so we can close again in SoftSynthesizer.close()
}
int controlbuffersize = 512;
try {
} catch (IOException e) {
}
// Tell mixer not fill read buffers fully.
// This lowers latency, and tells DataPusher
// to read in smaller amounts.
// mainmixer.readfully = false;
// pusher = new DataPusher(line, ais);
if (jitter_correction) {
}
pusher_stream = ais;
} catch (LineUnavailableException e) {
if (isOpen())
close();
throw new LineUnavailableException(e.toString());
}
}
}
throws LineUnavailableException {
if (isOpen())
throw new LineUnavailableException("Mixer is already open");
synchronized (control_mutex) {
open = true;
implicitOpen = false;
if (targetFormat != null)
mainmixer = new SoftMixingMainMixer(this);
return mainmixer.getInputStream();
}
}
synchronized (control_mutex) {
}
}
public long getLatency() {
synchronized (control_mutex) {
return latency;
}
}
synchronized (control_mutex) {
return format;
}
}
float getControlRate() {
return controlrate;
}
if (!isOpen())
return null;
return mainmixer;
}
}