diff options
author | Kevin T. Berstene <kberstene@gmail.com> | 2017-06-09 18:05:02 -0400 |
---|---|---|
committer | Kevin T. Berstene <kberstene@gmail.com> | 2017-06-09 18:05:02 -0400 |
commit | b55f7c484c97f3a209e8c3631a7d466259210a71 (patch) | |
tree | ffa80d91c9e463e5d86617e13b44b6e373c4f0c9 /app/src/main/java | |
parent | cb697849c7d9720ed6da48ad8f1b6dafc1528e7f (diff) | |
download | dsub-b55f7c484c97f3a209e8c3631a7d466259210a71.tar.gz dsub-b55f7c484c97f3a209e8c3631a7d466259210a71.tar.bz2 dsub-b55f7c484c97f3a209e8c3631a7d466259210a71.zip |
Added preference for rewind and fast forward intervals
Keeping the default at 10s and 30s respectively, added preference options under Playback to allow user to change how far rewind and fast forward jump.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 6 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/Constants.java | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 636745d6..e103ea19 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -107,8 +107,6 @@ public class DownloadService extends Service { public static final String CMD_NEXT = "github.daneren2005.dsub.CMD_NEXT"; public static final String CANCEL_DOWNLOADS = "github.daneren2005.dsub.CANCEL_DOWNLOADS"; public static final String START_PLAY = "github.daneren2005.dsub.START_PLAYING"; - public static final int FAST_FORWARD = 30000; - public static final int REWIND = 10000; private static final long DEFAULT_DELAY_UPDATE_PROGRESS = 1000L; private static final double DELETE_CUTOFF = 0.84; private static final int REQUIRED_ALBUM_MATCHES = 4; @@ -1174,10 +1172,10 @@ public class DownloadService extends Service { } } public synchronized int rewind() { - return seekToWrapper(-REWIND); + return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_REWIND_INTERVAL, "10"))*-1000); } public synchronized int fastForward() { - return seekToWrapper(FAST_FORWARD); + return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_FASTFORWARD_INTERVAL, "30"))*1000); } protected int seekToWrapper(int difference) { int msPlayed = Math.max(0, getPlayerPosition()); diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java index 21adce8c..199fc56d 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java @@ -179,7 +179,9 @@ public final class Constants { public static final String PREFERENCES_KEY_PLAYBACK_SPEED = "playbackSpeed"; public static final String PREFERENCES_KEY_SONG_PLAYBACK_SPEED = "songPlaybackSpeed"; public static final String PREFERENCES_KEY_DLNA_CASTING_ENABLED = "dlnaCastingEnabled"; - + public static final String PREFERENCES_KEY_REWIND_INTERVAL = "rewindInterval"; + public static final String PREFERENCES_KEY_FASTFORWARD_INTERVAL = "fastforwardInterval"; + public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; public static final String OFFLINE_SCROBBLE_SEARCH = "scrobbleTitle"; |