d0c57fd7c257bf823db3d12164a11a57b96d3267
[platform/upstream/flac.git] / src / plugin_common / canonical_tag.h
1 /* plugin_common - Routines common to several plugins
2  * Copyright (C) 2002  Josh Coalson
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18
19 #ifndef FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
20 #define FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
21
22 #include "id3v1.h"
23
24 typedef struct {
25         char *title;
26         char *composer;
27         char *performer;
28         char *album;
29         char *year_recorded;
30         char *year_performed;
31         char *track_number;
32         char *tracks_in_album;
33         char *genre;
34         char *comment;
35 } FLAC_Plugin__CanonicalTag;
36
37 FLAC_Plugin__CanonicalTag *FLAC_plugin__canonical_tag_new();
38 void FLAC_plugin__canonical_tag_delete(FLAC_Plugin__CanonicalTag *);
39 void FLAC_plugin__canonical_tag_init(FLAC_Plugin__CanonicalTag *);
40 void FLAC_plugin__canonical_tag_clear(FLAC_Plugin__CanonicalTag *);
41
42 /* For each null field in dest, move the corresponding field from src
43  * WATCHOUT: note that src is not-const, because fields are 'moved' from
44  * src to dest and the src field is set to null.
45  */
46 void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, FLAC_Plugin__CanonicalTag *src);
47
48 void FLAC_plugin__canonical_tag_convert_from_id3v1(FLAC_Plugin__CanonicalTag *, const FLAC_Plugin__Id3v1_Tag *);
49
50 /* Returns a merged tag based on any Vorbis comments, id3v2 tag, and id3v1.
51  * In case of overlaps the preceding precedence applies.
52  */
53 void FLAC_plugin__canonical_tag_get_combined(const char *filename, FLAC_Plugin__CanonicalTag *tag);
54
55 #endif