@Override
public final String toString()
{
if (contents==null)
{
final StringBuilder contentBuilder=new StringBuilder();
for (int loop=0; loop<indent; loop++)
contentBuilder.append('\t');
contentBuilder.append(subject.toString());
if (subject instanceof CompoundControl)
{
for (final Control member : ((CompoundControl)subject).getMemberControls())
{
contentBuilder.append(System.getProperty("line.separator"));
contentBuilder.append(new ControlDescription(member, indent+1).toString());
}
}
contents=contentBuilder.toString();
}
return contents;
}
java类javax.sound.sampled.Control的实例源码
ControlDescription.java 文件源码
项目:Couch-Potato-Server
阅读 25
收藏 0
点赞 0
评论 0
AbstractDataLine.java 文件源码
项目:OLD-OpenJDK8
阅读 21
收藏 0
点赞 0
评论 0
/**
* Constructs a new AbstractLine.
*/
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {
super(info, mixer, controls);
// record the default values
if (format != null) {
defaultFormat = format;
} else {
// default CD-quality
defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
}
if (bufferSize > 0) {
defaultBufferSize = bufferSize;
} else {
// 0.5 seconds buffer
defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
}
// set the initial values to the defaults
this.format = defaultFormat;
this.bufferSize = defaultBufferSize;
}
PortMixer.java 文件源码
项目:OLD-OpenJDK8
阅读 24
收藏 0
点赞 0
评论 0
void implOpen() throws LineUnavailableException {
if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
long newID = ((PortMixer) mixer).getID();
if ((id == 0) || (newID != id) || (controls.length == 0)) {
id = newID;
Vector vector = new Vector();
synchronized (vector) {
nGetControls(id, portIndex, vector);
controls = new Control[vector.size()];
for (int i = 0; i < controls.length; i++) {
controls[i] = (Control) vector.elementAt(i);
}
}
} else {
enableControls(controls, true);
}
if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
AbstractMixer.java 文件源码
项目:OLD-OpenJDK8
阅读 21
收藏 0
点赞 0
评论 0
/**
* Constructs a new AbstractMixer.
* @param mixer the mixer with which this line is associated
* @param controls set of supported controls
*/
protected AbstractMixer(Mixer.Info mixerInfo,
Control[] controls,
Line.Info[] sourceLineInfo,
Line.Info[] targetLineInfo) {
// Line.Info, AbstractMixer, Control[]
super(new Line.Info(Mixer.class), null, controls);
// setup the line part
this.mixer = this;
if (controls == null) {
controls = new Control[0];
}
// setup the mixer part
this.mixerInfo = mixerInfo;
this.sourceLineInfo = sourceLineInfo;
this.targetLineInfo = targetLineInfo;
}
AbstractDataLine.java 文件源码
项目:openjdk-jdk7u-jdk
阅读 22
收藏 0
点赞 0
评论 0
/**
* Constructs a new AbstractLine.
*/
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {
super(info, mixer, controls);
// record the default values
if (format != null) {
defaultFormat = format;
} else {
// default CD-quality
defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
}
if (bufferSize > 0) {
defaultBufferSize = bufferSize;
} else {
// 0.5 seconds buffer
defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
}
// set the initial values to the defaults
this.format = defaultFormat;
this.bufferSize = defaultBufferSize;
}
Controller.java 文件源码
项目:romanov
阅读 26
收藏 0
点赞 0
评论 0
/** @invisible
*
* Prints the available controls and their ranges to the console. Not all
* Controllers have all of the controls available on them so this is a way to find
* out what is available.
*
*/
public void printControls()
{
if (controls.length > 0)
{
System.out.println("Available controls are:");
for (int i = 0; i < controls.length; i++)
{
Control.Type type = controls[i].getType();
System.out.print(" " + type.toString());
if (type == VOLUME || type == GAIN || type == BALANCE || type == PAN)
{
FloatControl fc = (FloatControl) controls[i];
String shiftSupported = "does";
if (fc.getUpdatePeriod() == -1)
{
shiftSupported = "doesn't";
}
System.out.println(", which has a range of " + fc.getMaximum() + " to "
+ fc.getMinimum() + " and " + shiftSupported
+ " support shifting.");
}
else
{
System.out.println("");
}
}
}
else
{
System.out.println("There are no controls available.");
}
}
Controller.java 文件源码
项目:romanov
阅读 25
收藏 0
点赞 0
评论 0
@Deprecated
public Control getControl(Control.Type type)
{
for(int i = 0; i < controls.length; i++)
{
if ( controls[i].getType().equals(type) )
{
return controls[i];
}
}
return null;
}
PortMixer.java 文件源码
项目:OpenJSharp
阅读 36
收藏 0
点赞 0
评论 0
private void enableControls(Control[] controls, boolean enable) {
for (int i = 0; i < controls.length; i++) {
if (controls[i] instanceof BoolCtrl) {
((BoolCtrl) controls[i]).closed = !enable;
}
else if (controls[i] instanceof FloatCtrl) {
((FloatCtrl) controls[i]).closed = !enable;
}
else if (controls[i] instanceof CompoundControl) {
enableControls(((CompoundControl) controls[i]).getMemberControls(), enable);
}
}
}
AbstractLine.java 文件源码
项目:OpenJSharp
阅读 21
收藏 0
点赞 0
评论 0
/**
* Constructs a new AbstractLine.
* @param mixer the mixer with which this line is associated
* @param controls set of supported controls
*/
protected AbstractLine(Line.Info info, AbstractMixer mixer, Control[] controls) {
if (controls == null) {
controls = new Control[0];
}
this.info = info;
this.mixer = mixer;
this.controls = controls;
}
AbstractLine.java 文件源码
项目:OpenJSharp
阅读 23
收藏 0
点赞 0
评论 0
/**
* Obtains the set of controls supported by the
* line. If no controls are supported, returns an
* array of length 0.
* @return control set
*/
public final Control[] getControls() {
Control[] returnedArray = new Control[controls.length];
for (int i = 0; i < controls.length; i++) {
returnedArray[i] = controls[i];
}
return returnedArray;
}