aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-07 19:21:08 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-07 19:21:08 -0700
commit50292a33938016f410effcb8f0aca1c6263e8410 (patch)
treefbd3d8878b124aba62e0048626942b539801fb7f /src
parent76a45b603fac943732d1eb8e219bd10e03f2fb69 (diff)
downloaddsub-50292a33938016f410effcb8f0aca1c6263e8410.tar.gz
dsub-50292a33938016f410effcb8f0aca1c6263e8410.tar.bz2
dsub-50292a33938016f410effcb8f0aca1c6263e8410.zip
Add setting for where to read replay gain tags from
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/activity/SettingsActivity.java5
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java4
-rw-r--r--src/github/daneren2005/dsub/util/Constants.java1
3 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 8335463b..0dd68fcb 100644
--- a/src/github/daneren2005/dsub/activity/SettingsActivity.java
+++ b/src/github/daneren2005/dsub/activity/SettingsActivity.java
@@ -89,6 +89,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private CheckBoxPreference syncStarred;
private CheckBoxPreference syncMostRecent;
private CheckBoxPreference replayGain;
+ private ListPreference replayGainType;
private Preference replayGainBump;
private Preference replayGainUntagged;
private String internalSSID;
@@ -131,6 +132,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
syncStarred = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_SYNC_STARRED);
syncMostRecent = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_SYNC_MOST_RECENT);
replayGain = (CheckBoxPreference) findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN);
+ replayGainType = (ListPreference) findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN_TYPE);
replayGainBump = (Preference) findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN_BUMP);
replayGainUntagged = (Preference) findPreference(Constants.PREFERENCES_KEY_REPLAY_GAIN_UNTAGGED);
@@ -335,12 +337,15 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
}
}
if(replayGain.isChecked()) {
+ replayGainType.setEnabled(true);
replayGainBump.setEnabled(true);
replayGainUntagged.setEnabled(true);
} else {
+ replayGainType.setEnabled(false);
replayGainBump.setEnabled(false);
replayGainUntagged.setEnabled(false);
}
+ replayGainType.setSummary(replayGainType.getEntry());
for (ServerSettings ss : serverSettings.values()) {
ss.update();
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index a03f056c..071159b2 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1956,7 +1956,7 @@ public class DownloadService extends Service {
if (prefs.getBoolean(Constants.PREFERENCES_KEY_REPLAY_GAIN, false)) {
boolean singleAlbum = false;
- String replayGainType = prefs.getString(Constants.PREFERENCE_KEY_REPLAY_GAIN_TYPE, "1");
+ String replayGainType = prefs.getString(Constants.PREFERENCES_KEY_REPLAY_GAIN_TYPE, "1");
// 1 => Smart replay gain
if("1".equals(replayGainType)) {
// Check if part of at least <REQUIRED_ALBUM_MATCHES> consequetive songs of the same album
@@ -1987,6 +1987,8 @@ public class DownloadService extends Service {
if(matched >= REQUIRED_ALBUM_MATCHES) {
singleAlbum = true;
}
+
+ Log.d(TAG, "Single album: " + singleAlbum);
}
}
// 2 => Use album tags
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java
index 815c4bb9..50651a80 100644
--- a/src/github/daneren2005/dsub/util/Constants.java
+++ b/src/github/daneren2005/dsub/util/Constants.java
@@ -149,6 +149,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_REPLAY_GAIN = "replayGain";
public static final String PREFERENCES_KEY_REPLAY_GAIN_BUMP = "replayGainBump2";
public static final String PREFERENCES_KEY_REPLAY_GAIN_UNTAGGED = "replayGainUntagged2";
+ public static final String PREFERENCES_KEY_REPLAY_GAIN_TYPE= "replayGainType";
public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount";
public static final String OFFLINE_SCROBBLE_ID = "scrobbleID";