- Timestamp:
- 2008-03-02T16:10:33+01:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OpenAction.java
r553 r572 91 91 GpxLayer gpxLayer = new GpxLayer(r.data, fn); 92 92 Main.main.addLayer(gpxLayer); 93 MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), file, gpxLayer); 94 if (ml.data.size() > 0) { 95 Main.main.addLayer(ml); 96 } 93 if (Main.pref.getBoolean("marker.makeautomarkers", true)) { 94 MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), file, gpxLayer); 95 if (ml.data.size() > 0) { 96 Main.main.addLayer(ml); 97 } 98 } 97 99 98 100 } else { -
trunk/src/org/openstreetmap/josm/actions/audio/AudioBackAction.java
r560 r572 26 26 amount = 10.0; 27 27 } 28 this.putValue("help", "Action/Back"); 28 29 } 29 30 -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r553 r572 36 36 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 37 37 import org.openstreetmap.josm.gui.layer.OsmDataLayer.ModifiedChangedListener; 38 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 39 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 38 40 39 41 /** … … 67 69 private ArrayList<Layer> layers = new ArrayList<Layer>(); 68 70 /** 71 * The play head marker: there is only one of these so it isn't in any specific layer 72 */ 73 public PlayHeadMarker playHeadMarker = null; 74 /** 69 75 * Direct link to the edit layer (if any) in the layers list. 70 76 */ … … 132 138 }); 133 139 } 134 140 if (layer instanceof MarkerLayer && playHeadMarker == null) 141 playHeadMarker = PlayHeadMarker.create(); 142 135 143 layers.add(layers.size(), layer); 136 144 … … 211 219 if (x1 > 0 || y1 > 0 || x2 < getWidth() || y2 < getHeight()) 212 220 g.drawRect(x1, y1, x2-x1+1, y2-y1+1); 221 222 if (playHeadMarker != null) 223 playHeadMarker.paint(g, this); 224 213 225 super.paint(g); 214 226 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r567 r572 24 24 import java.net.URLConnection; 25 25 import java.net.UnknownHostException; 26 import java.util.Iterator; 26 27 27 28 import javax.swing.AbstractAction; … … 160 161 }); 161 162 162 JMenuItem applyAudio = new JMenuItem(tr("Make Sampled Audio Layer"), ImageProvider.get("applyaudio"));163 applyAudio.putClientProperty("help", "Action/MakeSampledAudioLayer");164 applyAudio.addActionListener(new ActionListener() {163 JMenuItem importAudio = new JMenuItem(tr("Import Audio"), ImageProvider.get("importaudio")); 164 importAudio.putClientProperty("help", "ImportAudio"); 165 importAudio.addActionListener(new ActionListener() { 165 166 public void actionPerformed(ActionEvent e) { 166 167 String dir = Main.pref.get("markers.lastaudiodirectory"); … … 182 183 if (sel == null) 183 184 return; 184 applyAudio(sel);185 importAudio(sel); 185 186 Main.map.repaint(); 186 187 } … … 245 246 line, 246 247 tagimage, 247 applyAudio,248 importAudio, 248 249 markersFromNamedTrackpoints, 249 250 new JMenuItem(new ConvertToDataLayerAction()), … … 458 459 } 459 460 460 461 461 public class ConvertToDataLayerAction extends AbstractAction { 462 462 public ConvertToDataLayerAction() { … … 485 485 } 486 486 } 487 487 488 488 /** 489 * 490 * 489 * Makes a new marker layer derived from this GpxLayer containing at least one 490 * audio marker which the given audio file is associated with. 491 * Markers are derived from the following 492 * (a) explict waypoints in the GPX layer, or 493 * (b) named trackpoints in the GPX layer, or 494 * (c) (in future) voice recognised markers in the sound recording 495 * (d) a single marker at the beginning of the track 496 * @param wavFile : the file to be associated with the markers in the new marker layer 491 497 */ 492 private void applyAudio(File wavFile) {498 private void importAudio(File wavFile) { 493 499 String uri = "file:".concat(wavFile.getAbsolutePath()); 494 double audioGapSecs = 15.0; 495 try { 496 audioGapSecs = Double.parseDouble(Main.pref.get("marker.audiosampleminsecs", Double.toString(audioGapSecs))); 497 } catch (NumberFormatException e) { 498 } 499 double audioGapMetres = 75.0; 500 try { 501 audioGapMetres = Double.parseDouble(Main.pref.get("marker.audiosampleminmetres", Double.toString(audioGapMetres))); 502 } catch (NumberFormatException e) { 503 } 504 double audioGapRadians = (audioGapMetres / 40041455.0 /* circumference of Earth in metres */) * 2.0 * Math.PI; 505 double audioGapRadiansSquared = audioGapRadians * audioGapRadians; 506 double firstTime = -1.0; 507 double prevOffset = - (audioGapSecs + 1.0); // first point always exceeds time difference 508 WayPoint prevPoint = null; 509 510 MarkerLayer ml = new MarkerLayer(new GpxData(), tr("Sampled audio markers from {0}", name), associatedFile, me); 500 MarkerLayer ml = new MarkerLayer(new GpxData(), tr("Audio markers from {0}", name), associatedFile, me); 501 502 // (a) try explicit waypoints - unless suppressed 503 if (Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true) && 504 data.waypoints != null && 505 ! data.waypoints.isEmpty()) 506 { 507 double firstTime = -1.0; 508 for (WayPoint w : data.waypoints) { 509 if (firstTime < 0.0) firstTime = w.time; 510 double offset = w.time - firstTime; 511 String name = w.attr.containsKey("name") ? w.getString("name") : 512 w.attr.containsKey("desc") ? w.getString("desc") : 513 AudioMarker.inventName(offset); 514 AudioMarker am = AudioMarker.create(w.latlon, 515 name, uri, ml, w.time, offset); 516 ml.data.add(am); 517 } 518 } 519 520 // (b) use explicitly named track points, again unless suppressed 521 if (ml.data.isEmpty() && 522 Main.pref.getBoolean("marker.namedtrackpoints") && 523 data.tracks != null && 524 ! data.tracks.isEmpty()) 525 { 526 double firstTime = -1.0; 527 for (GpxTrack track : data.tracks) { 528 for (Collection<WayPoint> seg : track.trackSegs) { 529 for (WayPoint w : seg) { 530 String name; 531 if (w.attr.containsKey("name")) 532 name = w.getString("name"); 533 else if (w.attr.containsKey("desc")) 534 name = w.getString("desc"); 535 else 536 continue; 537 if (firstTime < 0.0) firstTime = w.time; 538 double offset = w.time - firstTime; 539 AudioMarker am = AudioMarker.create(w.latlon, 540 name, uri, ml, w.time, offset); 541 ml.data.add(am); 542 } 543 } 544 } 545 } 546 547 // (c) analyse audio for spoken markers here, in due course 511 548 512 for (GpxTrack track : data.tracks) { 513 for (Collection<WayPoint> seg : track.trackSegs) { 514 for (WayPoint point : seg) { 515 double time = point.time; 516 if (firstTime < 0.0) 517 firstTime = time; 518 double offset = time - firstTime; 519 if (prevPoint == null || 520 (offset - prevOffset > audioGapSecs && 521 /* note: distance is misleading: it actually gives distance _squared_ */ 522 point.eastNorth.distance(prevPoint.eastNorth) > audioGapRadiansSquared)) 523 { 524 525 AudioMarker am = AudioMarker.create(point.latlon, 526 AudioMarker.inventName(offset), uri, ml, time, offset); 527 ml.data.add(am); 528 prevPoint = point; 529 prevOffset = offset; 530 } 531 } 532 } 533 } 534 535 if (ml.data.size() > 0) { 549 // (d) simply add a single marker at the start of the track 550 if (ml.data.isEmpty() && 551 data.tracks != null && 552 ! data.tracks.isEmpty()) 553 { 554 for (GpxTrack track : data.tracks) { 555 for (Collection<WayPoint> seg : track.trackSegs) { 556 for (WayPoint w : seg) { 557 AudioMarker am = AudioMarker.create(w.latlon, 558 tr("start"), uri, ml, w.time, 0.0); 559 ml.data.add(am); 560 break; 561 } 562 break; 563 } 564 break; 565 } 566 } 567 568 if (! ml.data.isEmpty()) { 536 569 Main.main.addLayer(ml); 570 } else { 571 JOptionPane.showMessageDialog(Main.parent, tr("Nothing available to associate audio with.")); 537 572 } 538 573 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/AudioMarker.java
r554 r572 68 68 69 69 /** 70 * Starts playing the audio associated with the marker: used in response to pressing 71 * the marker as well as indirectly 72 * 70 * Starts playing the audio associated with the marker offset by the given amount 71 * @param after : seconds after marker where playing should start 73 72 */ 74 public void play( ) {73 public void play(double after) { 75 74 try { 76 75 // first enable tracing the audio along the track 77 if (Main.pref.getBoolean("marker.traceaudio", true) && parentLayer != null) { 78 parentLayer.traceAudio(); 79 } 76 Main.map.mapView.playHeadMarker.animate(); 80 77 81 AudioPlayer.play(audioUrl, offset + syncOffset );78 AudioPlayer.play(audioUrl, offset + syncOffset + after); 82 79 recentlyPlayedMarker = this; 83 80 } catch (Exception e) { … … 85 82 } 86 83 } 84 85 /** 86 * Starts playing the audio associated with the marker: used in response to pressing 87 * the marker as well as indirectly 88 * 89 */ 90 public void play() { play(0.0); } 87 91 88 92 public void adjustOffset(double adjustment) { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r562 r572 62 62 public class Marker implements ActionListener { 63 63 64 public finalEastNorth eastNorth;64 public EastNorth eastNorth; 65 65 public final String text; 66 66 public final Icon symbol; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r567 r572 44 44 import org.openstreetmap.josm.gui.layer.GpxLayer; 45 45 import org.openstreetmap.josm.gui.layer.markerlayer.AudioMarker; 46 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 46 47 import org.openstreetmap.josm.tools.ColorHelper; 47 48 import org.openstreetmap.josm.tools.ImageProvider; … … 67 68 private boolean mousePressed = false; 68 69 public GpxLayer fromLayer = null; 69 private Rectangle audioTracer = null; 70 71 /* 70 72 private Icon audioTracerIcon = null; 71 73 private EastNorth playheadPosition = null; … … 73 75 private static double audioAnimationInterval = 0.0; // seconds 74 76 private static double playheadTime = -1.0; 75 77 */ 76 78 public MarkerLayer(GpxData indata, String name, File associatedFile, GpxLayer fromLayer) { 77 79 … … 161 163 } 162 164 } 163 164 if (audioTracer != null) {165 Point screen = Main.map.mapView.getPoint(playheadPosition);166 audioTracer.setLocation(screen.x, screen.y);167 audioTracerIcon.paintIcon(Main.map.mapView, g, screen.x, screen.y);168 }169 }170 171 protected void traceAudio() {172 if (timer == null) {173 audioAnimationInterval = Double.parseDouble(Main.pref.get("marker.audioanimationinterval", "1")); //milliseconds174 timer = new Timer((int)(audioAnimationInterval * 1000.0), new ActionListener() {175 public void actionPerformed(ActionEvent e) {176 timerAction();177 }178 });179 timer.start();180 }181 }182 183 /**184 * callback for AudioPlayer when position changes185 * @param position seconds into the audio stream186 */187 public void timerAction() {188 AudioMarker recentlyPlayedMarker = AudioMarker.recentlyPlayedMarker();189 if (recentlyPlayedMarker == null)190 return;191 double audioTime = recentlyPlayedMarker.time +192 AudioPlayer.position() -193 recentlyPlayedMarker.offset -194 recentlyPlayedMarker.syncOffset;195 if (Math.abs(audioTime- playheadTime) < audioAnimationInterval)196 return;197 if (fromLayer == null)198 return;199 /* find the pair of track points for this position (adjusted by the syncOffset)200 * and interpolate between them201 */202 WayPoint w1 = null;203 WayPoint w2 = null;204 205 for (GpxTrack track : fromLayer.data.tracks) {206 for (Collection<WayPoint> trackseg : track.trackSegs) {207 for (Iterator<WayPoint> it = trackseg.iterator(); it.hasNext();) {208 WayPoint w = it.next();209 if (audioTime < w.time) {210 w2 = w;211 break;212 }213 w1 = w;214 }215 if (w2 != null) break;216 }217 if (w2 != null) break;218 }219 220 if (w1 == null)221 return;222 playheadPosition = w2 == null ?223 w1.eastNorth :224 w1.eastNorth.interpolate(w2.eastNorth,225 (audioTime - w1.time)/(w2.time - w1.time));226 227 if (audioTracer == null) {228 audioTracerIcon = ImageProvider.getIfAvailable("markers",Main.pref.get("marker.audiotracericon", "audio-tracer"));229 audioTracer = new Rectangle(0, 0, audioTracerIcon.getIconWidth(), audioTracerIcon.getIconHeight());230 }231 playheadTime = audioTime;232 Main.map.mapView.repaint();233 165 } 234 166 … … 249 181 for (Marker mkr : data) 250 182 v.visit(mkr.eastNorth); 251 }252 253 public void applyAudio(File wavFile) {254 String uri = "file:".concat(wavFile.getAbsolutePath());255 Collection<Marker> markers = new ArrayList<Marker>();256 for (Marker mkr : data) {257 AudioMarker audioMarker = mkr.audioMarkerFromMarker(uri);258 if (audioMarker == null) {259 markers.add(mkr);260 } else {261 markers.add(audioMarker);262 }263 }264 data.clear();265 data.addAll(markers);266 183 } 267 184 … … 293 210 }); 294 211 295 JMenuItem applyaudio = new JMenuItem(tr("Apply Audio"), ImageProvider.get("applyaudio"));296 applyaudio.putClientProperty("help", "Action/ApplyAudio");297 applyaudio.addActionListener(new ActionListener(){298 public void actionPerformed(ActionEvent e) {299 String dir = Main.pref.get("markers.lastaudiodirectory");300 JFileChooser fc = new JFileChooser(dir);301 fc.setFileSelectionMode(JFileChooser.FILES_ONLY);302 fc.setAcceptAllFileFilterUsed(false);303 fc.setFileFilter(new FileFilter(){304 @Override public boolean accept(File f) {305 return f.isDirectory() || f.getName().toLowerCase().endsWith(".wav");306 }307 @Override public String getDescription() {308 return tr("Wave Audio files (*.wav)");309 }310 });311 fc.showOpenDialog(Main.parent);312 File sel = fc.getSelectedFile();313 if (!fc.getCurrentDirectory().getAbsolutePath().equals(dir))314 Main.pref.put("markers.lastaudiodirectory", fc.getCurrentDirectory().getAbsolutePath());315 if (sel == null)316 return;317 applyAudio(sel);318 Main.map.repaint();319 }320 });321 322 212 JMenuItem syncaudio = new JMenuItem(tr("Synchronize Audio"), ImageProvider.get("audio-sync")); 323 213 syncaudio.putClientProperty("help", "Action/SynchronizeAudio"); 324 214 syncaudio.addActionListener(new ActionListener(){ 325 215 public void actionPerformed(ActionEvent e) { 326 adjustOffsetsOnAudioMarkers(); 216 if (! AudioPlayer.paused()) { 217 JOptionPane.showMessageDialog(Main.parent,tr("You need to pause audio at the moment when you hear your synchronization cue.")); 218 return; 219 } 220 AudioMarker recent = AudioMarker.recentlyPlayedMarker(); 221 if (synchronizeAudioMarkers(recent)) { 222 JOptionPane.showMessageDialog(Main.parent, tr("Audio synchronized at point " + recent.text)); 223 } else { 224 JOptionPane.showMessageDialog(Main.parent,tr("Unable to synchronize in layer being played.")); 225 } 327 226 } 328 227 }); … … 332 231 moveaudio.addActionListener(new ActionListener(){ 333 232 public void actionPerformed(ActionEvent e) { 334 makeAudioMarkerAtPlayHead(); 233 if (! AudioPlayer.paused()) { 234 JOptionPane.showMessageDialog(Main.parent,tr("You need to have paused audio at the point on the track where you want the marker.")); 235 return; 236 } 237 PlayHeadMarker playHeadMarker = Main.map.mapView.playHeadMarker; 238 if (playHeadMarker == null) 239 return; 240 addAudioMarker(playHeadMarker.time, playHeadMarker.eastNorth); 241 Main.map.mapView.repaint(); 335 242 } 336 243 }); … … 344 251 components.add(new JSeparator()); 345 252 components.add(syncaudio); 346 components.add(applyaudio);347 253 if (Main.pref.getBoolean("marker.traceaudio", true)) { 348 254 components.add (moveaudio); … … 354 260 } 355 261 356 private void adjustOffsetsOnAudioMarkers() { 357 if (! AudioPlayer.paused()) { 358 JOptionPane.showMessageDialog(Main.parent,tr("You need to pause audio at the moment when you hear your synchronization cue.")); 359 return; 360 } 361 Marker startMarker = AudioMarker.recentlyPlayedMarker(); 362 boolean explicitMarker = true; 262 public boolean synchronizeAudioMarkers(AudioMarker startMarker) { 363 263 if (startMarker != null && ! data.contains(startMarker)) { 364 explicitMarker = false;365 264 startMarker = null; 366 265 } … … 368 267 // find the first audioMarker in this layer 369 268 for (Marker m : data) { 370 if (m .getClass() == AudioMarker.class) {371 startMarker = m;269 if (m instanceof AudioMarker) { 270 startMarker = (AudioMarker) m; 372 271 break; 373 272 } 374 273 } 375 274 } 376 if (startMarker == null) { 377 // still no marker to work from - message? 378 JOptionPane.showMessageDialog(Main.parent,tr("No audio marker found in the layer to synchronize with.")); 379 return; 380 } 275 if (startMarker == null) 276 return false; 277 381 278 // apply adjustment to all subsequent audio markers in the layer 382 279 double adjustment = AudioPlayer.position() - startMarker.offset; // in seconds 383 280 boolean seenStart = false; 384 URL url = ((AudioMarker)startMarker).url();281 URL url = startMarker.url(); 385 282 for (Marker m : data) { 386 283 if (m == startMarker) … … 392 289 } 393 290 } 394 395 JOptionPane.showMessageDialog(Main.parent, explicitMarker ? 396 tr("Audio synchronized with most recently played marker and subsequent ones (that have the same sound track).") : 397 tr("Audio synchronized with audio markers in the layer (that have the same sound track as the first one).")); 398 } 399 400 private void makeAudioMarkerAtPlayHead() { 401 if (! AudioPlayer.paused()) { 402 JOptionPane.showMessageDialog(Main.parent,tr("You need to pause audio at the point on the track where you want the marker.")); 403 return; 404 } 291 return true; 292 } 293 294 public AudioMarker addAudioMarker(double time, EastNorth en) { 405 295 // find first audio marker to get absolute start time 406 296 double offset = 0.0; … … 409 299 if (m.getClass() == AudioMarker.class) { 410 300 am = (AudioMarker)m; 411 offset = playheadTime - am.time;301 offset = time - am.time; 412 302 break; 413 303 } … … 415 305 if (am == null) { 416 306 JOptionPane.showMessageDialog(Main.parent,tr("No existing audio markers in this layer to offset from.")); 417 return ;307 return null; 418 308 } 419 309 420 310 // make our new marker 421 AudioMarker newAudioMarker = AudioMarker.create(Main.proj.eastNorth2latlon( playheadPosition),422 AudioMarker.inventName(offset), AudioPlayer.url().toString(), this, playheadTime, offset);311 AudioMarker newAudioMarker = AudioMarker.create(Main.proj.eastNorth2latlon(en), 312 AudioMarker.inventName(offset), AudioPlayer.url().toString(), this, time, offset); 423 313 424 314 // insert it at the right place in a copy the collection … … 440 330 newAudioMarker.adjustOffset(am.syncOffset()); // i.e. same as predecessor 441 331 newData.add(newAudioMarker); // insert at end 442 newAudioMarker = null;443 332 } 444 333 … … 446 335 data.clear(); 447 336 data.addAll(newData); 448 Main.map.mapView.repaint();337 return newAudioMarker; 449 338 } 450 339 -
trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
r563 r572 28 28 public class AudioPreference implements PreferenceSetting { 29 29 private JCheckBox audioMenuVisible = new JCheckBox(tr("Display the Audio menu.")); 30 /*31 private JCheckBox audioToolbarVisible = new JCheckBox(tr("Display Audio control buttons on toolbar."));32 */33 30 private JCheckBox markerButtonLabels = new JCheckBox(tr("Label audio (and image and web) markers.")); 34 31 private JCheckBox markerAudioTraceVisible = new JCheckBox(tr("Display live audio trace.")); 35 32 private JCheckBox markersNamedTrackpoints = new JCheckBox(tr("Create audio markers from named trackpoints.")); 33 private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create non-audio markers when reading GPX.")); 34 private JCheckBox audioMarkersFromExplicitWaypoints = new JCheckBox(tr("Import audio uses explicit waypoints.")); 36 35 37 private JTextField audioSampleMinSecs = new JTextField(8);38 private JTextField audioSampleMinMetres = new JTextField(8);39 36 private JTextField audioLeadIn = new JTextField(8); 40 37 private JTextField audioForwardBackAmount = new JTextField(8); … … 91 88 gui.audio.add(markersNamedTrackpoints, GBC.eol().insets(0,0,0,0)); 92 89 93 audioSampleMinSecs.setText(Main.pref.get("marker.audiosampleminsecs", "15")); 94 audioSampleMinSecs.setToolTipText(tr("Minimum time in seconds between audio samples when creating sampled audio markers from waypoints")); 95 gui.audio.add(new JLabel(tr("Min audio marker sample rate (seconds)")), GBC.std()); 96 gui.audio.add(audioSampleMinSecs, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 97 98 audioSampleMinMetres.setText(Main.pref.get("marker.audiosampleminmetres", "75")); 99 audioSampleMinMetres.setToolTipText(tr("Minimum distance in metres between audio samples when creating sampled audio markers from waypoints")); 100 gui.audio.add(new JLabel(tr("Min audio marker sample rate (metres)")), GBC.std()); 101 gui.audio.add(audioSampleMinMetres, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 102 90 // makeAutoMarkers 91 makeAutoMarkers.addActionListener(new ActionListener(){ 92 public void actionPerformed(ActionEvent e) { 93 if (!makeAutoMarkers.isSelected()) 94 makeAutoMarkers.setSelected(false); 95 makeAutoMarkers.setEnabled(makeAutoMarkers.isSelected()); 96 } 97 }); 98 makeAutoMarkers.setSelected(Main.pref.getBoolean("marker.makeautomarkers", true)); 99 makeAutoMarkers.setToolTipText(tr("Automatically make a marker layer from any waypoints when opening a GPX layer.")); 100 gui.audio.add(makeAutoMarkers, GBC.eol().insets(0,0,0,0)); 101 102 // audioMarkersFromExplicitWaypoints 103 audioMarkersFromExplicitWaypoints.addActionListener(new ActionListener(){ 104 public void actionPerformed(ActionEvent e) { 105 if (!audioMarkersFromExplicitWaypoints.isSelected()) 106 audioMarkersFromExplicitWaypoints.setSelected(false); 107 audioMarkersFromExplicitWaypoints.setEnabled(audioMarkersFromExplicitWaypoints.isSelected()); 108 } 109 }); 110 audioMarkersFromExplicitWaypoints.setSelected(Main.pref.getBoolean("marker.audiofromexplicitwaypoints", true)); 111 audioMarkersFromExplicitWaypoints.setToolTipText(tr("When importing audio, apply it to any waypoints in the GPX layer.")); 112 gui.audio.add(audioMarkersFromExplicitWaypoints, GBC.eol().insets(0,0,0,0)); 113 103 114 audioForwardBackAmount.setText(Main.pref.get("audio.forwardbackamount", "10")); 104 115 audioForwardBackAmount.setToolTipText(tr("The number of seconds to jump forward or back when the relevant button is pressed")); … … 129 140 Main.pref.put("marker.buttonlabels", markerButtonLabels.isSelected()); 130 141 Main.pref.put("marker.namedtrackpoints", markersNamedTrackpoints.isSelected()); 131 Main.pref.put("marker. audiosampleminsecs", audioSampleMinSecs.getText());132 Main.pref.put("marker.audio sampleminmetres", audioSampleMinMetres.getText());142 Main.pref.put("marker.suppressautomarkers", makeAutoMarkers.isSelected()); 143 Main.pref.put("marker.audiofromexplicitwaypoints", audioMarkersFromExplicitWaypoints.isSelected()); 133 144 Main.pref.put("audio.forwardbackamount", audioForwardBackAmount.getText()); 134 145 Main.pref.put("audio.fastfwdmultiplier", audioFastForwardMultiplier.getText()); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r554 r572 241 241 currentState = states.pop(); 242 242 currentTrackSeg.add(currentWayPoint); 243 if (Main.pref.getBoolean("marker.namedtrackpoints") &&244 (currentWayPoint.attr.containsKey("name") ||245 currentWayPoint.attr.containsKey("desc")))246 {247 currentData.waypoints.add(currentWayPoint);248 }249 243 } else if (qName.equals("wpt")) { 250 244 currentState = states.pop(); -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r563 r572 305 305 audioOutputLine.close(); 306 306 audioFormat = new AudioFormat(audioFormat.getEncoding(), 307 audioFormat.getSampleRate() * (float) speed,307 audioFormat.getSampleRate() * (float) (speed * calibration), 308 308 audioFormat.getSampleSizeInBits(), 309 309 audioFormat.getChannels(), 310 310 audioFormat.getFrameSize(), 311 audioFormat.getFrameRate() * (float) speed,311 audioFormat.getFrameRate() * (float) (speed * calibration), 312 312 audioFormat.isBigEndian()); 313 313 DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
Note:
See TracChangeset
for help on using the changeset viewer.