c8b32d8ba2aa70d0df624ef02a4cf345837c79fa
[platform/upstream/gstreamer.git] / gst-libs / gst / tag / tags.c
1 /* GStreamer
2  * Copyright (C) 2005 Ross Burton <ross@burtonini.com>
3  *
4  * tags.c: Non-core tag registration
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <gst/gst-i18n-plugin.h>
27 #include <gst/gst.h>
28 #include "tag.h"
29
30 /**
31  * SECTION:gsttag
32  * @short_description: Tag Support Library
33  * @see_also: #GstTagList
34  * 
35  * <refsect2>
36  * <para>
37  * Contains additional standardized GStreamer tag definitions and
38  * various utility functions for plugins to parse or create different
39  * types of tags. Also provides mappings from and to other tag identifiers
40  * to the GStreamer tag identifier.
41  * </para>
42  * </refsect2>
43  */
44
45
46 static gpointer
47 gst_tag_register_musicbrainz_tags_internal (gpointer unused)
48 {
49 #ifdef ENABLE_NLS
50   GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
51       LOCALEDIR);
52   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
53 #endif
54
55   gst_tag_register (GST_TAG_MUSICBRAINZ_TRACKID, GST_TAG_FLAG_META,
56       G_TYPE_STRING, _("track ID"), _("MusicBrainz track ID"), NULL);
57   gst_tag_register (GST_TAG_MUSICBRAINZ_ARTISTID, GST_TAG_FLAG_META,
58       G_TYPE_STRING, _("artist ID"), _("MusicBrainz artist ID"), NULL);
59   gst_tag_register (GST_TAG_MUSICBRAINZ_ALBUMID, GST_TAG_FLAG_META,
60       G_TYPE_STRING, _("album ID"), _("MusicBrainz album ID"), NULL);
61   gst_tag_register (GST_TAG_MUSICBRAINZ_ALBUMARTISTID, GST_TAG_FLAG_META,
62       G_TYPE_STRING,
63       _("album artist ID"), _("MusicBrainz album artist ID"), NULL);
64   gst_tag_register (GST_TAG_MUSICBRAINZ_TRMID, GST_TAG_FLAG_META,
65       G_TYPE_STRING, _("track TRM ID"), _("MusicBrainz TRM ID"), NULL);
66   gst_tag_register (GST_TAG_MUSICBRAINZ_SORTNAME, GST_TAG_FLAG_META,
67       G_TYPE_STRING,
68       _("artist sortname"), _("MusicBrainz artist sortname"), NULL);
69
70   return NULL;
71 }
72
73 /**
74  * gst_tag_register_musicbrainz_tags
75  *
76  * Registers additional musicbrainz-specific tags with the GStreamer tag
77  * system. Plugins and applications that use these tags should call this
78  * function before using them. Can be called multiple times.
79  */
80 void
81 gst_tag_register_musicbrainz_tags (void)
82 {
83   static GOnce mb_once = G_ONCE_INIT;
84
85   g_once (&mb_once, gst_tag_register_musicbrainz_tags_internal, NULL);
86 }