diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-02-01 13:14:46 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-02-01 13:14:46 -0800 |
commit | cd447a2914dd554991e2ddcf69e6bfd5bac1015a (patch) | |
tree | 8c4f96f1ea629863c625643373579470aa64114d | |
parent | 3d7069f195c567adf7535b81088c8793564addd8 (diff) | |
download | dsub-cd447a2914dd554991e2ddcf69e6bfd5bac1015a.tar.gz dsub-cd447a2914dd554991e2ddcf69e6bfd5bac1015a.tar.bz2 dsub-cd447a2914dd554991e2ddcf69e6bfd5bac1015a.zip |
#261 cache visualizer on
3 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/src/github/daneren2005/dsub/fragments/DownloadFragment.java index cc940945..86e2b94f 100644 --- a/src/github/daneren2005/dsub/fragments/DownloadFragment.java +++ b/src/github/daneren2005/dsub/fragments/DownloadFragment.java @@ -489,6 +489,9 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe visualizerButton.setVisibility(View.GONE);
} else {
visualizerView = new VisualizerView(context);
+ if(downloadService.getShowVisualization()) {
+ visualizerView.setActive(true);
+ }
visualizerViewLayout.addView(visualizerView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
}
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a8bb6cd4..e417ce88 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -205,6 +205,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { if(prefs.getBoolean(Constants.PREFERENCES_EQUALIZER_ON, false)) { getEqualizerController(); } + if(prefs.getBoolean(Constants.PREFERENCES_VISUALIZER_ON, false)) { + getVisualizerController(); + showVisualization = true; + } } @Override @@ -456,7 +460,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { @Override public void setShowVisualization(boolean showVisualization) { this.showVisualization = showVisualization; - } + SharedPreferences.Editor editor = Util.getPreferences(this).edit(); + editor.putBoolean(Constants.PREFERENCES_VISUALIZER_ON, showVisualization); + editor.commit(); + } @Override public synchronized DownloadFile forSong(MusicDirectory.Entry song) { diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index 651f043e..c6dd49f2 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -114,6 +114,7 @@ public final class Constants { public static final String PREFERENCES_KEY_KEEP_SCREEN_ON = "keepScreenOn"; public static final String PREFERENCES_KEY_BUFFER_LENGTH = "bufferLength"; public static final String PREFERENCES_EQUALIZER_ON = "equalizerOn"; + public static final String PREFERENCES_VISUALIZER_ON = "visualizerOn"; 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"; |