< prev index next >
src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java
Print this page
*** 636,646 ****
actions.add(new PrivilegedAction<InputStream>() {
public InputStream run() {
File javahome = new File(System.getProperties()
.getProperty("java.home"));
File libaudio = new File(new File(javahome, "lib"), "audio");
! if (libaudio.exists()) {
File foundfile = null;
File[] files = libaudio.listFiles();
if (files != null) {
for (int i = 0; i < files.length; i++) {
File file = files[i];
--- 636,646 ----
actions.add(new PrivilegedAction<InputStream>() {
public InputStream run() {
File javahome = new File(System.getProperties()
.getProperty("java.home"));
File libaudio = new File(new File(javahome, "lib"), "audio");
! if (libaudio.isDirectory()) {
File foundfile = null;
File[] files = libaudio.listFiles();
if (files != null) {
for (int i = 0; i < files.length; i++) {
File file = files[i];
*** 684,696 ****
/*
* Look for a default.sf2
*/
for (File systemSoundFontDir : systemSoundFontsDir) {
! if (systemSoundFontDir.exists()) {
File defaultSoundFont = new File(systemSoundFontDir, "default.sf2");
! if (defaultSoundFont.exists()) {
try {
return new FileInputStream(defaultSoundFont);
} catch (IOException e) {
// continue with lookup
}
--- 684,696 ----
/*
* Look for a default.sf2
*/
for (File systemSoundFontDir : systemSoundFontsDir) {
! if (systemSoundFontDir.isDirectory()) {
File defaultSoundFont = new File(systemSoundFontDir, "default.sf2");
! if (defaultSoundFont.isFile()) {
try {
return new FileInputStream(defaultSoundFont);
} catch (IOException e) {
// continue with lookup
}
*** 706,716 ****
public InputStream run() {
if (System.getProperties().getProperty("os.name")
.startsWith("Windows")) {
File gm_dls = new File(System.getenv("SystemRoot")
+ "\\system32\\drivers\\gm.dls");
! if (gm_dls.exists()) {
try {
return new FileInputStream(gm_dls);
} catch (IOException e) {
}
}
--- 706,716 ----
public InputStream run() {
if (System.getProperties().getProperty("os.name")
.startsWith("Windows")) {
File gm_dls = new File(System.getenv("SystemRoot")
+ "\\system32\\drivers\\gm.dls");
! if (gm_dls.isFile()) {
try {
return new FileInputStream(gm_dls);
} catch (IOException e) {
}
}
*** 726,736 ****
*/
File userhome = new File(System.getProperty("user.home"),
".gervill");
File emg_soundbank_file = new File(userhome,
"soundbank-emg.sf2");
! if (emg_soundbank_file.exists()) {
try {
return new FileInputStream(emg_soundbank_file);
} catch (IOException e) {
}
}
--- 726,736 ----
*/
File userhome = new File(System.getProperty("user.home"),
".gervill");
File emg_soundbank_file = new File(userhome,
"soundbank-emg.sf2");
! if (emg_soundbank_file.isFile()) {
try {
return new FileInputStream(emg_soundbank_file);
} catch (IOException e) {
}
}
*** 771,786 ****
OutputStream out = AccessController
.doPrivileged((PrivilegedAction<OutputStream>) () -> {
try {
File userhome = new File(System
.getProperty("user.home"), ".gervill");
! if (!userhome.exists()) {
! userhome.mkdirs();
}
File emg_soundbank_file = new File(
userhome, "soundbank-emg.sf2");
! if (emg_soundbank_file.exists()) {
return null;
}
return new FileOutputStream(emg_soundbank_file);
} catch (final FileNotFoundException ignored) {
}
--- 771,788 ----
OutputStream out = AccessController
.doPrivileged((PrivilegedAction<OutputStream>) () -> {
try {
File userhome = new File(System
.getProperty("user.home"), ".gervill");
! if (!userhome.isDirectory()) {
! if (!userhome.mkdirs()) {
! return null;
! }
}
File emg_soundbank_file = new File(
userhome, "soundbank-emg.sf2");
! if (emg_soundbank_file.isFile()) {
return null;
}
return new FileOutputStream(emg_soundbank_file);
} catch (final FileNotFoundException ignored) {
}
< prev index next >