summaryrefslogtreecommitdiff
path: root/apps/gui/gwps-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps-common.c')
-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 }