/*
* 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.
*/
/**
* A Mixer which only provides Ports.
*
* @author Florian Bomers
*/
// CONSTANTS
// INSTANCE VARIABLES
// cache of instantiated ports
// instance ID of the native implementation
// CONSTRUCTOR
// pass in Line.Info, mixer, controls
super(portMixerInfo, // Mixer.Info
null, // Control[]
null, // Line.Info[] sourceLineInfo
null); // Line.Info[] targetLineInfo
int count = 0;
int srcLineCount = 0;
int dstLineCount = 0;
try {
try {
if (id != 0) {
if (count < 0) {
count = 0;
}
}
} catch (Exception e) {}
for (int i = 0; i < count; i++) {
}
} finally {
if (id != 0) {
}
id = 0;
}
// fill sourceLineInfo and targetLineInfos with copies of the ones in portInfos
for (int i = 0; i < count; i++) {
} else {
}
}
}
// ABSTRACT MIXER: ABSTRACT METHOD IMPLEMENTATIONS
return getPort(i);
}
}
}
}
// if it's not supported at all, return 0.
return 0;
}
//return AudioSystem.NOT_SPECIFIED; // if several instances of PortMixerPort
return 1;
}
return 0;
}
// open the mixer device
}
protected void implClose() {
// close the mixer device
id = 0;
ports[i].disposeControls();
}
}
}
}
protected void implStart() {}
protected void implStop() {}
// IMPLEMENTATION HELPERS
switch (type) {
}
// should never happen...
return null;
}
int getMixerIndex() {
}
}
}
// $$fb TODO: return (Port) (ports[index].clone());
}
long getID() {
return id;
}
// INNER CLASSES
/**
* Private inner class representing a Port for the PortMixer.
*/
implements Port {
private final int portIndex;
private long id;
// CONSTRUCTOR
int portIndex) {
}
// ABSTRACT METHOD IMPLEMENTATIONS
// ABSTRACT LINE
synchronized (vector) {
}
}
} else {
enableControls(controls, true);
}
}
}
}
else if (controls[i] instanceof CompoundControl) {
}
}
}
private void disposeControls() {
enableControls(controls, false);
}
void implClose() {
// get rid of controls
enableControls(controls, false);
}
// METHOD OVERRIDES
// this is very similar to open(AudioFormat, int) in AbstractDataLine...
synchronized (mixer) {
// if the line is not currently open, try to open it with this format and buffer size
if (!isOpen()) {
// reserve mixer resources for this line
try {
// open the line. may throw LineUnavailableException.
implOpen();
// if we succeeded, set the open state to true and send events
setOpen(true);
} catch (LineUnavailableException e) {
// release mixer resources for this line and then throw the exception
throw e;
}
}
}
}
// this is very similar to close() in AbstractDataLine...
public void close() {
synchronized (mixer) {
if (isOpen()) {
// set the open state to false and send events
setOpen(false);
// close resources for this line
implClose();
// release mixer resources for this line
}
}
}
} // class PortMixerPort
/**
* Private inner class representing a BooleanControl for PortMixerPort
*/
// the handle to the native control function
private final long controlID;
private boolean closed = false;
}
// $$fb add as new static type?
//return BooleanControl.Type.SELECT;
}
}
}
super(typ, false);
}
if (!closed) {
}
}
public boolean getValue() {
if (!closed) {
// never use any cached values
}
// ??
return false;
}
/**
* inner class for custom types
*/
super(name);
}
}
}
/**
* Private inner class representing a CompoundControl for PortMixerPort
*/
}
/**
* inner class for custom compound control types
*/
super(name);
}
}
}
/**
* Private inner class representing a BooleanControl for PortMixerPort
*/
// the handle to the native control function
private final long controlID;
private boolean closed = false;
// predefined float control types. See also Ports.h
null,
};
}
}
}
if (!closed) {
}
}
public float getValue() {
if (!closed) {
// never use any cached values
return nControlGetFloatValue(controlID);
}
// ??
return getMinimum();
}
/**
* inner class for custom types
*/
super(name);
}
}
}
/**
* Private inner class representing a port info
*/
}
}
// open the mixer with the given index. Returns a handle ID
// gets the number of ports for this mixer
// gets the type of the port with this index
// gets the name of the port with this index
// fills the vector with the controls for this port
}