diff options
author | Johan Dahlin <johan@gnome.org> | 2007-09-04 02:16:53 +0000 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2007-09-04 02:16:53 +0000 |
commit | a378cad6b97083719a2c020ad1988c530a606aa2 (patch) | |
tree | 7dc9767d47d9b7146a45979ee2e7f3912480ecf2 | |
parent | fcce4aff924da9dc2f7c86a3a93dfdc1b2cd1d93 (diff) | |
download | gst-plugins-bad-a378cad6b97083719a2c020ad1988c530a606aa2.tar.gz gst-plugins-bad-a378cad6b97083719a2c020ad1988c530a606aa2.tar.bz2 gst-plugins-bad-a378cad6b97083719a2c020ad1988c530a606aa2.zip |
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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst/nsf/gstnsf.c | 19 | ||||
-rw-r--r-- | gst/nsf/gstnsf.h | 2 |
3 files changed, 27 insertions, 0 deletions
@@ -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: diff --git a/gst/nsf/gstnsf.c b/gst/nsf/gstnsf.c index e5b4f332..22dae796 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 47b47375..f2c1fbd0 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 { |