Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/media/sound/AbstractMidiDeviceProvider.java
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.media.sound;
import java.util.Objects;
import javax.sound.midi.MidiDevice;
import javax.sound.midi.spi.MidiDeviceProvider;
/**
* Super class for MIDI input or output device provider.
*
* @author Florian Bomers
*/
public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider {
private static final boolean enabled;
/**
* Create objects representing all MIDI output devices on the system.
*/
static {
if (Printer.trace) Printer.trace("AbstractMidiDeviceProvider: static");
Platform.initialize();
enabled = Platform.isMidiIOEnabled();
if (Printer.trace) Printer.trace("AbstractMidiDeviceProvider: enabled: " + enabled);
// $$fb number of MIDI devices may change with time
// also for memory's sake, do not initialize the arrays here
}
final synchronized void readDeviceInfos() {
Info[] infos = getInfoCache();
MidiDevice[] devices = getDeviceCache();
if (!enabled) {
if (infos == null || infos.length != 0) {
setInfoCache(new Info[0]);
}
if (devices == null || devices.length != 0) {
setDeviceCache(new MidiDevice[0]);
}
return;
}
int oldNumDevices = (infos==null)?-1:infos.length;
int newNumDevices = getNumDevices();
if (oldNumDevices != newNumDevices) {
if (Printer.trace) Printer.trace(getClass().toString()
+": readDeviceInfos: old numDevices: "+oldNumDevices
+" newNumDevices: "+ newNumDevices);
// initialize the arrays
Info[] newInfos = new Info[newNumDevices];
MidiDevice[] newDevices = new MidiDevice[newNumDevices];
for (int i = 0; i < newNumDevices; i++) {
Info newInfo = createInfo(i);
// in case that we are re-reading devices, try to find
// the previous one and reuse it
if (infos != null) {
for (int ii = 0; ii < infos.length; ii++) {
Info info = infos[ii];
if (info != null && info.equalStrings(newInfo)) {
// new info matches the still existing info. Use old one
newInfos[i] = info;
info.setIndex(i);
infos[ii] = null; // prevent re-use
newDevices[i] = devices[ii];
devices[ii] = null;
break;
}
}
}
if (newInfos[i] == null) {
newInfos[i] = newInfo;
}
}
// the remaining MidiDevice.Info instances in the infos array
// have become obsolete.
if (infos != null) {
for (int i = 0; i < infos.length; i++) {
if (infos[i] != null) {
// disable this device info
infos[i].setIndex(-1);
}
// what to do with the MidiDevice instances that are left
// in the devices array ?? Close them ?
}
}
// commit new list of infos.
setInfoCache(newInfos);
setDeviceCache(newDevices);
}
}
@Override
public final MidiDevice.Info[] getDeviceInfo() {
readDeviceInfos();
Info[] infos = getInfoCache();
MidiDevice.Info[] localArray = new MidiDevice.Info[infos.length];
System.arraycopy(infos, 0, localArray, 0, infos.length);
return localArray;
}
@Override
public final MidiDevice getDevice(final MidiDevice.Info info) {
Objects.requireNonNull(info);
if (info instanceof Info) {
readDeviceInfos();
MidiDevice[] devices = getDeviceCache();
Info[] infos = getInfoCache();
Info thisInfo = (Info) info;
int index = thisInfo.getIndex();
if (index >= 0 && index < devices.length && infos[index] == info) {
if (devices[index] == null) {
devices[index] = createDevice(thisInfo);
}
if (devices[index] != null) {
return devices[index];
}
}
}
throw MidiUtils.unsupportedDevice(info);
}
/**
* Info class for MidiDevices. Adds an index value for
* making native references to a particular device.
*/
static class Info extends MidiDevice.Info {
private int index;
Info(String name, String vendor, String description, String version, int index) {
super(name, vendor, description, version);
this.index = index;
}
final boolean equalStrings(Info info) {
return (info != null
&& getName().equals(info.getName())
&& getVendor().equals(info.getVendor())
&& getDescription().equals(info.getDescription())
&& getVersion().equals(info.getVersion()));
}
final int getIndex() {
return index;
}
final void setIndex(int index) {
this.index = index;
}
} // class Info
abstract int getNumDevices();
abstract MidiDevice[] getDeviceCache();
abstract void setDeviceCache(MidiDevice[] devices);
abstract Info[] getInfoCache();
abstract void setInfoCache(Info[] infos);
abstract Info createInfo(int index);
abstract MidiDevice createDevice(Info info);
}
⏎ com/sun/media/sound/AbstractMidiDeviceProvider.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, ≈447🔥, 5💬
Popular Posts:
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...
How to compare performances of various XML parsers with the jaxp\SourceValidator.jav aprovided in th...
JDK 7 tools.jar is the JAR file for JDK 7 tools. It contains Java classes to support different JDK t...
maven-compat-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Compact module. The JAR file name may ...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...