- Timestamp:
- 2017-09-03T21:49:05+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java
r12620 r12715 237 237 double calibration = Main.pref.getDouble("audio.calibration", 1.0 /* default, ratio */); 238 238 try { 239 soundPlayer = new JavaFxMediaPlayer(); 240 } catch (NoClassDefFoundError | InterruptedException e) { 239 soundPlayer = (SoundPlayer) Class.forName("org.openstreetmap.josm.io.audio.JavaFxMediaPlayer").getConstructor().newInstance(); 240 } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) { 241 Logging.debug(e); 242 Logging.warn("JOSM compiled without Java FX support. Falling back to Java Sound API"); 243 } catch (NoClassDefFoundError | JosmRuntimeException e) { 241 244 Logging.debug(e); 242 245 Logging.warn("Java FX is unavailable. Falling back to Java Sound API"); 246 } 247 if (soundPlayer == null) { 243 248 soundPlayer = new JavaSoundPlayer(leadIn, calibration); 244 249 } -
trunk/src/org/openstreetmap/josm/io/audio/JavaFxMediaPlayer.java
r12462 r12715 11 11 import org.openstreetmap.josm.io.audio.AudioPlayer.Execute; 12 12 import org.openstreetmap.josm.io.audio.AudioPlayer.State; 13 import org.openstreetmap.josm.tools.JosmRuntimeException; 13 14 import org.openstreetmap.josm.tools.ListenerList; 14 15 … … 37 38 private MediaPlayer mediaPlayer; 38 39 39 JavaFxMediaPlayer() throws InterruptedException { 40 initFxPlatform(); 40 JavaFxMediaPlayer() throws JosmRuntimeException { 41 try { 42 initFxPlatform(); 43 } catch (InterruptedException e) { 44 throw new JosmRuntimeException(e); 45 } 41 46 } 42 47
Note:
See TracChangeset
for help on using the changeset viewer.