diff options
author | Marcus <marcuswrogers@gmail.com> | 2017-04-12 12:52:50 -0700 |
---|---|---|
committer | Marcus <marcuswrogers@gmail.com> | 2017-04-12 12:52:50 -0700 |
commit | 594e5ac1a5b86f495c60857e45c5eca16229faac (patch) | |
tree | 915ad33b2456fd4a13bd1f68c15ba8b13d98e9bf /app/src/main/java/github/daneren2005 | |
parent | bb221e09ffe719ecd2d1c41aeba492ac2adf6151 (diff) | |
download | dsub-594e5ac1a5b86f495c60857e45c5eca16229faac.tar.gz dsub-594e5ac1a5b86f495c60857e45c5eca16229faac.tar.bz2 dsub-594e5ac1a5b86f495c60857e45c5eca16229faac.zip |
Added separate persistent settings for music and non-music playback. Also updated demo server username to guest2
The new preferences key names:
REFERENCES_KEY_SONG_PLAYBACK_SPEED
relates to songs only. Everything else uses
PREFERENCES_KEY_PLAYBACK_SPEED
Commented out resetPlaybackSpeed when setCurrentPlaying is called.
Updated resetPlaybackSpeed to remove both preferences, despite no longer being called.
Diffstat (limited to 'app/src/main/java/github/daneren2005')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index c2debd4d..08cbf150 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -729,7 +729,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo editor.putString(Constants.PREFERENCES_KEY_SERVER_NAME + 1, "Demo Server"); editor.putString(Constants.PREFERENCES_KEY_SERVER_URL + 1, "http://demo.subsonic.org"); - editor.putString(Constants.PREFERENCES_KEY_USERNAME + 1, "guest"); + editor.putString(Constants.PREFERENCES_KEY_USERNAME + 1, "guest2"); editor.putString(Constants.PREFERENCES_KEY_PASSWORD + 1, "guest"); editor.putInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1); editor.commit(); 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 77ef971c..e23995f2 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2669,10 +2669,18 @@ public class DownloadService extends Service { } private void resetPlaybackSpeed() { Util.getPreferences(this).edit().remove(Constants.PREFERENCES_KEY_PLAYBACK_SPEED).commit(); + Util.getPreferences(this).edit().remove(Constants.PREFERENCES_KEY_SONG_PLAYBACK_SPEED).commit(); } public float getPlaybackSpeed() { - return Util.getPreferences(this).getFloat(Constants.PREFERENCES_KEY_PLAYBACK_SPEED, 1.0f); + if (currentPlaying == null) + return 1.0f; + else { + if (currentPlaying.isSong()) + return Util.getPreferences(this).getFloat(Constants.PREFERENCES_KEY_SONG_PLAYBACK_SPEED, 1.0f); + else + return Util.getPreferences(this).getFloat(Constants.PREFERENCES_KEY_PLAYBACK_SPEED, 1.0f); + } } private synchronized void applyPlaybackParamsMain() { |