aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-20 19:22:57 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-20 19:22:57 -0700
commit30002ba39b4aed40bd9aa821a24be5614e1ded29 (patch)
tree5ebef5297b819a9cb63cdc8e4ea93f603811b785 /subsonic-android/src
parentdf2b3c4504754b7b64475c442d0b77e25543be4b (diff)
parent03c7142708b26f91a65cbd4b6fd6619cf68f2cf8 (diff)
downloaddsub-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/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/EqualizerActivity.java12
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java4
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);