Class AudioMarker
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.markerlayer.Marker
-
- org.openstreetmap.josm.gui.layer.markerlayer.ButtonMarker
-
- org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker
-
- All Implemented Interfaces:
ILatLon,IQuadBucketType,Destroyable,TemplateEngineDataProvider
public class AudioMarker extends ButtonMarker
Marker class with audio playback capability.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URLaudioUrlprivate static AudioMarkerrecentlyPlayedMarkerdoublesyncOffsetbooleantimeFromAudio-
Fields inherited from class org.openstreetmap.josm.gui.layer.markerlayer.Marker
LABEL_PATTERN_AUTO, LABEL_PATTERN_DESC, LABEL_PATTERN_NAME, MARKER_FORMATTED_OFFSET, MARKER_OFFSET, offset, parentLayer, symbol, time
-
Fields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION
-
-
Constructor Summary
Constructors Constructor Description AudioMarker(LatLon ll, TemplateEngineDataProvider dataProvider, java.net.URL audioUrl, MarkerLayer parentLayer, double time, double offset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ev)Called when the mouse is clicked in the marker's hotspot.voidadjustOffset(double adjustment)WayPointconvertToWayPoint()Convert Marker to WayPoint so it can be exported to a GPX file.protected java.lang.StringgetTextTemplateKey()voidplay()Starts playing the audio associated with the marker: used in response to pressing the marker as well as indirectlyvoidplay(double after)Starts playing the audio associated with the marker offset by the given amountstatic AudioMarkerrecentlyPlayedMarker()Returns the marker played the most recently, if any.(package private) static voidresetRecentlyPlayedMarker()Forgets the marker played the most recently, if any.doublesyncOffset()java.net.URLurl()-
Methods inherited from class org.openstreetmap.josm.gui.layer.markerlayer.ButtonMarker
containsPoint, paint
-
Methods inherited from class org.openstreetmap.josm.gui.layer.markerlayer.Marker
appendMarkerProducer, createMarkers, destroy, evaluateCondition, getBBox, getCoor, getTemplateKeys, getTemplateValue, getText, isErroneous, lat, lon, paintIcon, prependMarkerProducer, setCoor, setEastNorth, setErroneous, updateText
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, getEastNorth, greatCircleDistance, interpolate, isLatLonKnown
-
-
-
-
Field Detail
-
audioUrl
private final java.net.URL audioUrl
-
recentlyPlayedMarker
private static volatile AudioMarker recentlyPlayedMarker
-
syncOffset
public double syncOffset
-
timeFromAudio
public boolean timeFromAudio
-
-
Constructor Detail
-
AudioMarker
public AudioMarker(LatLon ll, TemplateEngineDataProvider dataProvider, java.net.URL audioUrl, MarkerLayer parentLayer, double time, double offset)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
Description copied from class:MarkerCalled when the mouse is clicked in the marker's hotspot. Never called for markers which always return false from containsPoint.- Overrides:
actionPerformedin classMarker- Parameters:
ev- A dummy ActionEvent
-
recentlyPlayedMarker
public static AudioMarker recentlyPlayedMarker()
Returns the marker played the most recently, if any.- Returns:
- the marker played the most recently, or
null
-
resetRecentlyPlayedMarker
static void resetRecentlyPlayedMarker()
Forgets the marker played the most recently, if any.
-
url
public java.net.URL url()
-
play
public void play(double after)
Starts playing the audio associated with the marker offset by the given amount- Parameters:
after- : seconds after marker where playing should start
-
play
public void play()
Starts playing the audio associated with the marker: used in response to pressing the marker as well as indirectly
-
adjustOffset
public void adjustOffset(double adjustment)
-
syncOffset
public double syncOffset()
-
getTextTemplateKey
protected java.lang.String getTextTemplateKey()
- Overrides:
getTextTemplateKeyin classMarker
-
convertToWayPoint
public WayPoint convertToWayPoint()
Description copied from class:MarkerConvert Marker to WayPoint so it can be exported to a GPX file. Override in subclasses to add all necessary attributes.- Overrides:
convertToWayPointin classMarker- Returns:
- the corresponding WayPoint with all relevant attributes
-
-