diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-22 19:44:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 19:44:14 +0100 |
commit | bd17373c182e8a91306ca37981b953e60e4a9a46 (patch) | |
tree | 47197ca728644ff642eba7e878fd06cc7375bd0a /storage/preferences | |
parent | 0a6b7ed69957cea9582af9e0dd861ed13795d6b5 (diff) | |
download | AntennaPod-bd17373c182e8a91306ca37981b953e60e4a9a46.zip |
Playback speed fixes (#7013)
- Remove video-specific playback speed (no longer needed now that we have per-podcast speed)
- Respect changed speed setting on settings page even if the service is not running
- Do not change global speed when feed setting is updated
Diffstat (limited to 'storage/preferences')
-rw-r--r-- | storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java b/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java index f2baf1242..42bdd5cf0 100644 --- a/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java +++ b/storage/preferences/src/main/java/de/danoeh/antennapod/storage/preferences/UserPreferences.java @@ -33,7 +33,6 @@ import de.danoeh.antennapod.model.feed.FeedCounter; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.model.feed.SortOrder; import de.danoeh.antennapod.model.feed.SubscriptionsFilter; -import de.danoeh.antennapod.model.playback.MediaType; /** * Provides access to preferences set by the user in the settings screen. A @@ -118,7 +117,6 @@ public class UserPreferences { // Mediaplayer private static final String PREF_PLAYBACK_SPEED = "prefPlaybackSpeed"; - private static final String PREF_VIDEO_PLAYBACK_SPEED = "prefVideoPlaybackSpeed"; public static final String PREF_PLAYBACK_SKIP_SILENCE = "prefSkipSilence"; private static final String PREF_FAST_FORWARD_SECS = "prefFastForwardSecs"; private static final String PREF_REWIND_SECS = "prefRewindSecs"; @@ -131,8 +129,6 @@ public class UserPreferences { public static final int EPISODE_CLEANUP_DEFAULT = 0; // Constants - public static final int NOTIFICATION_BUTTON_REWIND = 0; - public static final int NOTIFICATION_BUTTON_FAST_FORWARD = 1; public static final int NOTIFICATION_BUTTON_SKIP = 2; public static final int NOTIFICATION_BUTTON_NEXT_CHAPTER = 3; public static final int NOTIFICATION_BUTTON_PLAYBACK_SPEED = 4; @@ -406,15 +402,7 @@ public class UserPreferences { return prefs.getBoolean(PREF_DELETE_REMOVES_FROM_QUEUE, false); } - public static float getPlaybackSpeed(MediaType mediaType) { - if (mediaType == MediaType.VIDEO) { - return getVideoPlaybackSpeed(); - } else { - return getAudioPlaybackSpeed(); - } - } - - private static float getAudioPlaybackSpeed() { + public static float getPlaybackSpeed() { try { return Float.parseFloat(prefs.getString(PREF_PLAYBACK_SPEED, "1.00")); } catch (NumberFormatException e) { @@ -424,16 +412,6 @@ public class UserPreferences { } } - private static float getVideoPlaybackSpeed() { - try { - return Float.parseFloat(prefs.getString(PREF_VIDEO_PLAYBACK_SPEED, "1.00")); - } catch (NumberFormatException e) { - Log.e(TAG, Log.getStackTraceString(e)); - UserPreferences.setVideoPlaybackSpeed(1.0f); - return 1.0f; - } - } - public static boolean isSkipSilence() { return prefs.getBoolean(PREF_PLAYBACK_SKIP_SILENCE, false); } @@ -612,10 +590,6 @@ public class UserPreferences { prefs.edit().putString(PREF_PLAYBACK_SPEED, String.valueOf(speed)).apply(); } - public static void setVideoPlaybackSpeed(float speed) { - prefs.edit().putString(PREF_VIDEO_PLAYBACK_SPEED, String.valueOf(speed)).apply(); - } - public static void setSkipSilence(boolean skipSilence) { prefs.edit().putBoolean(PREF_PLAYBACK_SKIP_SILENCE, skipSilence).apply(); } |