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) |
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) if (oldshuffle != global_settings.playlist_shuffle && audio_status() & AUDIO_STATUS_PLAY) { -#if CONFIG_CODEC == SWCODEC - dsp_set_replaygain(); -#endif + replaygain_update(); if (global_settings.playlist_shuffle) playlist_randomise(NULL, current_tick, true); 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, case SKIN_TOKEN_REPLAYGAIN: { + int globtype = global_settings.replaygain_settings.type; int val; - if (global_settings.replaygain_type == REPLAYGAIN_OFF) + + if (globtype == REPLAYGAIN_OFF) val = 1; /* off */ else { - int type; - if (LIKELY(id3)) - type = get_replaygain_mode(id3->track_gain != 0, - id3->album_gain != 0); - else - type = -1; + int type = id3_get_replaygain_mode(id3); if (type < 0) val = 6; /* no tag */ else val = type + 2; - if (global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) + if (globtype == REPLAYGAIN_SHUFFLE) val += 2; } 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, { global_settings.playlist_shuffle = !global_settings.playlist_shuffle; -#if CONFIG_CODEC == SWCODEC - dsp_set_replaygain(); -#endif + replaygain_update(); if (global_settings.playlist_shuffle) playlist_randomise(NULL, current_tick, true); else |