diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-10-19 19:53:00 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-10-19 19:53:00 -0700 |
commit | bc523aed86056495c3f87e42b73597a028804093 (patch) | |
tree | 98ec115eb5f616a3fb0fe76c9dc61975209cdc4f /src/github/daneren2005 | |
parent | 6db94adbf87e92474996a5bc69364762898014c6 (diff) | |
download | dsub-bc523aed86056495c3f87e42b73597a028804093.tar.gz dsub-bc523aed86056495c3f87e42b73597a028804093.tar.bz2 dsub-bc523aed86056495c3f87e42b73597a028804093.zip |
More work on EQ failure conditions
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/NowPlayingFragment.java | 20 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 1 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 189e2a0c..eb4ce5ab 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -55,6 +55,7 @@ import android.widget.TextView; import android.widget.ViewFlipper;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.activity.SubsonicFragmentActivity;
+import github.daneren2005.dsub.audiofx.EqualizerController;
import github.daneren2005.dsub.domain.Bookmark;
import github.daneren2005.dsub.domain.PlayerState;
import github.daneren2005.dsub.domain.RepeatMode;
@@ -814,14 +815,19 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis return true;
case R.id.menu_equalizer: {
DownloadService downloadService = getDownloadService();
- if (downloadService != null && downloadService.getEqualizerController() != null
- && downloadService.getEqualizerController().getEqualizer() != null) {
- SubsonicFragment fragment = new EqualizerFragment();
- replaceFragment(fragment);
- setControlsVisible(true);
- } else {
- Util.toast(context, "Failed to start equalizer. Try restarting.");
+ if (downloadService != null) {
+ EqualizerController controller = downloadService.getEqualizerController();
+ if(controller != null) {
+ SubsonicFragment fragment = new EqualizerFragment();
+ replaceFragment(fragment);
+ setControlsVisible(true);
+
+ return true;
+ }
}
+
+ // Any failed condition will get here
+ Util.toast(context, "Failed to start equalizer. Try restarting.");
return true;
} default:
return false;
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index d4344e5b..aa03acc5 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1242,6 +1242,7 @@ public class DownloadService extends Service { } catch(Exception e2) { Log.w(TAG, "Failed to setup EQ even after reinitialization"); // Don't try again, just resetup media player and continue on + controller = null; } // Restart from same position and state we left off in |