aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-24 05:22:16 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-24 05:22:16 -0700
commit1789036c1b3bed2afcf5074cd9cd0e91b4c5a6a2 (patch)
tree7f0f8b1d4b3b078ecd059c1f5418a1478a2341ff /src/github
parent78263d8e5a9a303956ab28b3545e57dbb8345d12 (diff)
downloaddsub-1789036c1b3bed2afcf5074cd9cd0e91b4c5a6a2.tar.gz
dsub-1789036c1b3bed2afcf5074cd9cd0e91b4c5a6a2.tar.bz2
dsub-1789036c1b3bed2afcf5074cd9cd0e91b4c5a6a2.zip
Instantly update volume when toggling replay gain
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/activity/SettingsActivity.java5
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/activity/SettingsActivity.java b/src/github/daneren2005/dsub/activity/SettingsActivity.java
index e40a62d2..710d7385 100644
--- a/src/github/daneren2005/dsub/activity/SettingsActivity.java
+++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java
@@ -267,6 +267,11 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
}
else if(Constants.PREFERENCES_KEY_SYNC_MOST_RECENT.equals(key)) {
SyncUtil.removeMostRecentSyncFiles(this);
+ } else if(Constants.PREFERENCES_KEY_REPLAY_GAIN.equals(key)) {
+ DownloadService downloadService = DownloadService.getInstance();
+ if(downloadService != null) {
+ downloadService.reapplyVolume();
+ }
}
scheduleBackup();
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 702a2b2f..a67418a8 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1626,12 +1626,15 @@ public class DownloadService extends Service {
if(mediaPlayer != null && (playerState == STARTED || playerState == PAUSED || playerState == STOPPED)) {
try {
this.volume = volume;
- applyReplayGain(mediaPlayer, currentPlaying);
+ reapplyVolume();
} catch(Exception e) {
Log.w(TAG, "Failed to set volume");
}
}
}
+ public void reapplyVolume() {
+ applyReplayGain(mediaPlayer, currentPlaying);
+ }
public synchronized void swap(boolean mainList, int from, int to) {
List<DownloadFile> list = mainList ? downloadList : backgroundDownloadList;