x11 factory: use vlc_readdir
[vlc/solaris.git] / include / vlc_meta.h
blob3f8c091bdd0a00434c6d5689419541232f5481d5
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_Publisher,
49 vlc_meta_EncodedBy,
50 vlc_meta_ArtworkURL,
51 vlc_meta_TrackID
52 } vlc_meta_type_t;
54 #define VLC_META_TYPE_COUNT 17
56 #define ITEM_PREPARSED 1
57 #define ITEM_ARTURL_FETCHED 2
58 #define ITEM_ART_FETCHED 4
59 #define ITEM_ART_NOTFOUND 8
61 /**
62 * Basic function to deal with meta
64 struct vlc_meta_t;
66 VLC_API vlc_meta_t * vlc_meta_New( void ) VLC_USED;
67 VLC_API void vlc_meta_Delete( vlc_meta_t *m );
68 VLC_API void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val );
69 VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
71 VLC_API void vlc_meta_AddExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value );
72 VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
73 VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
75 /**
76 * Allocate a copy of all extra meta names and a table with it.
77 * Be sure to free both the returned pointers and its name.
79 VLC_API char ** vlc_meta_CopyExtraNames( const vlc_meta_t *m ) VLC_USED;
81 VLC_API void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src );
83 VLC_API int vlc_meta_GetStatus( vlc_meta_t *m );
84 VLC_API void vlc_meta_SetStatus( vlc_meta_t *m, int status );
86 /**
87 * Returns a localizes string describing the meta
89 VLC_API const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type );
91 enum {
92 ALBUM_ART_WHEN_ASKED,
93 ALBUM_ART_WHEN_PLAYED,
94 ALBUM_ART_ALL
98 typedef struct meta_export_t
100 VLC_COMMON_MEMBERS
101 input_item_t *p_item;
102 const char *psz_file;
103 } meta_export_t;
105 VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
107 /* Setters for meta.
108 * Warning: Make sure to use the input_item meta setters (defined in vlc_input.h)
109 * instead of those one. */
110 #define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, vlc_meta_Title, b )
111 #define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_Artist, b )
112 #define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, vlc_meta_Genre, b )
113 #define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, vlc_meta_Copyright, b )
114 #define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, vlc_meta_Album, b )
115 #define vlc_meta_SetTrackNum( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackNumber, b )
116 #define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, vlc_meta_Description, b )
117 #define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, vlc_meta_Rating, b )
118 #define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, vlc_meta_Date, b )
119 #define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, vlc_meta_Setting, b )
120 #define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, vlc_meta_URL, b )
121 #define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, vlc_meta_Language, b )
122 #define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, vlc_meta_NowPlaying, b )
123 #define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, vlc_meta_Publisher, b )
124 #define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, vlc_meta_EncodedBy, b )
125 #define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, vlc_meta_ArtworkURL, b )
126 #define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackID, b )
128 #define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
129 #define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
130 #define VLC_META_GENRE vlc_meta_TypeToLocalizedString( vlc_meta_Genre )
131 #define VLC_META_COPYRIGHT vlc_meta_TypeToLocalizedString( vlc_meta_Copyright )
132 #define VLC_META_ALBUM vlc_meta_TypeToLocalizedString( vlc_meta_Album )
133 #define VLC_META_TRACK_NUMBER vlc_meta_TypeToLocalizedString( vlc_meta_TrackNumber )
134 #define VLC_META_DESCRIPTION vlc_meta_TypeToLocalizedString( vlc_meta_Description )
135 #define VLC_META_RATING vlc_meta_TypeToLocalizedString( vlc_meta_Rating )
136 #define VLC_META_DATE vlc_meta_TypeToLocalizedString( vlc_meta_Date )
137 #define VLC_META_SETTING vlc_meta_TypeToLocalizedString( vlc_meta_Setting )
138 #define VLC_META_URL vlc_meta_TypeToLocalizedString( vlc_meta_URL )
139 #define VLC_META_LANGUAGE vlc_meta_TypeToLocalizedString( vlc_meta_Language )
140 #define VLC_META_NOW_PLAYING vlc_meta_TypeToLocalizedString( vlc_meta_NowPlaying )
141 #define VLC_META_PUBLISHER vlc_meta_TypeToLocalizedString( vlc_meta_Publisher )
142 #define VLC_META_ENCODED_BY vlc_meta_TypeToLocalizedString( vlc_meta_EncodedBy )
143 #define VLC_META_ART_URL vlc_meta_TypeToLocalizedString( vlc_meta_ArtworkURL )
144 #define VLC_META_TRACKID vlc_meta_TypeToLocalizedString( vlc_meta_TrackID )
147 #endif