]> git.sesse.net Git - vlc/blobdiff - include/vlc_meta.h
A bit of vlc/libvlc cleanup:
[vlc] / include / vlc_meta.h
index b3df73485dde8744fa5bea684ad1ee675cae1a30..77b16a24ba3a849fbbc197f33c60cdcd2c53b27a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if !defined( __LIBVLC__ )
+  #error You are not libvlc or one of its plugins. You cannot include this file
+#endif
+
 #ifndef _VLC_META_H
 #define _VLC_META_H 1
 
 /* VLC meta name */
 #define VLC_META_INFO_CAT           N_("Meta-information")
 #define VLC_META_TITLE              N_("Title")
-#define VLC_META_AUTHOR             N_("Author")
 #define VLC_META_ARTIST             N_("Artist")
 #define VLC_META_GENRE              N_("Genre")
 #define VLC_META_COPYRIGHT          N_("Copyright")
 #define VLC_META_CODEC_NAME         N_("Codec Name")
 #define VLC_META_CODEC_DESCRIPTION  N_("Codec Description")
 
+#define ITEM_PREPARSED      0x01
+#define ITEM_META_FETCHED   0x02
+#define ITEM_ARTURL_FETCHED 0x04
+#define ITEM_ART_FETCHED    0x08
+#define ITEM_ART_NOTFOUND   0x10
+
 struct vlc_meta_t
 {
     char *psz_title;
-    char *psz_author;
     char *psz_artist;
     char *psz_genre;
     char *psz_copyright;
@@ -67,6 +75,13 @@ struct vlc_meta_t
     char *psz_publisher;
     char *psz_encodedby;
     char *psz_arturl;
+    char *psz_trackid;
+#if 0 //not used
+    char *psz_artistid;
+    char *psz_albumid;
+#endif
+
+    int i_status;
 #if 0
     /* track meta information */
     int         i_track;
@@ -80,7 +95,6 @@ struct vlc_meta_t
 
 #define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, title, b );
 #define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, artist, b );
-#define vlc_meta_SetAuthor( meta, b ) vlc_meta_Set( meta, author, b );
 #define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, genre, b );
 #define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, copyright, b );
 #define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, album, b );
@@ -95,13 +109,18 @@ struct vlc_meta_t
 #define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, publisher, b );
 #define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, encodedby, b );
 #define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, arturl, b );
+#define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, trackid, b );
+#if 0 //not used
+#define vlc_meta_SetArtistID( meta, b ) vlc_meta_Set( meta, artistid, b );
+#define vlc_meta_SetAlbumID( meta, b ) vlc_meta_Set( meta, albumid, b );
+#endif
+
 
 static inline vlc_meta_t *vlc_meta_New( void )
 {
     vlc_meta_t *m = (vlc_meta_t*)malloc( sizeof( vlc_meta_t ) );
     if( !m ) return NULL;
     m->psz_title = NULL;
-    m->psz_author = NULL;
     m->psz_artist = NULL;
     m->psz_genre = NULL;
     m->psz_copyright = NULL;
@@ -117,13 +136,18 @@ static inline vlc_meta_t *vlc_meta_New( void )
     m->psz_publisher = NULL;
     m->psz_encodedby = NULL;
     m->psz_arturl = NULL;
+    m->psz_trackid = NULL;
+#if 0 //not used
+    m->psz_artistid = NULL;
+    m->psz_albumid = NULL;
+#endif
+    m->i_status = 0;
     return m;
 }
 
 static inline void vlc_meta_Delete( vlc_meta_t *m )
 {
     free( m->psz_title );
-    free( m->psz_author );
     free( m->psz_artist );
     free( m->psz_genre );
     free( m->psz_copyright );
@@ -138,6 +162,11 @@ static inline void vlc_meta_Delete( vlc_meta_t *m )
     free( m->psz_nowplaying );
     free( m->psz_publisher );
     free( m->psz_encodedby );
+    free( m->psz_trackid );
+#if 0 //not used
+    free( m->psz_artistid );
+    free( m->psz_albumid );
+#endif
     free( m->psz_arturl );
 
     free( m );
@@ -152,7 +181,6 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src )
         dst->psz_##a = strdup( src->psz_##a ); \
     }
     COPY_FIELD( title );
-    COPY_FIELD( author );
     COPY_FIELD( artist );
     COPY_FIELD( genre );
     COPY_FIELD( copyright );
@@ -167,8 +195,60 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src )
     COPY_FIELD( nowplaying );
     COPY_FIELD( publisher );
     COPY_FIELD( encodedby );
+    COPY_FIELD( trackid );
+#if 0 //not used
+    COPY_FIELD( artistid );
+    COPY_FIELD( albumid );
+#endif
     COPY_FIELD( arturl );
 }
     /** \todo Track meta */
 
+enum {
+    ALBUM_ART_WHEN_ASKED,
+    ALBUM_ART_WHEN_PLAYED,
+    ALBUM_ART_ALL
+};
+
+struct meta_export_t
+{
+    input_item_t *p_item;
+    const char *psz_file;
+};
+
+#define VLC_META_ENGINE_TITLE           0x00000001
+#define VLC_META_ENGINE_ARTIST          0x00000004
+#define VLC_META_ENGINE_GENRE           0x00000008
+#define VLC_META_ENGINE_COPYRIGHT       0x00000010
+#define VLC_META_ENGINE_COLLECTION      0x00000020
+#define VLC_META_ENGINE_SEQ_NUM         0x00000040
+#define VLC_META_ENGINE_DESCRIPTION     0x00000080
+#define VLC_META_ENGINE_RATING          0x00000100
+#define VLC_META_ENGINE_DATE            0x00000200
+#define VLC_META_ENGINE_URL             0x00000400
+#define VLC_META_ENGINE_LANGUAGE        0x00000800
+
+#define VLC_META_ENGINE_ART_URL         0x00001000
+
+#define VLC_META_ENGINE_MB_ARTIST_ID    0x00002000
+#define VLC_META_ENGINE_MB_RELEASE_ID   0x00004000
+#define VLC_META_ENGINE_MB_TRACK_ID     0x00008000
+#define VLC_META_ENGINE_MB_TRM_ID       0x00010000
+
+typedef struct meta_engine_sys_t meta_engine_sys_t;
+
+struct meta_engine_t
+{
+    VLC_COMMON_MEMBERS
+
+    module_t *p_module;
+
+    uint32_t i_mandatory; /**< Stuff which we really need to get */
+    uint32_t i_optional; /**< Stuff which we'd like to have */
+
+    input_item_t *p_item;
+};
+
+VLC_EXPORT(uint32_t, input_CurrentMetaFlags,( vlc_meta_t *p_meta ) );
+
 #endif