diff options
author | Alexander Levin <al.le@rockbox.org> | 2009-06-20 21:13:24 +0000 |
---|---|---|
committer | Alexander Levin <al.le@rockbox.org> | 2009-06-20 21:13:24 +0000 |
commit | 8589fcb3e3e0744b208ce5e8099fdf12e46ba9c2 (patch) | |
tree | aac31dccb328366674c0284cba2d9a86ca3dfe4e | |
parent | 01bcd2c6121fa0ae1797ef11c02be298574f4fdb (diff) | |
download | rockbox-8589fcb3e3e0744b208ce5e8099fdf12e46ba9c2.tar.gz rockbox-8589fcb3e3e0744b208ce5e8099fdf12e46ba9c2.zip |
Merge the "Replaygain Off" option into the replaygain type; eliminate the "On/Off" setting (FS#10356). All WPS tags should work as before.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21414 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/dsp.c | 5 | ||||
-rw-r--r-- | apps/gui/gwps-common.c | 2 | ||||
-rw-r--r-- | apps/menus/playback_menu.c | 4 | ||||
-rw-r--r-- | apps/settings.h | 6 | ||||
-rw-r--r-- | apps/settings_list.c | 6 |
5 files changed, 10 insertions, 13 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index 0bb3ac0748..a760865afb 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -1449,13 +1449,14 @@ void dsp_set_replaygain(void) | |||
1449 | 1449 | ||
1450 | new_gain = false; | 1450 | new_gain = false; |
1451 | 1451 | ||
1452 | if (global_settings.replaygain || global_settings.replaygain_noclip) | 1452 | if ((global_settings.replaygain_type != REPLAYGAIN_OFF) || |
1453 | global_settings.replaygain_noclip) | ||
1453 | { | 1454 | { |
1454 | bool track_mode = get_replaygain_mode(track_gain != 0, | 1455 | bool track_mode = get_replaygain_mode(track_gain != 0, |
1455 | album_gain != 0) == REPLAYGAIN_TRACK; | 1456 | album_gain != 0) == REPLAYGAIN_TRACK; |
1456 | long peak = (track_mode || !album_peak) ? track_peak : album_peak; | 1457 | long peak = (track_mode || !album_peak) ? track_peak : album_peak; |
1457 | 1458 | ||
1458 | if (global_settings.replaygain) | 1459 | if (global_settings.replaygain_type != REPLAYGAIN_OFF) |
1459 | { | 1460 | { |
1460 | gain = (track_mode || !album_gain) ? track_gain : album_gain; | 1461 | gain = (track_mode || !album_gain) ? track_gain : album_gain; |
1461 | 1462 | ||
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 9cfff4cba8..f480f616a2 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -1227,7 +1227,7 @@ static const char *get_token_value(struct gui_wps *gwps, | |||
1227 | { | 1227 | { |
1228 | int val; | 1228 | int val; |
1229 | 1229 | ||
1230 | if (global_settings.replaygain == 0) | 1230 | if (global_settings.replaygain_type == REPLAYGAIN_OFF) |
1231 | val = 1; /* off */ | 1231 | val = 1; /* off */ |
1232 | else | 1232 | else |
1233 | { | 1233 | { |
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index 02e29b1840..28e8601282 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c | |||
@@ -120,13 +120,11 @@ static int replaygain_callback(int action,const struct menu_item_ex *this_item) | |||
120 | } | 120 | } |
121 | return action; | 121 | return action; |
122 | } | 122 | } |
123 | MENUITEM_SETTING(replaygain, &global_settings.replaygain ,replaygain_callback); | ||
124 | MENUITEM_SETTING(replaygain_noclip, &global_settings.replaygain_noclip ,replaygain_callback); | 123 | MENUITEM_SETTING(replaygain_noclip, &global_settings.replaygain_noclip ,replaygain_callback); |
125 | MENUITEM_SETTING(replaygain_type, &global_settings.replaygain_type ,replaygain_callback); | 124 | MENUITEM_SETTING(replaygain_type, &global_settings.replaygain_type ,replaygain_callback); |
126 | MENUITEM_SETTING(replaygain_preamp, &global_settings.replaygain_preamp ,replaygain_callback); | 125 | MENUITEM_SETTING(replaygain_preamp, &global_settings.replaygain_preamp ,replaygain_callback); |
127 | MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, Icon_NOICON, | 126 | MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, Icon_NOICON, |
128 | &replaygain,&replaygain_noclip, | 127 | &replaygain_type, &replaygain_noclip, &replaygain_preamp); |
129 | &replaygain_type,&replaygain_preamp); | ||
130 | 128 | ||
131 | MENUITEM_SETTING(beep, &global_settings.beep ,NULL); | 129 | MENUITEM_SETTING(beep, &global_settings.beep ,NULL); |
132 | #endif /* CONFIG_CODEC == SWCODEC */ | 130 | #endif /* CONFIG_CODEC == SWCODEC */ |
diff --git a/apps/settings.h b/apps/settings.h index ef5a62013d..e0ee4164bf 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -126,6 +126,7 @@ enum | |||
126 | NUM_REPEAT_MODES | 126 | NUM_REPEAT_MODES |
127 | }; | 127 | }; |
128 | 128 | ||
129 | |||
129 | /* dir filter options */ | 130 | /* dir filter options */ |
130 | /* Note: Any new filter modes need to be added before NUM_FILTER_MODES. | 131 | /* Note: Any new filter modes need to be added before NUM_FILTER_MODES. |
131 | * Any new rockbox browse filter modes (accessible through the menu) | 132 | * Any new rockbox browse filter modes (accessible through the menu) |
@@ -143,7 +144,7 @@ enum { SORT_INTERPRET_AS_DIGIT, SORT_INTERPRET_AS_NUMBER }; | |||
143 | enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK }; | 144 | enum { RECURSE_OFF, RECURSE_ON, RECURSE_ASK }; |
144 | 145 | ||
145 | /* replaygain types */ | 146 | /* replaygain types */ |
146 | enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE }; | 147 | enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE, REPLAYGAIN_OFF }; |
147 | 148 | ||
148 | /* show path types */ | 149 | /* show path types */ |
149 | enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; | 150 | enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; |
@@ -324,10 +325,9 @@ struct user_settings | |||
324 | int crossfade_fade_out_mixmode; /* Fade out mode (0=crossfade,1=mix) */ | 325 | int crossfade_fade_out_mixmode; /* Fade out mode (0=crossfade,1=mix) */ |
325 | 326 | ||
326 | /* Replaygain */ | 327 | /* Replaygain */ |
327 | bool replaygain; /* enable replaygain */ | ||
328 | bool replaygain_noclip; /* scale to prevent clips */ | 328 | bool replaygain_noclip; /* scale to prevent clips */ |
329 | int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if | 329 | int replaygain_type; /* 0=track gain, 1=album gain, 2=track gain if |
330 | shuffle is on, album gain otherwise */ | 330 | shuffle is on, album gain otherwise, 4=off */ |
331 | int replaygain_preamp; /* scale replaygained tracks by this */ | 331 | int replaygain_preamp; /* scale replaygained tracks by this */ |
332 | 332 | ||
333 | /* Crossfeed */ | 333 | /* Crossfeed */ |
diff --git a/apps/settings_list.c b/apps/settings_list.c index dcad718ee5..9e40cbd301 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1108,12 +1108,10 @@ const struct settings_list settings[] = { | |||
1108 | 1108 | ||
1109 | #if CONFIG_CODEC == SWCODEC | 1109 | #if CONFIG_CODEC == SWCODEC |
1110 | /* replay gain */ | 1110 | /* replay gain */ |
1111 | OFFON_SETTING(F_SOUNDSETTING, replaygain, LANG_REPLAYGAIN_ENABLE, true, | ||
1112 | "replaygain", NULL), | ||
1113 | CHOICE_SETTING(F_SOUNDSETTING, replaygain_type, LANG_REPLAYGAIN_MODE, | 1111 | CHOICE_SETTING(F_SOUNDSETTING, replaygain_type, LANG_REPLAYGAIN_MODE, |
1114 | REPLAYGAIN_SHUFFLE, "replaygain type", | 1112 | REPLAYGAIN_SHUFFLE, "replaygain type", |
1115 | "track,album,track shuffle", NULL, 3, ID2P(LANG_TRACK_GAIN), | 1113 | "track,album,track shuffle,off", NULL, 4, ID2P(LANG_TRACK_GAIN), |
1116 | ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN)), | 1114 | ID2P(LANG_ALBUM_GAIN), ID2P(LANG_SHUFFLE_GAIN), ID2P(LANG_OFF)), |
1117 | OFFON_SETTING(F_SOUNDSETTING, replaygain_noclip, LANG_REPLAYGAIN_NOCLIP, | 1115 | OFFON_SETTING(F_SOUNDSETTING, replaygain_noclip, LANG_REPLAYGAIN_NOCLIP, |
1118 | false, "replaygain noclip", NULL), | 1116 | false, "replaygain noclip", NULL), |
1119 | INT_SETTING_NOWRAP(F_SOUNDSETTING, replaygain_preamp, | 1117 | INT_SETTING_NOWRAP(F_SOUNDSETTING, replaygain_preamp, |