QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vlc_meta.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_meta.h: Stream meta-data
3  *****************************************************************************
4  * Copyright (C) 2004 VLC authors and VideoLAN
5  * $Id: db9f58af4b68976c9fd31aaa431b9ec52cd41717 $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23 
24 #ifndef VLC_META_H
25 #define VLC_META_H 1
26 
33 typedef enum vlc_meta_type_t
34 {
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_TrackTotal
53 } vlc_meta_type_t;
54 
55 #define VLC_META_TYPE_COUNT 18
56 
57 #define ITEM_PREPARSED 1
58 #define ITEM_ARTURL_FETCHED 2
59 #define ITEM_ART_FETCHED 4
60 #define ITEM_ART_NOTFOUND 8
61 
65 struct vlc_meta_t;
66 
67 VLC_API vlc_meta_t * vlc_meta_New( void ) VLC_USED;
68 VLC_API void vlc_meta_Delete( vlc_meta_t *m );
69 VLC_API void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val );
70 VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
71 
72 VLC_API void vlc_meta_AddExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value );
73 VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
74 VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
75 
80 VLC_API char ** vlc_meta_CopyExtraNames( const vlc_meta_t *m ) VLC_USED;
81 
82 VLC_API void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src );
83 
84 VLC_API int vlc_meta_GetStatus( vlc_meta_t *m );
85 VLC_API void vlc_meta_SetStatus( vlc_meta_t *m, int status );
86 
90 VLC_API const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type );
91 
92 enum {
93  ALBUM_ART_WHEN_ASKED,
94  ALBUM_ART_WHEN_PLAYED,
95  ALBUM_ART_ALL
96 };
97 
98 
99 typedef struct meta_export_t
100 {
101  VLC_COMMON_MEMBERS
102  input_item_t *p_item;
103  const char *psz_file;
104 } meta_export_t;
105 
106 VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
107 
108 /* Setters for meta.
109  * Warning: Make sure to use the input_item meta setters (defined in vlc_input_item.h)
110  * instead of those one. */
111 #define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, vlc_meta_Title, b )
112 #define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_Artist, b )
113 #define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, vlc_meta_Genre, b )
114 #define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, vlc_meta_Copyright, b )
115 #define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, vlc_meta_Album, b )
116 #define vlc_meta_SetTrackNum( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackNumber, b )
117 #define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, vlc_meta_Description, b )
118 #define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, vlc_meta_Rating, b )
119 #define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, vlc_meta_Date, b )
120 #define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, vlc_meta_Setting, b )
121 #define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, vlc_meta_URL, b )
122 #define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, vlc_meta_Language, b )
123 #define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, vlc_meta_NowPlaying, b )
124 #define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, vlc_meta_Publisher, b )
125 #define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, vlc_meta_EncodedBy, b )
126 #define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, vlc_meta_ArtworkURL, b )
127 #define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackID, b )
128 
129 #define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
130 #define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
131 #define VLC_META_GENRE vlc_meta_TypeToLocalizedString( vlc_meta_Genre )
132 #define VLC_META_COPYRIGHT vlc_meta_TypeToLocalizedString( vlc_meta_Copyright )
133 #define VLC_META_ALBUM vlc_meta_TypeToLocalizedString( vlc_meta_Album )
134 #define VLC_META_TRACK_NUMBER vlc_meta_TypeToLocalizedString( vlc_meta_TrackNumber )
135 #define VLC_META_DESCRIPTION vlc_meta_TypeToLocalizedString( vlc_meta_Description )
136 #define VLC_META_RATING vlc_meta_TypeToLocalizedString( vlc_meta_Rating )
137 #define VLC_META_DATE vlc_meta_TypeToLocalizedString( vlc_meta_Date )
138 #define VLC_META_SETTING vlc_meta_TypeToLocalizedString( vlc_meta_Setting )
139 #define VLC_META_URL vlc_meta_TypeToLocalizedString( vlc_meta_URL )
140 #define VLC_META_LANGUAGE vlc_meta_TypeToLocalizedString( vlc_meta_Language )
141 #define VLC_META_NOW_PLAYING vlc_meta_TypeToLocalizedString( vlc_meta_NowPlaying )
142 #define VLC_META_PUBLISHER vlc_meta_TypeToLocalizedString( vlc_meta_Publisher )
143 #define VLC_META_ENCODED_BY vlc_meta_TypeToLocalizedString( vlc_meta_EncodedBy )
144 #define VLC_META_ART_URL vlc_meta_TypeToLocalizedString( vlc_meta_ArtworkURL )
145 #define VLC_META_TRACKID vlc_meta_TypeToLocalizedString( vlc_meta_TrackID )
146 
147 
148 #endif
Definition: vlc_input_item.h:55
VLC_API const char * vlc_meta_TypeToLocalizedString(vlc_meta_type_t meta_type)
Definition: vlc_meta.h:99
Definition: vlc_objects.h:42
VLC_API char ** vlc_meta_CopyExtraNames(const vlc_meta_t *m) VLC_USED