summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMartin Scarratt <mmmm@rockbox.org>2006-11-15 17:29:03 +0000
committerMartin Scarratt <mmmm@rockbox.org>2006-11-15 17:29:03 +0000
commit442c0e663f20dfd64e6d7d818ab13f444804ab5e (patch)
treef6b2945a15f2cd45199b1d775b5f9f521ea8a3a8 /apps
parent9270ee6aab0e1868bcd91966ac6c69b7d454dba6 (diff)
downloadrockbox-442c0e663f20dfd64e6d7d818ab13f444804ab5e.tar.gz
rockbox-442c0e663f20dfd64e6d7d818ab13f444804ab5e.zip
Improved replaygain tags for WPS by Ian Webber fs#6223. Shows the current status of the gain rather than what the setting is set to. %?rg<off|track|album|shuffletrack|shufflealbum|notag>. Also, %rg will give the current gain adjustment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11531 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c57
1 files changed, 53 insertions, 4 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 212f40f3c0..2e7b7ef09c 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -937,11 +937,60 @@ static char* get_tag(struct wps_data* wps_data,
937#if CONFIG_CODEC == SWCODEC 937#if CONFIG_CODEC == SWCODEC
938 case 'g': /* ReplayGain */ 938 case 'g': /* ReplayGain */
939 *flags |= WPS_REFRESH_STATIC; 939 *flags |= WPS_REFRESH_STATIC;
940 if(global_settings.replaygain) 940 if (global_settings.replaygain == 0)
941 *intval = global_settings.replaygain_type+2; 941 *intval = 1; /* off */
942 else 942 else
943 *intval = 1; 943 {
944 snprintf(buf, buf_size, "%d", *intval); 944 switch (global_settings.replaygain_type)
945 {
946 case REPLAYGAIN_TRACK: /* track */
947 if (id3->track_gain_string == NULL)
948 *intval = 6; /* no tag */
949 else
950 *intval = 2;
951 break;
952 case REPLAYGAIN_ALBUM: /* album */
953 if (id3->album_gain_string == NULL)
954 *intval = 6; /* no tag */
955 else
956 *intval = 3;
957 break;
958 case REPLAYGAIN_SHUFFLE: /* shuffle */
959 if (global_settings.playlist_shuffle)
960 {
961 if (id3->track_gain_string == NULL)
962 *intval = 6; /* no tag */
963 else
964 *intval = 4; /* shuffle track */
965 }
966 else
967 {
968 if (id3->album_gain_string == NULL)
969 *intval = 6; /* no tag */
970 else
971 *intval = 5; /* shuffle album */
972 }
973 break;
974 default:
975 *intval = 1; /* shoudn't happen, treat as off */
976 break;
977 } /* switch - replay gain type */
978 } /* if - replay gain set */
979 switch (*intval)
980 {
981 case 1:
982 case 6:
983 strncpy(buf, "+0.00 dB", buf_size);
984 break;
985 case 2:
986 case 4:
987 strncpy(buf, id3->track_gain_string, buf_size);
988 break;
989 case 3:
990 case 5:
991 strncpy(buf, id3->album_gain_string, buf_size);
992 break;
993 }
945 return buf; 994 return buf;
946#endif 995#endif
947 } 996 }