Class PlayHeadMarker
java.lang.Object
org.openstreetmap.josm.gui.layer.markerlayer.Marker
org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker
- All Implemented Interfaces:
ILatLon,IQuadBucketType,Destroyable,TemplateEngineDataProvider
Singleton marker class to track position of audio.
- Since:
- 572
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate intprivate final booleanprivate booleanprivate LatLonprivate MapModeprivate static PlayHeadMarkerprivate Timerprivate booleanFields 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, timeFields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidanimate()Animates the marker along the track.booleanChecks whether the marker display area contains the given point.static PlayHeadMarkercreate()Returns the unique instance ofPlayHeadMarker.voidapply the new position resulting from a drag in progressprivate voidendDrag(boolean reset) reinstate the old map mode after switching temporarily to do a play head dragvoidPaint the marker icon in the given graphics context.voidreposition(EastNorth en) reposition the play head at the point on the track nearest position given, providing we are within reasonable distance from the track; otherwise reset to the original position.voidcalled back from drag mode to say when we started dragging for real (at least a short distance)voidsynchronize(EastNorth en) Synchronize the audio at the position where the play head was paused before dragging with the position on the track where it was dropped.voidcallback for moving play head marker according to audio player positionMethods inherited from class org.openstreetmap.josm.gui.layer.markerlayer.Marker
actionPerformed, appendMarkerProducer, convertToWayPoint, createMarkers, destroy, evaluateCondition, getBBox, getCoor, getTemplateKeys, getTemplateValue, getText, getTextTemplateKey, isErroneous, lat, lon, paint, paintIcon, prependMarkerProducer, setCoor, setEastNorth, setErroneous, updateTextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, getEastNorth, greatCircleDistance, interpolate, isLatLonKnown
-
Field Details
-
timer
-
animationInterval
-
playHead
-
oldMode
-
oldCoor
-
enabled
-
wasPlaying
-
dropTolerance
-
jumpToMarker
-
-
Constructor Details
-
PlayHeadMarker
private PlayHeadMarker()
-
-
Method Details
-
create
Returns the unique instance ofPlayHeadMarker.- Returns:
- The unique instance of
PlayHeadMarker.
-
containsPoint
Description copied from class:MarkerChecks whether the marker display area contains the given point. Markers not interested in mouse clicks may always return false.- Overrides:
containsPointin classMarker- Parameters:
p- The point to check- Returns:
trueif the marker "hotspot" contains the point.
-
startDrag
called back from drag mode to say when we started dragging for real (at least a short distance) -
endDrag
reinstate the old map mode after switching temporarily to do a play head drag- Parameters:
reset- whether to reset state (pause audio and restore old coordinates)
-
drag
apply the new position resulting from a drag in progress- Parameters:
en- the new position in map terms
-
reposition
reposition the play head at the point on the track nearest position given, providing we are within reasonable distance from the track; otherwise reset to the original position.- Parameters:
en- the position to start looking from
-
synchronize
Synchronize the audio at the position where the play head was paused before dragging with the position on the track where it was dropped. If this is quite near an audio marker, we use that marker as the sync. location, otherwise we create a new marker at the trackpoint nearest the end point of the drag point to apply the sync to.- Parameters:
en- : the EastNorth end point of the drag
-
paint
Paint the marker icon in the given graphics context.- Parameters:
g- The graphics contextmv- The map
-
animate
Animates the marker along the track. -
timerAction
callback for moving play head marker according to audio player position
-