From 372feb754c4ac74d50383d926764b5b500acba26 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 1 May 2013 19:21:31 -0700 Subject: Added a setting for gapless playback --- subsonic-android/res/values/strings.xml | 2 ++ subsonic-android/res/xml/settings.xml | 6 ++++++ .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 5 ++++- subsonic-android/src/github/daneren2005/dsub/util/Constants.java | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'subsonic-android') diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml index 839a3e49..90e455eb 100644 --- a/subsonic-android/res/values/strings.xml +++ b/subsonic-android/res/values/strings.xml @@ -266,6 +266,8 @@ Do Nothing Persistent Notification Show the notification even after pausing. Press the stop button to clear it away. + Gapless Playback + The Galaxy S3 seems to be experiencing freezes/other weird issue since the introduction of gapless playback. Turn this off to fix the issue. Start Year: End Year: diff --git a/subsonic-android/res/xml/settings.xml b/subsonic-android/res/xml/settings.xml index a2ae7b20..d21f928f 100644 --- a/subsonic-android/res/xml/settings.xml +++ b/subsonic-android/res/xml/settings.xml @@ -239,6 +239,12 @@ android:key="screenLitOnDownload" android:defaultValue="true"/> + + = Build.VERSION_CODES.JELLY_BEAN && (playerState == PlayerState.STARTED || playerState == PlayerState.PAUSED)) { + + SharedPreferences prefs = Util.getPreferences(DownloadServiceImpl.this); + boolean gaplessPlayback = prefs.getBoolean(Constants.PREFERENCES_KEY_GAPLESS_PLAYBACK, true); + if(gaplessPlayback && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && (playerState == PlayerState.STARTED || playerState == PlayerState.PAUSED)) { mediaPlayer.setNextMediaPlayer(nextMediaPlayer); nextSetup = true; } diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java index ae88a2ef..a35573a6 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java @@ -91,6 +91,7 @@ public final class Constants { public static final String PREFERENCES_EQUALIZER_ON = "equalizerOn"; public static final String PREFERENCES_EQUALIZER_SETTINGS = "equalizerSettings"; public static final String PREFERENCES_KEY_PERSISTENT_NOTIFICATION = "persistentNotification"; + public static final String PREFERENCES_KEY_GAPLESS_PLAYBACK = "gaplessPlayback"; // Name of the preferences file. public static final String PREFERENCES_FILE_NAME = "github.daneren2005.dsub_preferences"; -- cgit v1.2.3