Changeset 7310 in josm
- Timestamp:
- 2014-07-15T15:30:05+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r7005 r7310 71 71 public GpxLayer fromLayer = null; 72 72 private Marker currentMarker; 73 public AudioMarker syncAudioMarker = null; 73 74 74 75 public MarkerLayer(GpxData indata, String name, File associatedFile, GpxLayer fromLayer) { … … 258 259 } 259 260 260 public boolean synchronizeAudioMarkers(AudioMarker startMarker) { 261 if (startMarker != null && ! data.contains(startMarker)) { 262 startMarker = null; 263 } 264 if (startMarker == null) { 261 public boolean synchronizeAudioMarkers(final AudioMarker startMarker) { 262 syncAudioMarker = startMarker; 263 if (syncAudioMarker != null && ! data.contains(syncAudioMarker)) { 264 syncAudioMarker = null; 265 } 266 if (syncAudioMarker == null) { 265 267 // find the first audioMarker in this layer 266 268 for (Marker m : data) { 267 269 if (m instanceof AudioMarker) { 268 s tartMarker = (AudioMarker) m;270 syncAudioMarker = (AudioMarker) m; 269 271 break; 270 272 } 271 273 } 272 274 } 273 if (s tartMarker == null)275 if (syncAudioMarker == null) 274 276 return false; 275 277 276 278 // apply adjustment to all subsequent audio markers in the layer 277 double adjustment = AudioPlayer.position() - s tartMarker.offset; // in seconds279 double adjustment = AudioPlayer.position() - syncAudioMarker.offset; // in seconds 278 280 boolean seenStart = false; 279 281 try { 280 URI uri = s tartMarker.url().toURI();282 URI uri = syncAudioMarker.url().toURI(); 281 283 for (Marker m : data) { 282 if (m == s tartMarker) {284 if (m == syncAudioMarker) { 283 285 seenStart = true; 284 286 } … … 516 518 JOptionPane.showMessageDialog( 517 519 Main.parent, 518 tr("Audio synchronized at point {0}.", recent.getText()),520 tr("Audio synchronized at point {0}.", syncAudioMarker.getText()), 519 521 tr("Information"), 520 522 JOptionPane.INFORMATION_MESSAGE -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
r7094 r7310 247 247 JOptionPane.showMessageDialog( 248 248 Main.parent, 249 tr("Audio synchronized at point {0}.", ca.getText()),249 tr("Audio synchronized at point {0}.", recent.parentLayer.syncAudioMarker.getText()), 250 250 tr("Information"), 251 251 JOptionPane.INFORMATION_MESSAGE 252 252 ); 253 setCoor( ca.getCoor());253 setCoor(recent.parentLayer.syncAudioMarker.getCoor()); 254 254 endDrag(false); 255 255 } else {
Note: See TracChangeset
for help on using the changeset viewer.