8042256: Fix raw and unchecked lint warnings in com.sun.media.sound
Reviewed-by: prr
This commit is contained in:
parent
835658f99d
commit
1a24f81c1b
@ -48,7 +48,7 @@ abstract class AbstractLine implements Line {
|
|||||||
protected Control[] controls;
|
protected Control[] controls;
|
||||||
AbstractMixer mixer;
|
AbstractMixer mixer;
|
||||||
private boolean open = false;
|
private boolean open = false;
|
||||||
private final Vector listeners = new Vector();
|
private final Vector<Object> listeners = new Vector<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains event dispatcher per thread group.
|
* Contains event dispatcher per thread group.
|
||||||
|
@ -70,7 +70,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice
|
|||||||
|
|
||||||
/** List of Receivers and Transmitters that opened the device implicitely.
|
/** List of Receivers and Transmitters that opened the device implicitely.
|
||||||
*/
|
*/
|
||||||
private List openKeepingObjects;
|
private List<Object> openKeepingObjects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the device handle returned from native code
|
* This is the device handle returned from native code
|
||||||
@ -284,6 +284,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked") // Cast of result of clone
|
||||||
public final List<Receiver> getReceivers() {
|
public final List<Receiver> getReceivers() {
|
||||||
List<Receiver> recs;
|
List<Receiver> recs;
|
||||||
synchronized (traRecLock) {
|
synchronized (traRecLock) {
|
||||||
@ -313,6 +314,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked") // Cast of result of clone
|
||||||
public final List<Transmitter> getTransmitters() {
|
public final List<Transmitter> getTransmitters() {
|
||||||
List<Transmitter> tras;
|
List<Transmitter> tras;
|
||||||
synchronized (traRecLock) {
|
synchronized (traRecLock) {
|
||||||
@ -372,9 +374,9 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice
|
|||||||
|
|
||||||
/** Return the list of objects that have opened the device implicitely.
|
/** Return the list of objects that have opened the device implicitely.
|
||||||
*/
|
*/
|
||||||
private synchronized List getOpenKeepingObjects() {
|
private synchronized List<Object> getOpenKeepingObjects() {
|
||||||
if (openKeepingObjects == null) {
|
if (openKeepingObjects == null) {
|
||||||
openKeepingObjects = new ArrayList();
|
openKeepingObjects = new ArrayList<>();
|
||||||
}
|
}
|
||||||
return openKeepingObjects;
|
return openKeepingObjects;
|
||||||
}
|
}
|
||||||
|
@ -90,13 +90,13 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
/**
|
/**
|
||||||
* Source lines (ports) currently open
|
* Source lines (ports) currently open
|
||||||
*/
|
*/
|
||||||
private final Vector sourceLines = new Vector();
|
private final Vector<Line> sourceLines = new Vector<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Target lines currently open.
|
* Target lines currently open.
|
||||||
*/
|
*/
|
||||||
private final Vector targetLines = new Vector();
|
private final Vector<Line> targetLines = new Vector<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -151,7 +151,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
public final Line.Info[] getSourceLineInfo(Line.Info info) {
|
public final Line.Info[] getSourceLineInfo(Line.Info info) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
Vector vec = new Vector();
|
Vector<Line.Info> vec = new Vector<>();
|
||||||
|
|
||||||
for (i = 0; i < sourceLineInfo.length; i++) {
|
for (i = 0; i < sourceLineInfo.length; i++) {
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
|
|
||||||
Line.Info[] returnedArray = new Line.Info[vec.size()];
|
Line.Info[] returnedArray = new Line.Info[vec.size()];
|
||||||
for (i = 0; i < returnedArray.length; i++) {
|
for (i = 0; i < returnedArray.length; i++) {
|
||||||
returnedArray[i] = (Line.Info)vec.elementAt(i);
|
returnedArray[i] = vec.elementAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnedArray;
|
return returnedArray;
|
||||||
@ -172,7 +172,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
public final Line.Info[] getTargetLineInfo(Line.Info info) {
|
public final Line.Info[] getTargetLineInfo(Line.Info info) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
Vector vec = new Vector();
|
Vector<Line.Info> vec = new Vector<>();
|
||||||
|
|
||||||
for (i = 0; i < targetLineInfo.length; i++) {
|
for (i = 0; i < targetLineInfo.length; i++) {
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
|
|
||||||
Line.Info[] returnedArray = new Line.Info[vec.size()];
|
Line.Info[] returnedArray = new Line.Info[vec.size()];
|
||||||
for (i = 0; i < returnedArray.length; i++) {
|
for (i = 0; i < returnedArray.length; i++) {
|
||||||
returnedArray[i] = (Line.Info)vec.elementAt(i);
|
returnedArray[i] = vec.elementAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnedArray;
|
return returnedArray;
|
||||||
@ -231,7 +231,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
localLines = new Line[sourceLines.size()];
|
localLines = new Line[sourceLines.size()];
|
||||||
|
|
||||||
for (int i = 0; i < localLines.length; i++) {
|
for (int i = 0; i < localLines.length; i++) {
|
||||||
localLines[i] = (Line)sourceLines.elementAt(i);
|
localLines[i] = sourceLines.elementAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
localLines = new Line[targetLines.size()];
|
localLines = new Line[targetLines.size()];
|
||||||
|
|
||||||
for (int i = 0; i < localLines.length; i++) {
|
for (int i = 0; i < localLines.length; i++) {
|
||||||
localLines[i] = (Line)targetLines.elementAt(i);
|
localLines[i] = targetLines.elementAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,7 +453,8 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector localSourceLines = (Vector)sourceLines.clone();
|
@SuppressWarnings("unchecked")
|
||||||
|
Vector<Line> localSourceLines = (Vector<Line>)sourceLines.clone();
|
||||||
for (int i = 0; i < localSourceLines.size(); i++) {
|
for (int i = 0; i < localSourceLines.size(); i++) {
|
||||||
|
|
||||||
// if any other open line is running, return
|
// if any other open line is running, return
|
||||||
@ -468,7 +469,8 @@ abstract class AbstractMixer extends AbstractLine implements Mixer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector localTargetLines = (Vector)targetLines.clone();
|
@SuppressWarnings("unchecked")
|
||||||
|
Vector<Line> localTargetLines = (Vector<Line>)targetLines.clone();
|
||||||
for (int i = 0; i < localTargetLines.size(); i++) {
|
for (int i = 0; i < localTargetLines.size(); i++) {
|
||||||
|
|
||||||
// if any other open line is running, return
|
// if any other open line is running, return
|
||||||
|
@ -213,7 +213,7 @@ public final class AlawCodec extends SunCodec {
|
|||||||
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
||||||
|
|
||||||
|
|
||||||
Vector formats = new Vector();
|
Vector<AudioFormat> formats = new Vector<>();
|
||||||
AudioFormat format;
|
AudioFormat format;
|
||||||
|
|
||||||
if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) {
|
if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) {
|
||||||
@ -248,7 +248,7 @@ public final class AlawCodec extends SunCodec {
|
|||||||
|
|
||||||
AudioFormat[] formatArray = new AudioFormat[formats.size()];
|
AudioFormat[] formatArray = new AudioFormat[formats.size()];
|
||||||
for (int i = 0; i < formatArray.length; i++) {
|
for (int i = 0; i < formatArray.length; i++) {
|
||||||
formatArray[i] = (AudioFormat)(formats.elementAt(i));
|
formatArray[i] = formats.elementAt(i);
|
||||||
}
|
}
|
||||||
return formatArray;
|
return formatArray;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public final class AudioSynthesizerPropertyInfo {
|
|||||||
* The <code>valueClass</code> field specifies class
|
* The <code>valueClass</code> field specifies class
|
||||||
* used in <code>value</code> field.
|
* used in <code>value</code> field.
|
||||||
*/
|
*/
|
||||||
public Class valueClass = null;
|
public Class<?> valueClass = null;
|
||||||
/**
|
/**
|
||||||
* An array of possible values if the value for the field
|
* An array of possible values if the value for the field
|
||||||
* <code>AudioSynthesizerPropertyInfo.value</code> may be selected
|
* <code>AudioSynthesizerPropertyInfo.value</code> may be selected
|
||||||
|
@ -94,7 +94,7 @@ final class DirectAudioDevice extends AbstractMixer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private DirectDLI createDataLineInfo(boolean isSource) {
|
private DirectDLI createDataLineInfo(boolean isSource) {
|
||||||
Vector formats = new Vector();
|
Vector<AudioFormat> formats = new Vector<>();
|
||||||
AudioFormat[] hardwareFormatArray = null;
|
AudioFormat[] hardwareFormatArray = null;
|
||||||
AudioFormat[] formatArray = null;
|
AudioFormat[] formatArray = null;
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ final class DirectAudioDevice extends AbstractMixer {
|
|||||||
int formatArraySize = size;
|
int formatArraySize = size;
|
||||||
hardwareFormatArray = new AudioFormat[size];
|
hardwareFormatArray = new AudioFormat[size];
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
AudioFormat format = (AudioFormat)formats.elementAt(i);
|
AudioFormat format = formats.elementAt(i);
|
||||||
hardwareFormatArray[i] = format;
|
hardwareFormatArray[i] = format;
|
||||||
int bits = format.getSampleSizeInBits();
|
int bits = format.getSampleSizeInBits();
|
||||||
boolean isSigned = format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED);
|
boolean isSigned = format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED);
|
||||||
@ -265,7 +265,7 @@ final class DirectAudioDevice extends AbstractMixer {
|
|||||||
return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getMaxSimulLines();
|
return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getMaxSimulLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate,
|
private static void addFormat(Vector<AudioFormat> v, int bits, int frameSizeInBytes, int channels, float sampleRate,
|
||||||
int encoding, boolean signed, boolean bigEndian) {
|
int encoding, boolean signed, boolean bigEndian) {
|
||||||
AudioFormat.Encoding enc = null;
|
AudioFormat.Encoding enc = null;
|
||||||
switch (encoding) {
|
switch (encoding) {
|
||||||
@ -338,7 +338,7 @@ final class DirectAudioDevice extends AbstractMixer {
|
|||||||
private static final class DirectDLI extends DataLine.Info {
|
private static final class DirectDLI extends DataLine.Info {
|
||||||
final AudioFormat[] hardwareFormats;
|
final AudioFormat[] hardwareFormats;
|
||||||
|
|
||||||
private DirectDLI(Class clazz, AudioFormat[] formatArray,
|
private DirectDLI(Class<?> clazz, AudioFormat[] formatArray,
|
||||||
AudioFormat[] hardwareFormatArray,
|
AudioFormat[] hardwareFormatArray,
|
||||||
int minBuffer, int maxBuffer) {
|
int minBuffer, int maxBuffer) {
|
||||||
super(clazz, formatArray, minBuffer, maxBuffer);
|
super(clazz, formatArray, minBuffer, maxBuffer);
|
||||||
@ -1457,7 +1457,7 @@ final class DirectAudioDevice extends AbstractMixer {
|
|||||||
|
|
||||||
} // class DirectBAOS
|
} // class DirectBAOS
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
private static native void nGetFormats(int mixerIndex, int deviceID,
|
private static native void nGetFormats(int mixerIndex, int deviceID,
|
||||||
boolean isSource, Vector formats);
|
boolean isSource, Vector formats);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ final class EventDispatcher implements Runnable {
|
|||||||
/**
|
/**
|
||||||
* List of events
|
* List of events
|
||||||
*/
|
*/
|
||||||
private final ArrayList eventQueue = new ArrayList();
|
private final ArrayList<EventInfo> eventQueue = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -186,7 +186,7 @@ final class EventDispatcher implements Runnable {
|
|||||||
}
|
}
|
||||||
if (eventQueue.size() > 0) {
|
if (eventQueue.size() > 0) {
|
||||||
// Remove the event from the queue and dispatch it to the listeners.
|
// Remove the event from the queue and dispatch it to the listeners.
|
||||||
eventInfo = (EventInfo) eventQueue.remove(0);
|
eventInfo = eventQueue.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of synchronized
|
} // end of synchronized
|
||||||
@ -230,7 +230,7 @@ final class EventDispatcher implements Runnable {
|
|||||||
/**
|
/**
|
||||||
* Send audio and MIDI events.
|
* Send audio and MIDI events.
|
||||||
*/
|
*/
|
||||||
void sendAudioEvents(Object event, List listeners) {
|
void sendAudioEvents(Object event, List<Object> listeners) {
|
||||||
if ((listeners == null)
|
if ((listeners == null)
|
||||||
|| (listeners.size() == 0)) {
|
|| (listeners.size() == 0)) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
@ -392,7 +392,7 @@ final class EventDispatcher implements Runnable {
|
|||||||
* @param event the event to be dispatched
|
* @param event the event to be dispatched
|
||||||
* @param listeners listener list; will be copied
|
* @param listeners listener list; will be copied
|
||||||
*/
|
*/
|
||||||
EventInfo(Object event, List listeners) {
|
EventInfo(Object event, List<Object> listeners) {
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.listeners = listeners.toArray();
|
this.listeners = listeners.toArray();
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public final class JDK13Services {
|
|||||||
(the part before the hash sign), if available. If the property is
|
(the part before the hash sign), if available. If the property is
|
||||||
not set or the value has no provider class name part, null is returned.
|
not set or the value has no provider class name part, null is returned.
|
||||||
*/
|
*/
|
||||||
public static synchronized String getDefaultProviderClassName(Class typeClass) {
|
public static synchronized String getDefaultProviderClassName(Class<?> typeClass) {
|
||||||
String value = null;
|
String value = null;
|
||||||
String defaultProviderSpec = getDefaultProvider(typeClass);
|
String defaultProviderSpec = getDefaultProvider(typeClass);
|
||||||
if (defaultProviderSpec != null) {
|
if (defaultProviderSpec != null) {
|
||||||
@ -144,7 +144,7 @@ public final class JDK13Services {
|
|||||||
part after the hash sign), if available. If the property is not set
|
part after the hash sign), if available. If the property is not set
|
||||||
or the value has no instance name part, null is returned.
|
or the value has no instance name part, null is returned.
|
||||||
*/
|
*/
|
||||||
public static synchronized String getDefaultInstanceName(Class typeClass) {
|
public static synchronized String getDefaultInstanceName(Class<?> typeClass) {
|
||||||
String value = null;
|
String value = null;
|
||||||
String defaultProviderSpec = getDefaultProvider(typeClass);
|
String defaultProviderSpec = getDefaultProvider(typeClass);
|
||||||
if (defaultProviderSpec != null) {
|
if (defaultProviderSpec != null) {
|
||||||
@ -165,7 +165,7 @@ public final class JDK13Services {
|
|||||||
@return The complete value of the property, if available.
|
@return The complete value of the property, if available.
|
||||||
If the property is not set, null is returned.
|
If the property is not set, null is returned.
|
||||||
*/
|
*/
|
||||||
private static synchronized String getDefaultProvider(Class typeClass) {
|
private static synchronized String getDefaultProvider(Class<?> typeClass) {
|
||||||
if (!SourceDataLine.class.equals(typeClass)
|
if (!SourceDataLine.class.equals(typeClass)
|
||||||
&& !TargetDataLine.class.equals(typeClass)
|
&& !TargetDataLine.class.equals(typeClass)
|
||||||
&& !Clip.class.equals(typeClass)
|
&& !Clip.class.equals(typeClass)
|
||||||
|
@ -106,9 +106,9 @@ public final class MidiInDeviceProvider extends AbstractMidiDeviceProvider {
|
|||||||
* the new instance will not reflect that state...
|
* the new instance will not reflect that state...
|
||||||
*/
|
*/
|
||||||
static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info {
|
static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info {
|
||||||
private final Class providerClass;
|
private final Class<?> providerClass;
|
||||||
|
|
||||||
private MidiInDeviceInfo(int index, Class providerClass) {
|
private MidiInDeviceInfo(int index, Class<?> providerClass) {
|
||||||
super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
|
super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
|
||||||
this.providerClass = providerClass;
|
this.providerClass = providerClass;
|
||||||
}
|
}
|
||||||
|
@ -104,9 +104,9 @@ public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider {
|
|||||||
* the new instance will not reflect that state...
|
* the new instance will not reflect that state...
|
||||||
*/
|
*/
|
||||||
static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info {
|
static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info {
|
||||||
private final Class providerClass;
|
private final Class<?> providerClass;
|
||||||
|
|
||||||
private MidiOutDeviceInfo(int index, Class providerClass) {
|
private MidiOutDeviceInfo(int index, Class<?> providerClass) {
|
||||||
super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
|
super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index);
|
||||||
this.providerClass = providerClass;
|
this.providerClass = providerClass;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ public final class MidiUtils {
|
|||||||
|
|
||||||
|
|
||||||
public synchronized void refresh(Sequence seq) {
|
public synchronized void refresh(Sequence seq) {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<MidiEvent> list = new ArrayList<>();
|
||||||
Track[] tracks = seq.getTracks();
|
Track[] tracks = seq.getTracks();
|
||||||
if (tracks.length > 0) {
|
if (tracks.length > 0) {
|
||||||
// tempo events only occur in track 0
|
// tempo events only occur in track 0
|
||||||
@ -313,7 +313,7 @@ public final class MidiUtils {
|
|||||||
int size = list.size() + 1;
|
int size = list.size() + 1;
|
||||||
firstTempoIsFake = true;
|
firstTempoIsFake = true;
|
||||||
if ((size > 1)
|
if ((size > 1)
|
||||||
&& (((MidiEvent) list.get(0)).getTick() == 0)) {
|
&& (list.get(0).getTick() == 0)) {
|
||||||
// do not need to add an initial tempo event at the beginning
|
// do not need to add an initial tempo event at the beginning
|
||||||
size--;
|
size--;
|
||||||
firstTempoIsFake = false;
|
firstTempoIsFake = false;
|
||||||
@ -328,7 +328,7 @@ public final class MidiUtils {
|
|||||||
e++;
|
e++;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < list.size(); i++, e++) {
|
for (int i = 0; i < list.size(); i++, e++) {
|
||||||
MidiEvent evt = (MidiEvent) list.get(i);
|
MidiEvent evt = list.get(i);
|
||||||
ticks[e] = evt.getTick();
|
ticks[e] = evt.getTick();
|
||||||
tempos[e] = getTempoMPQ(evt.getMessage());
|
tempos[e] = getTempoMPQ(evt.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public final class PCMtoPCMCodec extends SunCodec {
|
|||||||
// filter out targetEncoding from the old getOutputFormats( sourceFormat ) method
|
// filter out targetEncoding from the old getOutputFormats( sourceFormat ) method
|
||||||
|
|
||||||
AudioFormat[] formats = getOutputFormats( sourceFormat );
|
AudioFormat[] formats = getOutputFormats( sourceFormat );
|
||||||
Vector newFormats = new Vector();
|
Vector<AudioFormat> newFormats = new Vector<>();
|
||||||
for(int i=0; i<formats.length; i++ ) {
|
for(int i=0; i<formats.length; i++ ) {
|
||||||
if( formats[i].getEncoding().equals( targetEncoding ) ) {
|
if( formats[i].getEncoding().equals( targetEncoding ) ) {
|
||||||
newFormats.addElement( formats[i] );
|
newFormats.addElement( formats[i] );
|
||||||
@ -101,7 +101,7 @@ public final class PCMtoPCMCodec extends SunCodec {
|
|||||||
AudioFormat[] formatArray = new AudioFormat[newFormats.size()];
|
AudioFormat[] formatArray = new AudioFormat[newFormats.size()];
|
||||||
|
|
||||||
for (int i = 0; i < formatArray.length; i++) {
|
for (int i = 0; i < formatArray.length; i++) {
|
||||||
formatArray[i] = (AudioFormat)(newFormats.elementAt(i));
|
formatArray[i] = newFormats.elementAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return formatArray;
|
return formatArray;
|
||||||
@ -181,7 +181,7 @@ public final class PCMtoPCMCodec extends SunCodec {
|
|||||||
/* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
|
/* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
|
||||||
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
||||||
|
|
||||||
Vector formats = new Vector();
|
Vector<AudioFormat> formats = new Vector<>();
|
||||||
AudioFormat format;
|
AudioFormat format;
|
||||||
|
|
||||||
int sampleSize = inputFormat.getSampleSizeInBits();
|
int sampleSize = inputFormat.getSampleSizeInBits();
|
||||||
@ -335,7 +335,7 @@ public final class PCMtoPCMCodec extends SunCodec {
|
|||||||
|
|
||||||
for (int i = 0; i < formatArray.length; i++) {
|
for (int i = 0; i < formatArray.length; i++) {
|
||||||
|
|
||||||
formatArray[i] = (AudioFormat)(formats.elementAt(i));
|
formatArray[i] = formats.elementAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,12 +253,12 @@ final class PortMixer extends AbstractMixer {
|
|||||||
long newID = ((PortMixer) mixer).getID();
|
long newID = ((PortMixer) mixer).getID();
|
||||||
if ((id == 0) || (newID != id) || (controls.length == 0)) {
|
if ((id == 0) || (newID != id) || (controls.length == 0)) {
|
||||||
id = newID;
|
id = newID;
|
||||||
Vector vector = new Vector();
|
Vector<Control> vector = new Vector<>();
|
||||||
synchronized (vector) {
|
synchronized (vector) {
|
||||||
nGetControls(id, portIndex, vector);
|
nGetControls(id, portIndex, vector);
|
||||||
controls = new Control[vector.size()];
|
controls = new Control[vector.size()];
|
||||||
for (int i = 0; i < controls.length; i++) {
|
for (int i = 0; i < controls.length; i++) {
|
||||||
controls[i] = (Control) vector.elementAt(i);
|
controls[i] = vector.elementAt(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -494,6 +494,7 @@ final class PortMixer extends AbstractMixer {
|
|||||||
private static native String nGetPortName(long id, int portIndex);
|
private static native String nGetPortName(long id, int portIndex);
|
||||||
|
|
||||||
// fills the vector with the controls for this port
|
// fills the vector with the controls for this port
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
private static native void nGetControls(long id, int portIndex, Vector vector);
|
private static native void nGetControls(long id, int portIndex, Vector vector);
|
||||||
|
|
||||||
// getters/setters for controls
|
// getters/setters for controls
|
||||||
|
@ -122,7 +122,7 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
/**
|
/**
|
||||||
* List of tracks to which we're recording
|
* List of tracks to which we're recording
|
||||||
*/
|
*/
|
||||||
private final List recordingTracks = new ArrayList();
|
private final List<RecordingTrack> recordingTracks = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
private long loopStart = 0;
|
private long loopStart = 0;
|
||||||
@ -133,13 +133,13 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
/**
|
/**
|
||||||
* Meta event listeners
|
* Meta event listeners
|
||||||
*/
|
*/
|
||||||
private final ArrayList metaEventListeners = new ArrayList();
|
private final ArrayList<Object> metaEventListeners = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control change listeners
|
* Control change listeners
|
||||||
*/
|
*/
|
||||||
private final ArrayList controllerEventListeners = new ArrayList();
|
private final ArrayList<ControllerListElement> controllerEventListeners = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
/** automatic connection support */
|
/** automatic connection support */
|
||||||
@ -645,7 +645,7 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
for(int i=0; i < controllerEventListeners.size(); i++) {
|
for(int i=0; i < controllerEventListeners.size(); i++) {
|
||||||
|
|
||||||
cve = (ControllerListElement) controllerEventListeners.get(i);
|
cve = controllerEventListeners.get(i);
|
||||||
|
|
||||||
if (cve.listener.equals(listener)) {
|
if (cve.listener.equals(listener)) {
|
||||||
cve.addControllers(controllers);
|
cve.addControllers(controllers);
|
||||||
@ -669,7 +669,7 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
ControllerListElement cve = null;
|
ControllerListElement cve = null;
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
for (int i=0; i < controllerEventListeners.size(); i++) {
|
for (int i=0; i < controllerEventListeners.size(); i++) {
|
||||||
cve = (ControllerListElement) controllerEventListeners.get(i);
|
cve = controllerEventListeners.get(i);
|
||||||
if (cve.listener.equals(listener)) {
|
if (cve.listener.equals(listener)) {
|
||||||
cve.removeControllers(controllers);
|
cve.removeControllers(controllers);
|
||||||
flag = true;
|
flag = true;
|
||||||
@ -940,9 +940,9 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
}
|
}
|
||||||
ShortMessage msg = (ShortMessage) message;
|
ShortMessage msg = (ShortMessage) message;
|
||||||
int controller = msg.getData1();
|
int controller = msg.getData1();
|
||||||
List sendToListeners = new ArrayList();
|
List<Object> sendToListeners = new ArrayList<>();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
ControllerListElement cve = (ControllerListElement) controllerEventListeners.get(i);
|
ControllerListElement cve = controllerEventListeners.get(i);
|
||||||
for(int j = 0; j < cve.controllers.length; j++) {
|
for(int j = 0; j < cve.controllers.length; j++) {
|
||||||
if (cve.controllers[j] == controller) {
|
if (cve.controllers[j] == controller) {
|
||||||
sendToListeners.add(cve.listener);
|
sendToListeners.add(cve.listener);
|
||||||
@ -1213,13 +1213,13 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static RecordingTrack get(List recordingTracks, Track track) {
|
static RecordingTrack get(List<RecordingTrack> recordingTracks, Track track) {
|
||||||
|
|
||||||
synchronized(recordingTracks) {
|
synchronized(recordingTracks) {
|
||||||
int size = recordingTracks.size();
|
int size = recordingTracks.size();
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
RecordingTrack current = (RecordingTrack)recordingTracks.get(i);
|
RecordingTrack current = recordingTracks.get(i);
|
||||||
if (current.track == track) {
|
if (current.track == track) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
@ -1228,12 +1228,12 @@ final class RealTimeSequencer extends AbstractMidiDevice
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Track get(List recordingTracks, int channel) {
|
static Track get(List<RecordingTrack> recordingTracks, int channel) {
|
||||||
|
|
||||||
synchronized(recordingTracks) {
|
synchronized(recordingTracks) {
|
||||||
int size = recordingTracks.size();
|
int size = recordingTracks.size();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
RecordingTrack current = (RecordingTrack)recordingTracks.get(i);
|
RecordingTrack current = recordingTracks.get(i);
|
||||||
if ((current.channel == channel) || (current.channel == -1)) {
|
if ((current.channel == channel) || (current.channel == -1)) {
|
||||||
return current.track;
|
return current.track;
|
||||||
}
|
}
|
||||||
|
@ -949,7 +949,7 @@ public final class SoftSynthesizer implements AudioSynthesizer,
|
|||||||
Object v = (info == null) ? null : info.get(item2.name);
|
Object v = (info == null) ? null : info.get(item2.name);
|
||||||
v = (v != null) ? v : storedProperties.getProperty(item2.name);
|
v = (v != null) ? v : storedProperties.getProperty(item2.name);
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
Class c = (item2.valueClass);
|
Class<?> c = (item2.valueClass);
|
||||||
if (c.isInstance(v))
|
if (c.isInstance(v))
|
||||||
item2.value = v;
|
item2.value = v;
|
||||||
else if (v instanceof String) {
|
else if (v instanceof String) {
|
||||||
|
@ -198,7 +198,7 @@ public final class UlawCodec extends SunCodec {
|
|||||||
/* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
|
/* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */
|
||||||
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
private AudioFormat[] getOutputFormats(AudioFormat inputFormat) {
|
||||||
|
|
||||||
Vector formats = new Vector();
|
Vector<AudioFormat> formats = new Vector<>();
|
||||||
AudioFormat format;
|
AudioFormat format;
|
||||||
|
|
||||||
if ((inputFormat.getSampleSizeInBits() == 16)
|
if ((inputFormat.getSampleSizeInBits() == 16)
|
||||||
@ -235,7 +235,7 @@ public final class UlawCodec extends SunCodec {
|
|||||||
|
|
||||||
AudioFormat[] formatArray = new AudioFormat[formats.size()];
|
AudioFormat[] formatArray = new AudioFormat[formats.size()];
|
||||||
for (int i = 0; i < formatArray.length; i++) {
|
for (int i = 0; i < formatArray.length; i++) {
|
||||||
formatArray[i] = (AudioFormat)(formats.elementAt(i));
|
formatArray[i] = formats.elementAt(i);
|
||||||
}
|
}
|
||||||
return formatArray;
|
return formatArray;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user