tag.h 3.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* GStreamer
 * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */


Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
21
22
#ifndef __GST_TAG_TAG_H__
#define __GST_TAG_TAG_H__
23
24
25
26

#include <gst/gst.h>

G_BEGIN_DECLS
Johan Dahlin's avatar
Johan Dahlin committed
27

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Tag names */

/**
 * GST_TAG_MUSICBRAINZ_TRACKID
 *
 * MusicBrainz track ID
 */
#define GST_TAG_MUSICBRAINZ_TRACKID	"musicbrainz-trackid"
/**
 * GST_TAG_MUSICBRAINZ_ARTISTID
 *
 * MusicBrainz artist ID
 */
#define GST_TAG_MUSICBRAINZ_ARTISTID	"musicbrainz-artistid"
/**
 * GST_TAG_MUSICBRAINZ_ALBUMID
 *
 * MusicBrainz album ID
 */
#define GST_TAG_MUSICBRAINZ_ALBUMID	"musicbrainz-albumid"
/**
 * GST_TAG_MUSICBRAINZ_ALBUMARTISTID
 *
 * MusicBrainz album artist ID
 */
#define GST_TAG_MUSICBRAINZ_ALBUMARTISTID	"musicbrainz-albumartistid"
/**
 * GST_TAG_MUSICBRAINZ_TRMID
 *
 * MusicBrainz track TRM ID
 */
#define GST_TAG_MUSICBRAINZ_TRMID	"musicbrainz-trmid"
/**
 * GST_TAG_MUSICBRAINZ_SORTNAME
 *
 * MusicBrainz artist sort name
 */
#define GST_TAG_MUSICBRAINZ_SORTNAME	"musicbrainz-sortname"

Johan Dahlin's avatar
Johan Dahlin committed
67

68
69
/* functions for vorbis comment manipulation */

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
70
71
G_CONST_RETURN gchar *  gst_tag_from_vorbis_tag                 (const gchar *          vorbis_tag);
G_CONST_RETURN gchar *  gst_tag_to_vorbis_tag                   (const gchar *          gst_tag);
Johan Dahlin's avatar
Johan Dahlin committed
72
void                    gst_vorbis_tag_add                      (GstTagList *           list, 
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
73
74
                                                                 const gchar *          tag, 
                                                                 const gchar *          value);
Johan Dahlin's avatar
Johan Dahlin committed
75
76

GList *                 gst_tag_to_vorbis_comments              (const GstTagList *     list, 
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
77
                                                                 const gchar *          tag);
78

79
/* functions to convert GstBuffers with vorbiscomment contents to GstTagLists and back */
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
80
81
82
83
84
85
86
87
GstTagList *            gst_tag_list_from_vorbiscomment_buffer  (const GstBuffer *      buffer,
                                                                 const guint8 *         id_data,
                                                                 const guint            id_data_length,
                                                                 gchar **               vendor_string);
GstBuffer *             gst_tag_list_to_vorbiscomment_buffer    (const GstTagList *     list,
                                                                 const guint8 *         id_data,
                                                                 const guint            id_data_length,
                                                                 const gchar *          vendor_string);
88
89
90

/* functions for ID3 tag manipulation */

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
91
92
93
guint                   gst_tag_id3_genre_count                 (void);
G_CONST_RETURN gchar *  gst_tag_id3_genre_get                   (const guint            id);
GstTagList *            gst_tag_list_new_from_id3v1             (const guint8 *         data);
94

95
G_CONST_RETURN gchar *  gst_tag_from_id3_tag                    (const gchar *          id3_tag);
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
96
G_CONST_RETURN gchar *  gst_tag_to_id3_tag                      (const gchar *          gst_tag);
97

98
void gst_tag_register_musicbrainz_tags (void);
99
100

G_END_DECLS
Johan Dahlin's avatar
Johan Dahlin committed
101

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
102
#endif /* __GST_TAG_TAG_H__ */