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.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 2e7b7ef09c..7e795ffd96 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -941,46 +941,24 @@ static char* get_tag(struct wps_data* wps_data,
941 *intval = 1; /* off */ 941 *intval = 1; /* off */
942 else 942 else
943 { 943 {
944 switch (global_settings.replaygain_type) 944 int type = get_replaygain_mode(
945 { 945 id3->track_gain_string != NULL,
946 case REPLAYGAIN_TRACK: /* track */ 946 id3->album_gain_string != NULL);
947 if (id3->track_gain_string == NULL) 947
948 *intval = 6; /* no tag */ 948 if (type < 0)
949 else 949 *intval = 6; /* no tag */
950 *intval = 2; 950 else
951 break; 951 *intval = type + 2;
952 case REPLAYGAIN_ALBUM: /* album */ 952
953 if (id3->album_gain_string == NULL) 953 if (global_settings.replaygain_type == REPLAYGAIN_SHUFFLE)
954 *intval = 6; /* no tag */ 954 *intval += 2;
955 else 955 }
956 *intval = 3; 956
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) 957 switch (*intval)
980 { 958 {
981 case 1: 959 case 1:
982 case 6: 960 case 6:
983 strncpy(buf, "+0.00 dB", buf_size); 961 return "+0.00 dB";
984 break; 962 break;
985 case 2: 963 case 2:
986 case 4: 964 case 4: