patches from Miroslav for tag editing
[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 "export.h"
23
24 #include "id3v1.h"
25
26 typedef struct {
27         char *title;
28         char *composer;
29         char *performer;
30         char *album;
31         char *year_recorded;
32         char *year_performed;
33         char *track_number;
34         char *tracks_in_album;
35         char *genre;
36         char *comment;
37 } FLAC_Plugin__CanonicalTag;
38
39 PLUGIN_COMMON_API FLAC_Plugin__CanonicalTag *FLAC_plugin__canonical_tag_new();
40 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_delete(FLAC_Plugin__CanonicalTag *);
41 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_init(FLAC_Plugin__CanonicalTag *);
42 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_clear(FLAC_Plugin__CanonicalTag *);
43
44 /* For each null field in dest, move the corresponding field from src
45  * WATCHOUT: note that src is not-const, because fields are 'moved' from
46  * src to dest and the src field is set to null.
47  */
48 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, FLAC_Plugin__CanonicalTag *src);
49
50 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_convert_from_id3v1(FLAC_Plugin__CanonicalTag *, const FLAC_Plugin__Id3v1_Tag *);
51
52 /* Returns a merged tag based on any Vorbis comments, id3v2 tag, and id3v1.
53  * In case of overlaps the preceding precedence applies.
54  */
55 PLUGIN_COMMON_API void FLAC_plugin__canonical_tag_get_combined(const char *filename, FLAC_Plugin__CanonicalTag *tag);
56
57 #endif