[vlc-devel] [PATCH 1/2] input: Add support for AlbumArist meta
Uwe L. Korn
uwelk at xhochy.com
Sun Nov 23 00:01:17 CET 2014
---
include/vlc/libvlc_media.h | 3 ++-
include/vlc_meta.h | 5 ++++-
lib/media.c | 6 ++++--
modules/lua/libs/input.c | 1 +
src/input/meta.c | 3 ++-
5 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
index 948230a..9c2d383 100644
--- a/include/vlc/libvlc_media.h
+++ b/include/vlc/libvlc_media.h
@@ -73,7 +73,8 @@ typedef enum libvlc_meta_t {
libvlc_meta_Season,
libvlc_meta_Episode,
libvlc_meta_ShowName,
- libvlc_meta_Actors
+ libvlc_meta_Actors,
+ libvlc_meta_AlbumArtist
/* Add new meta types HERE */
} libvlc_meta_t;
diff --git a/include/vlc_meta.h b/include/vlc_meta.h
index c3bf801..290fa8b 100644
--- a/include/vlc_meta.h
+++ b/include/vlc_meta.h
@@ -55,9 +55,10 @@ typedef enum vlc_meta_type_t
vlc_meta_Episode,
vlc_meta_ShowName,
vlc_meta_Actors,
+ vlc_meta_AlbumArtist
} vlc_meta_type_t;
-#define VLC_META_TYPE_COUNT 23
+#define VLC_META_TYPE_COUNT 24
#define ITEM_PREPARSED 1
#define ITEM_ARTURL_FETCHED 2
@@ -137,6 +138,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
#define vlc_meta_SetEpisode( meta, b ) vlc_meta_Set( meta, vlc_meta_Episode, b )
#define vlc_meta_SetShowName( meta, b ) vlc_meta_Set( meta, vlc_meta_ShowName, b )
#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_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
#define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
@@ -160,6 +162,7 @@ VLC_API int input_item_WriteMeta(vlc_object_t *, input_item_t *);
#define VLC_META_EPISODE vlc_meta_TypeToLocalizedString( vlc_meta_Episode )
#define VLC_META_SHOW_NAME vlc_meta_TypeToLocalizedString( vlc_meta_ShowName )
#define VLC_META_ACTORS vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
+#define VLC_META_ALBUMARTIST vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
#define VLC_META_EXTRA_MB_ALBUMID "MB_ALBUMID"
diff --git a/lib/media.c b/lib/media.c
index 1f6fb9e..3caaf5b 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -68,7 +68,8 @@ static const vlc_meta_type_t libvlc_to_vlc_meta[] =
[libvlc_meta_Season] = vlc_meta_Season,
[libvlc_meta_Episode] = vlc_meta_Episode,
[libvlc_meta_ShowName] = vlc_meta_ShowName,
- [libvlc_meta_Actors] = vlc_meta_Actors
+ [libvlc_meta_Actors] = vlc_meta_Actors,
+ [libvlc_meta_AlbumArtist] = vlc_meta_AlbumArtist
};
static const libvlc_meta_t vlc_to_libvlc_meta[] =
@@ -95,7 +96,8 @@ static const libvlc_meta_t vlc_to_libvlc_meta[] =
[vlc_meta_Season] = libvlc_meta_Season,
[vlc_meta_Episode] = libvlc_meta_Episode,
[vlc_meta_ShowName] = libvlc_meta_ShowName,
- [vlc_meta_Actors] = libvlc_meta_Actors
+ [vlc_meta_Actors] = libvlc_meta_Actors,
+ [vlc_meta_AlbumArtist] = libvlc_meta_AlbumArtist
};
/**************************************************************************
diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index 6e76400..e754242 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -338,6 +338,7 @@ static int vlclua_input_item_set_meta( lua_State *L )
META_TYPE( Episode, "episode" )
META_TYPE( ShowName, "show_name" )
META_TYPE( Actors, "actors" )
+ META_TYPE( AlbumArtist, "album_artist" )
};
#undef META_TYPE
diff --git a/src/input/meta.c b/src/input/meta.c
index 9b17be4..e96b9ba 100644
--- a/src/input/meta.c
+++ b/src/input/meta.c
@@ -50,7 +50,7 @@ struct vlc_meta_t
/* FIXME bad name convention */
const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type )
{
- static const char posix_names[][17] =
+ static const char posix_names[][18] =
{
[vlc_meta_Title] = N_("Title"),
[vlc_meta_Artist] = N_("Artist"),
@@ -75,6 +75,7 @@ const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type )
[vlc_meta_Episode] = N_("Episode"),
[vlc_meta_ShowName] = N_("Show Name"),
[vlc_meta_Actors] = N_("Actors"),
+ [vlc_meta_AlbumArtist] = N_("Album Artist")
};
assert (meta_type < (sizeof(posix_names) / sizeof(posix_names[0])));
--
2.1.3
More information about the vlc-devel
mailing list