diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2006-11-15 20:26:33 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2006-11-15 20:26:33 +0000 |
| commit | ea7992455a9704e2eb6bd6c9b39fabd111a7b997 (patch) | |
| tree | 44e4f25d4e21b4686e682754b1f3fbef2fcfe03f /apps/misc.c | |
| parent | 442c0e663f20dfd64e6d7d818ab13f444804ab5e (diff) | |
| download | rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.zip rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.gz rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.bz2 rockbox-ea7992455a9704e2eb6bd6c9b39fabd111a7b997.tar.xz | |
Make the updated %rg tag match playback behaviour (fall back to track gain if album gain requested but not available). Share the mode decision logic with playback code and simplify the %rg tag handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11532 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.c')
| -rw-r--r-- | apps/misc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index 80c4588..709bc49 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -802,3 +802,19 @@ int show_logo( void ) return 0; } + +#if CONFIG_CODEC == SWCODEC +int get_replaygain_mode(bool have_track_gain, bool have_album_gain) +{ + int type; + + bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK) + || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) + && global_settings.playlist_shuffle)); + + type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM + : have_track_gain ? REPLAYGAIN_TRACK : -1; + + return type; +} +#endif |