/*
* 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.
*/
/**
* AbstractLine
*
* @author Kara Kytle
*/
private boolean open = false;
/**
* Contains event dispatcher per thread group.
*/
new WeakHashMap<>();
/**
* Constructs a new AbstractLine.
* @param mixer the mixer with which this line is associated
* @param controls set of supported controls
*/
}
}
// LINE METHODS
return info;
}
public final boolean isOpen() {
return open;
}
synchronized(listeners) {
}
}
}
/**
* Removes an audio listener.
* @param listener listener to remove
*/
}
/**
* Obtains the set of controls supported by the
* line. If no controls are supported, returns an
* array of length 0.
* @return control set
*/
returnedArray[i] = controls[i];
}
return returnedArray;
}
// protect against a NullPointerException
if (controlType == null) {
return false;
}
return true;
}
}
return false;
}
// protect against a NullPointerException
if (controlType != null) {
return controls[i];
}
}
}
}
// HELPER METHODS
/**
* This method sets the open state and generates
* events if it changes.
*/
if (Printer.trace) Printer.trace("> "+getClass().getName()+" (AbstractLine): setOpen(" + open + ") this.open: " + this.open);
boolean sendEvents = false;
long position = getLongFramePosition();
synchronized (this) {
sendEvents = true;
}
}
if (sendEvents) {
if (open) {
} else {
}
}
if (Printer.trace) Printer.trace("< "+getClass().getName()+" (AbstractLine): setOpen(" + open + ") this.open: " + this.open);
}
/**
* Send line events.
*/
}
/**
* This is an error in the API: getFramePosition
* should return a long value. At CD quality,
* the int value wraps around after 13 hours.
*/
public final int getFramePosition() {
return (int) getLongFramePosition();
}
/**
* Return the frame position in a long value
* This implementation returns AudioSystem.NOT_SPECIFIED.
*/
public long getLongFramePosition() {
return AudioSystem.NOT_SPECIFIED;
}
// $$kk: 06.03.99: returns the mixer used in construction.
// this is a hold-over from when there was a public method like
// this on line and should be fixed!!
return mixer;
}
// create and start the global event thread
//TODO need a way to stop this thread when the engine is done
synchronized (dispatchers) {
if (eventDispatcher == null) {
eventDispatcher = new EventDispatcher();
}
return eventDispatcher;
}
}
// ABSTRACT METHODS
public abstract void close();
}