gst/nsf/gstnsf.*: Add support for (very) basic tagging.
authorJohan Dahlin <johan@gnome.org>
Tue, 4 Sep 2007 02:16:53 +0000 (02:16 +0000)
committerJohan Dahlin <johan@gnome.org>
Tue, 4 Sep 2007 02:16:53 +0000 (02:16 +0000)
Original commit message from CVS:
2007-09-03  Johan Dahlin  <johan@gnome.org>

* gst/nsf/gstnsf.c: (gst_nsfdec_finalize), (start_play_tune):
* gst/nsf/gstnsf.h:
Add support for (very) basic tagging.

ChangeLog
gst/nsf/gstnsf.c
gst/nsf/gstnsf.h

index af636638091f3cc3629e252ea7e38313e8392c7d..e1cf82fd494a5f9a901d98dc8178a3f1ea2ea368 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-03  Johan Dahlin  <johan@gnome.org>
+
+       * gst/nsf/gstnsf.c: (gst_nsfdec_finalize), (start_play_tune):
+       * gst/nsf/gstnsf.h:
+       Add support for (very) basic tagging.
+       
 2007-09-03  Wim Taymans  <wim.taymans@gmail.com>
 
        * gst/rtpmanager/gstrtpbin-marshal.list:
index e5b4f3327693f737c7097fd423a5c0e13e16b50a..22dae796171c8b97dfd2aabe27acb5a1de0ebb07 100644 (file)
@@ -214,6 +214,9 @@ gst_nsfdec_finalize (GObject * object)
   if (nsfdec->tune_buffer)
     gst_buffer_unref (nsfdec->tune_buffer);
 
+  if (nsfdec->taglist)
+    gst_tag_list_free (nsfdec->taglist);
+
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -370,6 +373,22 @@ start_play_tune (GstNsfDec * nsfdec)
   if (!nsfdec_negotiate (nsfdec))
     goto could_not_negotiate;
 
+  nsfdec->taglist = gst_tag_list_new ();
+  gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
+      GST_TAG_AUDIO_CODEC, "Nosefart", NULL);
+
+  if (nsfdec->nsf->artist_name)
+    gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
+        GST_TAG_ARTIST, nsfdec->nsf->artist_name, NULL);
+
+  if (nsfdec->nsf->song_name)
+    gst_tag_list_add (nsfdec->taglist, GST_TAG_MERGE_REPLACE,
+        GST_TAG_TITLE, nsfdec->nsf->song_name, NULL);
+
+  gst_element_post_message (GST_ELEMENT_CAST (nsfdec),
+      gst_message_new_tag (GST_OBJECT (nsfdec),
+          gst_tag_list_copy (nsfdec->taglist)));
+
   nsf_playtrack (nsfdec->nsf,
       nsfdec->tune_number, nsfdec->frequency, nsfdec->bits, nsfdec->stereo);
   nsf_setfilter (nsfdec->nsf, nsfdec->filter);
index 47b47375399fde128355821658d9a41ea27a68a9..f2c1fbd0f2dc254126b3f73302a6247f4b4e138d 100644 (file)
@@ -73,6 +73,8 @@ struct _GstNsfDec {
   gboolean       stereo;
   int            channels;
   int            bps;
+
+  GstTagList    *taglist;
 };
 
 struct _GstNsfDecClass {