[vlc-devel] [PATCH 3/4] input: Add support for Composer meta
Jean-Baptiste Kempf
jb at videolan.org
Fri Dec 5 22:31:27 CET 2014
Shouldn't composer go in extra metadata?
On 05 Dec, Uwe L. Korn wrote :
> ---
> include/vlc/libvlc_media.h | 3 ++-
> include/vlc_meta.h | 7 +++++--
> lib/media.c | 6 ++++--
> modules/lua/libs/input.c | 1 +
> src/input/meta.c | 3 ++-
> 5 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
> index c93d87b..e088e2b 100644
> --- a/include/vlc/libvlc_media.h
> +++ b/include/vlc/libvlc_media.h
> @@ -75,7 +75,8 @@ typedef enum libvlc_meta_t {
> libvlc_meta_ShowName,
> libvlc_meta_Actors,
> libvlc_meta_AlbumArtist,
> - libvlc_meta_DiscNumber
> + libvlc_meta_DiscNumber,
> + libvlc_meta_Composer
> /* Add new meta types HERE */
> } libvlc_meta_t;
>
> diff --git a/include/vlc_meta.h b/include/vlc_meta.h
> index c87643e..4239771 100644
> --- a/include/vlc_meta.h
> +++ b/include/vlc_meta.h
> @@ -56,10 +56,11 @@ typedef enum vlc_meta_type_t
> vlc_meta_ShowName,
> vlc_meta_Actors,
> vlc_meta_AlbumArtist,
> - vlc_meta_DiscNumber
> + vlc_meta_DiscNumber,
> + vlc_meta_Composer
> } vlc_meta_type_t;
>
> -#define VLC_META_TYPE_COUNT 25
> +#define VLC_META_TYPE_COUNT 26
>
> #define ITEM_PREPARSED 1
> #define ITEM_ARTURL_FETCHED 2
> @@ -141,6 +142,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
> #define vlc_meta_SetActors( meta, b ) vlc_meta_Set( meta, vlc_meta_Actors, b )
> #define vlc_meta_SetAlbumArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_AlbumArtist, b )
> #define vlc_meta_SetDiscNumber( meta, b ) vlc_meta_Set( meta, vlc_meta_DiscNumber, b )
> +#define vlc_meta_SetComposer( meta, b ) vlc_meta_Set( meta, vlc_meta_Composer, b )
>
> #define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
> #define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
> @@ -166,6 +168,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
> #define VLC_META_ACTORS vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
> #define VLC_META_ALBUMARTIST vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
> #define VLC_META_DISCNUMBER vlc_meta_TypeToLocalizedString( vlc_meta_DiscNumber )
> +#define VLC_META_COMPOSER vlc_meta_TypeToLocalizedString( vlc_meta_Composer )
>
> #define VLC_META_EXTRA_MB_ALBUMID "MB_ALBUMID"
>
> diff --git a/lib/media.c b/lib/media.c
> index 5e406a4..fd7713c 100644
> --- a/lib/media.c
> +++ b/lib/media.c
> @@ -70,7 +70,8 @@ static const vlc_meta_type_t libvlc_to_vlc_meta[] =
> [libvlc_meta_ShowName] = vlc_meta_ShowName,
> [libvlc_meta_Actors] = vlc_meta_Actors,
> [libvlc_meta_AlbumArtist] = vlc_meta_AlbumArtist,
> - [libvlc_meta_DiscNumber] = vlc_meta_DiscNumber
> + [libvlc_meta_DiscNumber] = vlc_meta_DiscNumber,
> + [libvlc_meta_Composer] = vlc_meta_Composer
> };
>
> static const libvlc_meta_t vlc_to_libvlc_meta[] =
> @@ -99,7 +100,8 @@ static const libvlc_meta_t vlc_to_libvlc_meta[] =
> [vlc_meta_ShowName] = libvlc_meta_ShowName,
> [vlc_meta_Actors] = libvlc_meta_Actors,
> [vlc_meta_AlbumArtist] = libvlc_meta_AlbumArtist,
> - [vlc_meta_DiscNumber] = libvlc_meta_DiscNumber
> + [vlc_meta_DiscNumber] = libvlc_meta_DiscNumber,
> + [vlc_meta_Composer] = libvlc_meta_Composer
> };
>
> /**************************************************************************
> diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
> index a524a7d..94d5624 100644
> --- a/modules/lua/libs/input.c
> +++ b/modules/lua/libs/input.c
> @@ -340,6 +340,7 @@ static int vlclua_input_item_set_meta( lua_State *L )
> META_TYPE( Actors, "actors" )
> META_TYPE( AlbumArtist, "album_artist" )
> META_TYPE( DiscNumber, "disc_number" )
> + META_TYPE( Composer, "composer" )
> };
> #undef META_TYPE
>
> diff --git a/src/input/meta.c b/src/input/meta.c
> index f8d1ec9..96fcdc6 100644
> --- a/src/input/meta.c
> +++ b/src/input/meta.c
> @@ -76,7 +76,8 @@ const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type )
> [vlc_meta_ShowName] = N_("Show Name"),
> [vlc_meta_Actors] = N_("Actors"),
> [vlc_meta_AlbumArtist] = N_("Album Artist"),
> - [vlc_meta_DiscNumber] = N_("DiscNumber")
> + [vlc_meta_DiscNumber] = N_("DiscNumber"),
> + [vlc_meta_Composer] = N_("Composer")
> };
>
> assert (meta_type < (sizeof(posix_names) / sizeof(posix_names[0])));
> --
> 2.1.3
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list