Changeset 557 in josm for trunk/src/org
- Timestamp:
- 2008-02-24T15:33:15+01:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
r554 r557 40 40 private JTextField audioLeadIn = new JTextField(8); 41 41 private JTextField audioForwardBackAmount = new JTextField(8); 42 private JTextField audioCalibration = new JTextField(8); 42 43 43 44 public void addGui(PreferenceDialog gui) { … … 110 111 gui.audio.add(audioLeadIn, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 111 112 113 audioCalibration.setText(Main.pref.get("audio.calibration", "1.0")); 114 audioCalibration.setToolTipText(tr("The ratio of voice recorder elapsed time to true elapsed time")); 115 gui.audio.add(new JLabel(tr("Voice recorder calibration")), GBC.std()); 116 gui.audio.add(audioCalibration, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 117 112 118 gui.audio.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 113 119 } … … 122 128 Main.pref.put("audio.forwardbackamount", audioForwardBackAmount.getText()); 123 129 Main.pref.put("audio.leadin", audioLeadIn.getText()); 130 Main.pref.put("audio.calibration", audioCalibration.getText()); 124 131 } 125 132 } -
trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
r556 r557 33 33 private URL playingUrl; 34 34 private double leadIn; // seconds 35 private double calibration; // ratio of purported duration of samples to true duration 35 36 private double position; // seconds 36 37 private double bytesPerSecond; … … 176 177 } catch (NumberFormatException e) { 177 178 leadIn = 1.0; // failed to parse 179 } 180 try { 181 calibration = Double.parseDouble(Main.pref.get("audio.calibration", "1.0" /* default, ratio */)); 182 } catch (NumberFormatException e) { 183 calibration = 1.0; // failed to parse 178 184 } 179 185 start(); … … 248 254 nBytesRead = 0; 249 255 position = 0.0; 250 double adjustedOffset = offset - leadIn;256 double adjustedOffset = (offset - leadIn) * calibration; 251 257 bytesPerSecond = audioFormat.getFrameRate() /* frames per second */ 252 258 * audioFormat.getFrameSize() /* bytes per frame */;
Note:
See TracChangeset
for help on using the changeset viewer.