contrib:gme: always build a static library on Windows
[vlc.git] / include / vlc_meta.h
blobd390d0bc4df47994d296c5720d1869c458b16cb5
1 /*****************************************************************************
2 * vlc_meta.h: Stream meta-data
3 *****************************************************************************
4 * Copyright (C) 2004 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef VLC_META_H
25 #define VLC_META_H 1
27 /**
28 * \file
29 * This file defines functions and structures for stream meta-data in vlc
33 typedef enum vlc_meta_type_t
35 vlc_meta_Title,
36 vlc_meta_Artist,
37 vlc_meta_Genre,
38 vlc_meta_Copyright,
39 vlc_meta_Album,
40 vlc_meta_TrackNumber,
41 vlc_meta_Description,
42 vlc_meta_Rating,
43 vlc_meta_Date,
44 vlc_meta_Setting,
45 vlc_meta_URL,
46 vlc_meta_Language,
47 vlc_meta_NowPlaying,
48 vlc_meta_ESNowPlaying,
49 vlc_meta_Publisher,
50 vlc_meta_EncodedBy,
51 vlc_meta_ArtworkURL,
52 vlc_meta_TrackID,
53 vlc_meta_TrackTotal,
54 vlc_meta_Director,
55 vlc_meta_Season,
56 vlc_meta_Episode,
57 vlc_meta_ShowName,
58 vlc_meta_Actors,
59 vlc_meta_AlbumArtist,
60 vlc_meta_DiscNumber,
61 vlc_meta_DiscTotal
62 } vlc_meta_type_t;
64 #define VLC_META_TYPE_COUNT 27
66 #define ITEM_PREPARSED 1
67 #define ITEM_ART_FETCHED 2
68 #define ITEM_ART_NOTFOUND 4
70 /**
71 * Basic function to deal with meta
73 struct vlc_meta_t;
75 VLC_API vlc_meta_t * vlc_meta_New( void ) VLC_USED;
76 VLC_API void vlc_meta_Delete( vlc_meta_t *m );
77 VLC_API void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val );
78 VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
80 VLC_API void vlc_meta_AddExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value );
81 VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
82 VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
84 /**
85 * Allocate a copy of all extra meta names and a table with it.
86 * Be sure to free both the returned pointers and its name.
88 VLC_API char ** vlc_meta_CopyExtraNames( const vlc_meta_t *m ) VLC_USED;
90 VLC_API void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src );
92 VLC_API int vlc_meta_GetStatus( vlc_meta_t *m );
93 VLC_API void vlc_meta_SetStatus( vlc_meta_t *m, int status );
95 /**
96 * Returns a localizes string describing the meta
98 VLC_API const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type );
100 typedef struct meta_export_t
102 VLC_COMMON_MEMBERS
103 input_item_t *p_item;
104 const char *psz_file;
105 } meta_export_t;
107 VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
109 /* Setters for meta.
110 * Warning: Make sure to use the input_item meta setters (defined in vlc_input_item.h)
111 * instead of those one. */
112 #define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, vlc_meta_Title, b )
113 #define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_Artist, b )
114 #define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, vlc_meta_Genre, b )
115 #define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, vlc_meta_Copyright, b )
116 #define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, vlc_meta_Album, b )
117 #define vlc_meta_SetTrackNum( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackNumber, b )
118 #define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, vlc_meta_Description, b )
119 #define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, vlc_meta_Rating, b )
120 #define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, vlc_meta_Date, b )
121 #define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, vlc_meta_Setting, b )
122 #define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, vlc_meta_URL, b )
123 #define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, vlc_meta_Language, b )
124 #define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, vlc_meta_NowPlaying, b )
125 #define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, vlc_meta_Publisher, b )
126 #define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, vlc_meta_EncodedBy, b )
127 #define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, vlc_meta_ArtworkURL, b )
128 #define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackID, b )
129 #define vlc_meta_SetTrackTotal( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackTotal, b )
130 #define vlc_meta_SetDirector( meta, b ) vlc_meta_Set( meta, vlc_meta_Director, b )
131 #define vlc_meta_SetSeason( meta, b ) vlc_meta_Set( meta, vlc_meta_Season, b )
132 #define vlc_meta_SetEpisode( meta, b ) vlc_meta_Set( meta, vlc_meta_Episode, b )
133 #define vlc_meta_SetShowName( meta, b ) vlc_meta_Set( meta, vlc_meta_ShowName, b )
134 #define vlc_meta_SetActors( meta, b ) vlc_meta_Set( meta, vlc_meta_Actors, b )
135 #define vlc_meta_SetAlbumArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_AlbumArtist, b )
136 #define vlc_meta_SetDiscNumber( meta, b ) vlc_meta_Set( meta, vlc_meta_DiscNumber, b )
138 #define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
139 #define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
140 #define VLC_META_GENRE vlc_meta_TypeToLocalizedString( vlc_meta_Genre )
141 #define VLC_META_COPYRIGHT vlc_meta_TypeToLocalizedString( vlc_meta_Copyright )
142 #define VLC_META_ALBUM vlc_meta_TypeToLocalizedString( vlc_meta_Album )
143 #define VLC_META_TRACK_NUMBER vlc_meta_TypeToLocalizedString( vlc_meta_TrackNumber )
144 #define VLC_META_DESCRIPTION vlc_meta_TypeToLocalizedString( vlc_meta_Description )
145 #define VLC_META_RATING vlc_meta_TypeToLocalizedString( vlc_meta_Rating )
146 #define VLC_META_DATE vlc_meta_TypeToLocalizedString( vlc_meta_Date )
147 #define VLC_META_SETTING vlc_meta_TypeToLocalizedString( vlc_meta_Setting )
148 #define VLC_META_URL vlc_meta_TypeToLocalizedString( vlc_meta_URL )
149 #define VLC_META_LANGUAGE vlc_meta_TypeToLocalizedString( vlc_meta_Language )
150 #define VLC_META_NOW_PLAYING vlc_meta_TypeToLocalizedString( vlc_meta_NowPlaying )
151 #define VLC_META_PUBLISHER vlc_meta_TypeToLocalizedString( vlc_meta_Publisher )
152 #define VLC_META_ENCODED_BY vlc_meta_TypeToLocalizedString( vlc_meta_EncodedBy )
153 #define VLC_META_ART_URL vlc_meta_TypeToLocalizedString( vlc_meta_ArtworkURL )
154 #define VLC_META_TRACKID vlc_meta_TypeToLocalizedString( vlc_meta_TrackID )
155 #define VLC_META_DIRECTOR vlc_meta_TypeToLocalizedString( vlc_meta_Director )
156 #define VLC_META_SEASON vlc_meta_TypeToLocalizedString( vlc_meta_Season )
157 #define VLC_META_EPISODE vlc_meta_TypeToLocalizedString( vlc_meta_Episode )
158 #define VLC_META_SHOW_NAME vlc_meta_TypeToLocalizedString( vlc_meta_ShowName )
159 #define VLC_META_ACTORS vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
160 #define VLC_META_ALBUMARTIST vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
161 #define VLC_META_DISCNUMBER vlc_meta_TypeToLocalizedString( vlc_meta_DiscNumber )
163 #define VLC_META_EXTRA_MB_ALBUMID "MB_ALBUMID"
165 #endif