diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-04-30 16:27:01 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-04-30 22:47:37 +0200 |
commit | 57a20d2d638895fffe88a23cbd2960f1102b292f (patch) | |
tree | df1943429ec040a18d854fa0a0091051e4200304 /apps/gui | |
parent | a32cbf33465367cd6fe36d636da8d03485e9d15d (diff) | |
download | rockbox-57a20d2d638895fffe88a23cbd2960f1102b292f.tar.gz rockbox-57a20d2d638895fffe88a23cbd2960f1102b292f.zip |
Make DSP's replaygain independent of global_settings.
Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h.
Intermediate functions in misc.c handle any adjustment and calling
the rbcodec APIs.
Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024
Reviewed-on: http://gerrit.rockbox.org/140
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/quickscreen.c | 4 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 13 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 4 |
3 files changed, 7 insertions, 14 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 6e50d61511..df295a8a95 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c | |||
@@ -419,9 +419,7 @@ bool quick_screen_quick(int button_enter) | |||
419 | if (oldshuffle != global_settings.playlist_shuffle | 419 | if (oldshuffle != global_settings.playlist_shuffle |
420 | && audio_status() & AUDIO_STATUS_PLAY) | 420 | && audio_status() & AUDIO_STATUS_PLAY) |
421 | { | 421 | { |
422 | #if CONFIG_CODEC == SWCODEC | 422 | replaygain_update(); |
423 | dsp_set_replaygain(); | ||
424 | #endif | ||
425 | if (global_settings.playlist_shuffle) | 423 | if (global_settings.playlist_shuffle) |
426 | playlist_randomise(NULL, current_tick, true); | 424 | playlist_randomise(NULL, current_tick, true); |
427 | else | 425 | else |
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 0f5deedcf9..578a729bb3 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -1420,25 +1420,22 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1420 | 1420 | ||
1421 | case SKIN_TOKEN_REPLAYGAIN: | 1421 | case SKIN_TOKEN_REPLAYGAIN: |
1422 | { | 1422 | { |
1423 | int globtype = global_settings.replaygain_settings.type; | ||
1423 | int val; | 1424 | int val; |
1424 | 1425 | ||
1425 | if (global_settings.replaygain_type == REPLAYGAIN_OFF) | 1426 | |
1427 | if (globtype == REPLAYGAIN_OFF) | ||
1426 | val = 1; /* off */ | 1428 | val = 1; /* off */ |
1427 | else | 1429 | else |
1428 | { | 1430 | { |
1429 | int type; | 1431 | int type = id3_get_replaygain_mode(id3); |
1430 | if (LIKELY(id3)) | ||
1431 | type = get_replaygain_mode(id3->track_gain != 0, | ||
1432 | id3->album_gain != 0); | ||
1433 | else | ||
1434 | type = -1; | ||
1435 | 1432 | ||
1436 | if (type < 0) | 1433 | if (type < 0) |
1437 | val = 6; /* no tag */ | 1434 | val = 6; /* no tag */ |
1438 | else | 1435 | else |
1439 | val = type + 2; | 1436 | val = type + 2; |
1440 | 1437 | ||
1441 | if (global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) | 1438 | if (globtype == REPLAYGAIN_SHUFFLE) |
1442 | val += 2; | 1439 | val += 2; |
1443 | } | 1440 | } |
1444 | 1441 | ||
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index a52a88439e..34f616b9a3 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -266,9 +266,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
266 | { | 266 | { |
267 | global_settings.playlist_shuffle = | 267 | global_settings.playlist_shuffle = |
268 | !global_settings.playlist_shuffle; | 268 | !global_settings.playlist_shuffle; |
269 | #if CONFIG_CODEC == SWCODEC | 269 | replaygain_update(); |
270 | dsp_set_replaygain(); | ||
271 | #endif | ||
272 | if (global_settings.playlist_shuffle) | 270 | if (global_settings.playlist_shuffle) |
273 | playlist_randomise(NULL, current_tick, true); | 271 | playlist_randomise(NULL, current_tick, true); |
274 | else | 272 | else |