Class ImportAudioAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class ImportAudioAction
    extends javax.swing.AbstractAction
    Import audio files into a GPX layer to enable audio playback functions.
    Since:
    5715
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private GpxLayer layer  
      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Constructor Summary

      Constructors 
      Constructor Description
      ImportAudioAction​(GpxLayer layer)
      Constructs a new ImportAudioAction.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      private void importAudio​(java.io.File audioFile, MarkerLayer ml, double firstStartTime, ImportAudioAction.Markers markers)
      Makes a new marker layer derived from this GpxLayer containing at least one audio marker which the given audio file is associated with.
      private static void warnCantImportIntoServerLayer​(GpxLayer layer)  
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Constructor Detail

      • ImportAudioAction

        public ImportAudioAction​(GpxLayer layer)
        Constructs a new ImportAudioAction.
        Parameters:
        layer - The associated GPX layer
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
      • importAudio

        private void importAudio​(java.io.File audioFile,
                                 MarkerLayer ml,
                                 double firstStartTime,
                                 ImportAudioAction.Markers markers)
        Makes a new marker layer derived from this GpxLayer containing at least one audio marker which the given audio file is associated with. Markers are derived from the following (a) explicit waypoints in the GPX layer, or (b) named trackpoints in the GPX layer, or (d) timestamp on the audio file (e) (in future) voice recognised markers in the sound recording (f) a single marker at the beginning of the track
        Parameters:
        audioFile - the file to be associated with the markers in the new marker layer
        ml - marker layer
        firstStartTime - first start time in milliseconds, used for (d)
        markers - keeps track of warning messages to avoid repeated warnings