summaryrefslogtreecommitdiffstats
path: root/ext/taglib
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-05-28 10:39:00 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-05-28 10:39:00 +0000
commitc4b1e8e4aedc9971c1352a85ce2d1cc7da775c8d (patch)
tree49aa1867c1dad8d91009a84f6bc2277a7bbf0ca4 /ext/taglib
parente4bb4b892f6cadfb7abdb3e02de5168a5e5e89cb (diff)
ext/taglib/gstid3v2mux.cc: Handle writing of track-count or album-volume-count without track-number or albume-volume...
Original commit message from CVS: * ext/taglib/gstid3v2mux.cc: Handle writing of track-count or album-volume-count without track-number or albume-volume-number (in this case the number will just be set to 0). * tests/check/elements/id3v2mux.c: (test_taglib_id3mux_check_tags): It would be nice if we actually checked the values received for track/album-volume number/count in _check_tags(), rather than setting them again ...
Diffstat (limited to 'ext/taglib')
-rw-r--r--ext/taglib/gstid3v2mux.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc
index e77cb749..6427b82c 100644
--- a/ext/taglib/gstid3v2mux.cc
+++ b/ext/taglib/gstid3v2mux.cc
@@ -230,6 +230,23 @@ add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
id3v2tag->setTrack (track_number);
}
}
+ } else if (strcmp (tag, GST_TAG_TRACK_COUNT) == 0) {
+ guint n;
+
+ if (gst_tag_list_get_uint_index (list, GST_TAG_TRACK_NUMBER, 0, &n)) {
+ GST_DEBUG ("track-count handled with track-number, skipping");
+ } else if (gst_tag_list_get_uint_index (list, GST_TAG_TRACK_COUNT, 0, &n)) {
+ ID3v2::TextIdentificationFrame * frame;
+ gchar *tag_str;
+
+ frame = new ID3v2::TextIdentificationFrame ("TRCK", String::UTF8);
+ tag_str = g_strdup_printf ("0/%u", n);
+ GST_DEBUG ("Setting track number/count to %s", tag_str);
+
+ id3v2tag->addFrame (frame);
+ frame->setText (tag_str);
+ g_free (tag_str);
+ }
} else if (strcmp (tag, GST_TAG_ALBUM_VOLUME_NUMBER) == 0) {
guint volume_number;
@@ -256,6 +273,24 @@ add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
frame->setText (tag_str);
g_free (tag_str);
}
+ } else if (strcmp (tag, GST_TAG_ALBUM_VOLUME_COUNT) == 0) {
+ guint n;
+
+ if (gst_tag_list_get_uint_index (list, GST_TAG_ALBUM_VOLUME_NUMBER, 0, &n)) {
+ GST_DEBUG ("volume-count handled with volume-number, skipping");
+ } else if (gst_tag_list_get_uint_index (list, GST_TAG_ALBUM_VOLUME_COUNT,
+ 0, &n)) {
+ ID3v2::TextIdentificationFrame * frame;
+ gchar *tag_str;
+
+ frame = new ID3v2::TextIdentificationFrame ("TPOS", String::UTF8);
+ tag_str = g_strdup_printf ("0/%u", n);
+ GST_DEBUG ("Setting album volume number/count to %s", tag_str);
+
+ id3v2tag->addFrame (frame);
+ frame->setText (tag_str);
+ g_free (tag_str);
+ }
} else if (strcmp (tag, GST_TAG_COPYRIGHT) == 0) {
gchar *copyright;