equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Sun designates this |
7 * published by the Free Software Foundation. Sun designates this |
38 |
38 |
39 import javax.sound.midi.spi.MidiFileReader; |
39 import javax.sound.midi.spi.MidiFileReader; |
40 import javax.sound.midi.spi.MidiFileWriter; |
40 import javax.sound.midi.spi.MidiFileWriter; |
41 import javax.sound.midi.spi.SoundbankReader; |
41 import javax.sound.midi.spi.SoundbankReader; |
42 import javax.sound.midi.spi.MidiDeviceProvider; |
42 import javax.sound.midi.spi.MidiDeviceProvider; |
|
43 |
|
44 import javax.sound.midi.Receiver; |
|
45 import javax.sound.midi.Sequencer; |
|
46 import javax.sound.midi.Synthesizer; |
|
47 import javax.sound.midi.Transmitter; |
|
48 import javax.sound.sampled.Clip; |
|
49 import javax.sound.sampled.Port; |
|
50 import javax.sound.sampled.SourceDataLine; |
|
51 import javax.sound.sampled.TargetDataLine; |
43 |
52 |
44 |
53 |
45 /** |
54 /** |
46 * JDK13Services uses the Service class in JDK 1.3 |
55 * JDK13Services uses the Service class in JDK 1.3 |
47 * to discover a list of service providers installed |
56 * to discover a list of service providers installed |
184 Clip.class or Port.class. |
193 Clip.class or Port.class. |
185 @return The complete value of the property, if available. |
194 @return The complete value of the property, if available. |
186 If the property is not set, null is returned. |
195 If the property is not set, null is returned. |
187 */ |
196 */ |
188 private static synchronized String getDefaultProvider(Class typeClass) { |
197 private static synchronized String getDefaultProvider(Class typeClass) { |
|
198 if (!SourceDataLine.class.equals(typeClass) |
|
199 && !TargetDataLine.class.equals(typeClass) |
|
200 && !Clip.class.equals(typeClass) |
|
201 && !Port.class.equals(typeClass) |
|
202 && !Receiver.class.equals(typeClass) |
|
203 && !Transmitter.class.equals(typeClass) |
|
204 && !Synthesizer.class.equals(typeClass) |
|
205 && !Sequencer.class.equals(typeClass)) { |
|
206 return null; |
|
207 } |
189 String value; |
208 String value; |
190 String propertyName = typeClass.getName(); |
209 String propertyName = typeClass.getName(); |
191 value = JSSecurityManager.getProperty(propertyName); |
210 value = JSSecurityManager.getProperty(propertyName); |
192 if (value == null) { |
211 if (value == null) { |
193 value = getProperties().getProperty(propertyName); |
212 value = getProperties().getProperty(propertyName); |