public int getElapsedPercent() { long elapsed = getTrackElapsedSeconds(); long total = getTrackDurationSeconds(); if (elapsed == 0 || total == 0) return 0; return new Double(elapsed/((double)total/100)).intValue(); }
public long getTrackRemainingSeconds() { return getTrackDurationSeconds() - getTrackElapsedSeconds(); }
@Override public void stateChanged(ChangeEvent e) { final JSlider source = (JSlider) e.getSource(); if (source.getValueIsAdjusting()) return; PositionInfo positionInfo = getProgressPanel().getPositionInfo(); if (positionInfo != null) { int newValue = source.getValue(); double seekTargetSeconds = newValue * positionInfo.getTrackDurationSeconds() / 100; final String targetTime = ModelUtil.toTimeString( new Long(Math.round(seekTargetSeconds)).intValue() ); presenter.onSeekSelected(getInstanceId(), targetTime); } } });
public void setProgress(PositionInfo positionInfo) { if (positionInfo == null) { positionLabel.setText("00:00:00/00:00:00"); setPositionSliderWithoutNotification(0); } else { if (positionInfo.getTrackDurationSeconds() > 0) { positionLabel.setText(positionInfo.getRelTime() + "/" + positionInfo.getTrackDuration()); setPositionSliderWithoutNotification(positionInfo.getElapsedPercent()); positionSlider.setEnabled(true); } else { positionLabel.setText(positionInfo.getRelTime()); positionSlider.setEnabled(false); } } this.positionInfo = positionInfo; }
public int getElapsedPercent() { long elapsed = getTrackElapsedSeconds(); long total = getTrackDurationSeconds(); if (elapsed == 0 || total == 0) return 0; return new Double(elapsed/((double)total/100)).intValue(); }
public long getTrackRemainingSeconds() { return getTrackDurationSeconds() - getTrackElapsedSeconds(); }
@Override public long getDurationSeconds() { return positionInfo.getTrackDurationSeconds(); }
@Override public long getDurationSeconds() { return positionInfo.getTrackDurationSeconds(); }
@Override public String getDuration() { long t = positionInfo.getTrackDurationSeconds(); long h = t / 3600; long m = (t - h * 3600) / 60; long s = t - h * 3600 - m * 60; return formatTime(h, m, s); }
public int getElapsedPercent() { long elapsed = getTrackElapsedSeconds(); long total = getTrackDurationSeconds(); if (elapsed == 0 || total == 0) return 0; return new Double(elapsed/((double)total/100)).intValue(); }
@Override public String getDuration() { long t = positionInfo.getTrackDurationSeconds(); long h = t / 3600; long m = (t - h * 3600) / 60; long s = t - h * 3600 - m * 60; return formatTime(h, m, s); }
public long getTrackRemainingSeconds() { return getTrackDurationSeconds() - getTrackElapsedSeconds(); }