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.URL
audioUrl
private static AudioMarker
recentlyPlayedMarker
double
syncOffset
boolean
timeFromAudio
-
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 void
actionPerformed(java.awt.event.ActionEvent ev)
Called when the mouse is clicked in the marker's hotspot.void
adjustOffset(double adjustment)
WayPoint
convertToWayPoint()
Convert Marker to WayPoint so it can be exported to a GPX file.protected java.lang.String
getTextTemplateKey()
void
play()
Starts playing the audio associated with the marker: used in response to pressing the marker as well as indirectlyvoid
play(double after)
Starts playing the audio associated with the marker offset by the given amountstatic AudioMarker
recentlyPlayedMarker()
Returns the marker played the most recently, if any.(package private) static void
resetRecentlyPlayedMarker()
Forgets the marker played the most recently, if any.double
syncOffset()
java.net.URL
url()
-
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:Marker
Called when the mouse is clicked in the marker's hotspot. Never called for markers which always return false from containsPoint.- Overrides:
actionPerformed
in 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:
getTextTemplateKey
in classMarker
-
convertToWayPoint
public WayPoint convertToWayPoint()
Description copied from class:Marker
Convert Marker to WayPoint so it can be exported to a GPX file. Override in subclasses to add all necessary attributes.- Overrides:
convertToWayPoint
in classMarker
- Returns:
- the corresponding WayPoint with all relevant attributes
-
-