changeset in /hg/icedtea6: Fix some Gervill nits (correct Soundb...
Mark Wielaard
mark at klomp.org
Thu May 1 01:58:12 PDT 2008
changeset 57bbbc3db355 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=57bbbc3db355
description:
Fix some Gervill nits (correct Soundbank, IOExceptions on URL, wrong name).
2008-05-01 Mark Wielaard <mwielaard at redhat.com>
* overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
DLSSoundbankReader.java (getSoundbank(URL)): Don't throw IOException.
(getSoundbank(File)): Allow soundbanks not ending in .dls.
* overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
PATSoundbankReader.java (getSoundbank(URL)): Don't throw IOException.
* overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
SF2SoundbankReader.java (getSoundbank(URL)): Likewise.
(getSoundbank(File)): Allow soundbanks not ending in .sf2.
* overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
SoftSynthesizer.java (unloadAllInstruments): Check if Soundbank
supported.
(unloadInstruments): Likewise.
diffstat:
5 files changed, 31 insertions(+), 2 deletions(-)
ChangeLog | 15 ++++++++++
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java | 5 ++-
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/PATSoundbankReader.java | 2 +
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java | 5 ++-
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java | 6 ++++
diffs (101 lines):
diff -r 7b560b84e143 -r 57bbbc3db355 ChangeLog
--- a/ChangeLog Wed Apr 30 17:08:19 2008 -0400
+++ b/ChangeLog Thu May 01 10:57:58 2008 +0200
@@ -1,3 +1,18 @@ 2008-04-30 Thomas Fitzsimmons <fitzsim
+2008-05-01 Mark Wielaard <mwielaard at redhat.com>
+
+ * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
+ DLSSoundbankReader.java (getSoundbank(URL)): Don't throw IOException.
+ (getSoundbank(File)): Allow soundbanks not ending in .dls.
+ * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
+ PATSoundbankReader.java (getSoundbank(URL)): Don't throw IOException.
+ * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
+ SF2SoundbankReader.java (getSoundbank(URL)): Likewise.
+ (getSoundbank(File)): Allow soundbanks not ending in .sf2.
+ * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/
+ SoftSynthesizer.java (unloadAllInstruments): Check if Soundbank
+ supported.
+ (unloadInstruments): Likewise.
+
2008-04-30 Thomas Fitzsimmons <fitzsim at redhat.com>
* rt/net/sourceforge/jnlp/security/MoreInfoPane.java: Fix typo.
diff -r 7b560b84e143 -r 57bbbc3db355 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java Wed Apr 30 17:08:19 2008 -0400
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java Thu May 01 10:57:58 2008 +0200
@@ -52,6 +52,10 @@ public class DLSSoundbankReader extends
{
return null;
}
+ catch(IOException ioe)
+ {
+ return null;
+ }
}
public Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException {
@@ -68,7 +72,6 @@ public class DLSSoundbankReader extends
}
public Soundbank getSoundbank(File file) throws InvalidMidiDataException, IOException {
- if(!file.getPath().toLowerCase().endsWith(".dls")) return null;
try
{
return new DLSSoundbank(file);
diff -r 7b560b84e143 -r 57bbbc3db355 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/PATSoundbankReader.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/PATSoundbankReader.java Wed Apr 30 17:08:19 2008 -0400
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/PATSoundbankReader.java Thu May 01 10:57:58 2008 +0200
@@ -59,6 +59,8 @@ public class PATSoundbankReader extends
snk.addInstrument(ins);
return snk;
} catch (InvalidFormatException e) {
+ return null;
+ } catch (IOException ioe) {
return null;
}
}
diff -r 7b560b84e143 -r 57bbbc3db355 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java Wed Apr 30 17:08:19 2008 -0400
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java Thu May 01 10:57:58 2008 +0200
@@ -55,6 +55,10 @@ public class SF2SoundbankReader extends
{
return null;
}
+ catch(IOException ioe)
+ {
+ return null;
+ }
}
public Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException {
@@ -71,7 +75,6 @@ public class SF2SoundbankReader extends
}
public Soundbank getSoundbank(File file) throws InvalidMidiDataException, IOException {
- if(!file.getPath().toLowerCase().endsWith(".sf2")) return null;
try
{
return new SF2Soundbank(file);
diff -r 7b560b84e143 -r 57bbbc3db355 overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java Wed Apr 30 17:08:19 2008 -0400
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java Thu May 01 10:57:58 2008 +0200
@@ -593,6 +593,9 @@ public class SoftSynthesizer implements
}
public void unloadAllInstruments(Soundbank soundbank) {
+
+ if(soundbank == null || !isSoundbankSupported(soundbank))
+ throw new IllegalArgumentException("Unsupported soundbank: " + soundbank);
if(!isOpen())
return;
@@ -619,6 +622,9 @@ public class SoftSynthesizer implements
public void unloadInstruments(Soundbank soundbank, Patch[] patchList) {
+ if(soundbank == null || !isSoundbankSupported(soundbank))
+ throw new IllegalArgumentException("Unsupported soundbank: " + soundbank);
+
if(!isOpen())
return;
More information about the distro-pkg-dev
mailing list