diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-05-20 19:22:57 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-05-20 19:22:57 -0700 |
commit | 30002ba39b4aed40bd9aa821a24be5614e1ded29 (patch) | |
tree | 5ebef5297b819a9cb63cdc8e4ea93f603811b785 /subsonic-android | |
parent | df2b3c4504754b7b64475c442d0b77e25543be4b (diff) | |
parent | 03c7142708b26f91a65cbd4b6fd6619cf68f2cf8 (diff) | |
download | dsub-30002ba39b4aed40bd9aa821a24be5614e1ded29.tar.gz dsub-30002ba39b4aed40bd9aa821a24be5614e1ded29.tar.bz2 dsub-30002ba39b4aed40bd9aa821a24be5614e1ded29.zip |
Merge branch 'master' of https://github.com/daneren2005/Subsonic.git
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java | 12 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java index e5de3858..d9605fc5 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java @@ -142,18 +142,26 @@ public class EqualizerActivity extends Activity { private void updateBars(boolean changedEnabled) { boolean isEnabled = equalizer.getEnabled(); short minEQLevel = equalizer.getBandLevelRange()[0]; + short maxEQLevel = equalizer.getBandLevelRange()[1]; for (Map.Entry<Short, SeekBar> entry : bars.entrySet()) { short band = entry.getKey(); SeekBar bar = entry.getValue(); bar.setEnabled(isEnabled); if(band >= (short)0) { + short setLevel; if(changedEnabled) { - equalizer.setBandLevel(band, (short)(equalizer.getBandLevel(band) - masterLevel)); + setLevel = (short)(equalizer.getBandLevel(band) - masterLevel); bar.setProgress(equalizer.getBandLevel(band) - minEQLevel); } else { bar.setProgress(equalizer.getBandLevel(band) - minEQLevel); - equalizer.setBandLevel(band, (short)(equalizer.getBandLevel(band) + masterLevel)); + setLevel = (short)(equalizer.getBandLevel(band) + masterLevel); } + if(setLevel < minEQLevel) { + setLevel = minEQLevel; + } else if(setLevel > maxEQLevel) { + setLevel = maxEQLevel; + } + equalizer.setBandLevel(band, setLevel); } else if(!isEnabled) { bar.setProgress(-minEQLevel); } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index fabeba6f..d157b46a 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -322,6 +322,10 @@ public class DownloadServiceImpl extends Service implements DownloadService { public void restore(List<MusicDirectory.Entry> songs, int currentPlayingIndex, int currentPlayingPosition) { download(songs, false, false, false, false); if (currentPlayingIndex != -1) { + while(mediaPlayer == null) { + Util.sleepQuietly(50L); + } + play(currentPlayingIndex, autoPlayStart); if (currentPlaying != null && currentPlaying.isCompleteFileAvailable()) { doPlay(currentPlaying, currentPlayingPosition, autoPlayStart); |