summaryrefslogtreecommitdiff
path: root/gst/nsf
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2007-09-04 02:16:53 +0000
committerJohan Dahlin <johan@gnome.org>2007-09-04 02:16:53 +0000
commita378cad6b97083719a2c020ad1988c530a606aa2 (patch)
tree7dc9767d47d9b7146a45979ee2e7f3912480ecf2 /gst/nsf
parentfcce4aff924da9dc2f7c86a3a93dfdc1b2cd1d93 (diff)
downloadgstreamer-plugins-bad-a378cad6b97083719a2c020ad1988c530a606aa2.tar.gz
gst/nsf/gstnsf.*: Add support for (very) basic tagging.
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.
Diffstat (limited to 'gst/nsf')
-rw-r--r--gst/nsf/gstnsf.c19
-rw-r--r--gst/nsf/gstnsf.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/gst/nsf/gstnsf.c b/gst/nsf/gstnsf.c
index e5b4f3327..22dae7961 100644
--- a/gst/nsf/gstnsf.c
+++ b/gst/nsf/gstnsf.c
@@ -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);
diff --git a/gst/nsf/gstnsf.h b/gst/nsf/gstnsf.h
index 47b473753..f2c1fbd0f 100644
--- a/gst/nsf/gstnsf.h
+++ b/gst/nsf/gstnsf.h
@@ -73,6 +73,8 @@ struct _GstNsfDec {
gboolean stereo;
int channels;
int bps;
+
+ GstTagList *taglist;
};
struct _GstNsfDecClass {