Updated Finnish translation
[rhythmbox.git] / metadata / rb-metadata.h
blobc6244ece30fa5fb231dfd0deb2677baf52b96438
1 /*
2 * arch-tag: Interface to metadata reading/writing
4 * Copyright (C) 2003,2004 Colin Walters <walters@verbum.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __RB_METADATA_H
23 #define __RB_METADATA_H
25 #include <glib-object.h>
27 G_BEGIN_DECLS
29 #define RB_METADATA_NUM_FIELDS 23
31 typedef enum
33 RB_METADATA_FIELD_TITLE, /* string */
34 RB_METADATA_FIELD_ARTIST, /* string */
35 RB_METADATA_FIELD_ALBUM, /* string */
36 RB_METADATA_FIELD_DATE, /* ulong */
37 RB_METADATA_FIELD_GENRE, /* string */
38 RB_METADATA_FIELD_COMMENT, /* string */
39 RB_METADATA_FIELD_TRACK_NUMBER, /* ulong */
40 RB_METADATA_FIELD_MAX_TRACK_NUMBER, /* ulong */
41 RB_METADATA_FIELD_DISC_NUMBER, /* ulong */
42 RB_METADATA_FIELD_MAX_DISC_NUMBER, /* ulong */
43 RB_METADATA_FIELD_DESCRIPTION, /* string */
44 RB_METADATA_FIELD_VERSION, /* string */
45 RB_METADATA_FIELD_ISRC, /* string */
46 RB_METADATA_FIELD_ORGANIZATION, /* string */
47 RB_METADATA_FIELD_COPYRIGHT, /* string */
48 RB_METADATA_FIELD_CONTACT, /* string */
49 RB_METADATA_FIELD_LICENSE, /* string */
50 RB_METADATA_FIELD_PERFORMER, /* string */
51 RB_METADATA_FIELD_DURATION, /* ulong */
52 RB_METADATA_FIELD_CODEC, /* string */
53 RB_METADATA_FIELD_BITRATE, /* ulong */
54 RB_METADATA_FIELD_TRACK_GAIN, /* double */
55 RB_METADATA_FIELD_TRACK_PEAK, /* double */
56 RB_METADATA_FIELD_ALBUM_GAIN, /* double */
57 RB_METADATA_FIELD_ALBUM_PEAK, /* double */
58 RB_METADATA_FIELD_LANGUAGE_CODE, /* string */
59 RB_METADATA_FIELD_MUSICBRAINZ_TRACKID, /* string */
61 RB_METADATA_FIELD_LAST /* nothing */
62 } RBMetaDataField;
64 typedef enum
66 RB_METADATA_ERROR_GNOMEVFS,
67 RB_METADATA_ERROR_MISSING_PLUGIN,
68 RB_METADATA_ERROR_UNRECOGNIZED,
69 RB_METADATA_ERROR_UNSUPPORTED,
70 RB_METADATA_ERROR_GENERAL,
71 RB_METADATA_ERROR_INTERNAL,
72 RB_METADATA_ERROR_NOT_AUDIO,
73 RB_METADATA_ERROR_NOT_AUDIO_IGNORE,
74 } RBMetaDataError;
76 #define RB_METADATA_ERROR rb_metadata_error_quark ()
78 GQuark rb_metadata_error_quark (void);
80 #define RB_TYPE_METADATA (rb_metadata_get_type ())
81 #define RB_METADATA(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_METADATA, RBMetaData))
82 #define RB_METADATA_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_METADATA, RBMetaDataClass))
83 #define RB_IS_METADATA(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_METADATA))
84 #define RB_IS_METADATA_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_METADATA))
85 #define RB_METADATA_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_METADATA, RBMetaDataClass))
87 typedef struct RBMetaDataPrivate RBMetaDataPrivate;
89 typedef struct
91 GObject parent;
93 RBMetaDataPrivate *priv;
94 } RBMetaData;
96 typedef struct
98 GObjectClass parent_class;
99 } RBMetaDataClass;
101 GType rb_metadata_get_type (void);
103 GType rb_metadata_get_field_type (RBMetaDataField field);
105 const char * rb_metadata_get_field_name (RBMetaDataField field);
107 RBMetaData * rb_metadata_new (void);
109 gboolean rb_metadata_can_save (RBMetaData *md, const char *mimetype);
111 void rb_metadata_load (RBMetaData *md,
112 const char *uri,
113 GError **error);
115 void rb_metadata_save (RBMetaData *md,
116 GError **error);
118 const char * rb_metadata_get_mime (RBMetaData *md);
120 gboolean rb_metadata_get (RBMetaData *md, RBMetaDataField field,
121 GValue *val);
123 gboolean rb_metadata_set (RBMetaData *md, RBMetaDataField field,
124 const GValue *val);
126 G_END_DECLS
128 #endif /* __RB_METADATA_H */