Changeset 13819 in josm for trunk/src/org


Ignore:
Timestamp:
2018-05-22T22:38:21+02:00 (7 years ago)
Author:
Don-vip
Message:

see #2089, see #16047 - move JavaFX classes to their own package in order to exclude them automatically when JavaFX is not on the classpath (needed for Java 11+ now that FX is gone)

Location:
trunk/src/org/openstreetmap/josm/io/audio
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/audio/AudioListener.java

    r12328 r13819  
    88 * @since 12328
    99 */
    10 interface AudioListener {
     10public interface AudioListener {
    1111
    1212    /**
  • trunk/src/org/openstreetmap/josm/io/audio/AudioPlayer.java

    r13418 r13819  
    2020    private static volatile AudioPlayer audioPlayer;
    2121
    22     enum State { INITIALIZING, NOTPLAYING, PLAYING, PAUSED, INTERRUPTED }
    23 
    24     enum Command { PLAY, PAUSE }
    25 
    26     enum Result { WAITING, OK, FAILED }
     22    /**
     23     * Audio player state.
     24     */
     25    public enum State {
     26        /** Initializing */
     27        INITIALIZING,
     28        /** Not playing */
     29        NOTPLAYING,
     30        /** Playing */
     31        PLAYING,
     32        /** Paused */
     33        PAUSED,
     34        /** Interrupted */
     35        INTERRUPTED
     36    }
     37
     38    /**
     39     * Audio player command.
     40     */
     41    public enum Command { /** Audio play */ PLAY, /** Audio pause */ PAUSE }
     42
     43    /**
     44     * Audio player result.
     45     */
     46    public enum Result { /** In progress */ WAITING, /** Success */ OK, /** Failure */ FAILED }
    2747
    2848    private State state;
     
    3353     * Passes information from the control thread to the playing thread
    3454     */
    35     class Execute {
     55    public class Execute {
    3656        private Command command;
    3757        private Result result;
     
    84104        }
    85105
    86         protected double offset() {
     106        /**
     107         * Returns the offset.
     108         * @return the offset, in seconds
     109         */
     110        public double offset() {
    87111            return offset;
    88112        }
    89113
    90         protected double speed() {
     114        /**
     115         * Returns the speed.
     116         * @return the speed (ratio)
     117         */
     118        public double speed() {
    91119            return speed;
    92120        }
    93121
    94         protected URL url() {
     122        /**
     123         * Returns the URL.
     124         * @return The resource to play, which must be a WAV file or stream
     125         */
     126        public URL url() {
    95127            return url;
    96128        }
    97129
    98         protected Command command() {
     130        /**
     131         * Returns the command.
     132         * @return the command
     133         */
     134        public Command command() {
    99135            return command;
    100136        }
     
    237273        double calibration = Config.getPref().getDouble("audio.calibration", 1.0 /* default, ratio */);
    238274        try {
    239             soundPlayer = (SoundPlayer) Class.forName("org.openstreetmap.josm.io.audio.JavaFxMediaPlayer")
     275            soundPlayer = (SoundPlayer) Class.forName("org.openstreetmap.josm.io.audio.fx.JavaFxMediaPlayer")
    240276                    .getDeclaredConstructor().newInstance();
    241277        } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) {
  • trunk/src/org/openstreetmap/josm/io/audio/SoundPlayer.java

    r12328 r13819  
    1212 * @since 12328
    1313 */
    14 interface SoundPlayer {
     14public interface SoundPlayer {
    1515
    1616    /**
  • trunk/src/org/openstreetmap/josm/io/audio/fx/JavaFxMediaPlayer.java

    r13818 r13819  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.io.audio;
     2package org.openstreetmap.josm.io.audio.fx;
    33
    44import java.io.File;
     
    99import java.util.concurrent.CountDownLatch;
    1010
     11import org.openstreetmap.josm.io.audio.AudioException;
     12import org.openstreetmap.josm.io.audio.AudioListener;
    1113import org.openstreetmap.josm.io.audio.AudioPlayer.Execute;
    1214import org.openstreetmap.josm.io.audio.AudioPlayer.State;
     15import org.openstreetmap.josm.io.audio.SoundPlayer;
    1316import org.openstreetmap.josm.tools.JosmRuntimeException;
    1417import org.openstreetmap.josm.tools.ListenerList;
     
    3235 * @since 12328
    3336 */
    34 class JavaFxMediaPlayer implements SoundPlayer {
     37public class JavaFxMediaPlayer implements SoundPlayer {
    3538
    3639    private final ListenerList<AudioListener> listeners = ListenerList.create();
Note: See TracChangeset for help on using the changeset viewer.