+#define input_item_SetTitle( item, b ) input_item_SetMeta( item, vlc_meta_Title, b )
+#define input_item_SetArtist( item, b ) input_item_SetMeta( item, vlc_meta_Artist, b )
+#define input_item_SetGenre( item, b ) input_item_SetMeta( item, vlc_meta_Genre, b )
+#define input_item_SetCopyright( item, b ) input_item_SetMeta( item, vlc_meta_Copyright, b )
+#define input_item_SetAlbum( item, b ) input_item_SetMeta( item, vlc_meta_Album, b )
+#define input_item_SetTrackNum( item, b ) input_item_SetMeta( item, vlc_meta_TrackNumber, b )
+#define input_item_SetDescription( item, b ) input_item_SetMeta( item, vlc_meta_Description, b )
+#define input_item_SetRating( item, b ) input_item_SetMeta( item, vlc_meta_Rating, b )
+#define input_item_SetDate( item, b ) input_item_SetMeta( item, vlc_meta_Date, b )
+#define input_item_SetSetting( item, b ) input_item_SetMeta( item, vlc_meta_Setting, b )
+#define input_item_SetURL( item, b ) input_item_SetMeta( item, vlc_meta_URL, b )
+#define input_item_SetLanguage( item, b ) input_item_SetMeta( item, vlc_meta_Language, b )
+#define input_item_SetNowPlaying( item, b ) input_item_SetMeta( item, vlc_meta_NowPlaying, b )
+#define input_item_SetPublisher( item, b ) input_item_SetMeta( item, vlc_meta_Publisher, b )
+#define input_item_SetEncodedBy( item, b ) input_item_SetMeta( item, vlc_meta_EncodedBy, b )
+#define input_item_SetArtURL( item, b ) input_item_SetMeta( item, vlc_meta_ArtworkURL, b )
+#define input_item_SetTrackID( item, b ) input_item_SetMeta( item, vlc_meta_TrackID, b )
+
+#define input_item_GetTitle( item ) input_item_GetMeta( item, vlc_meta_Title )
+#define input_item_GetArtist( item ) input_item_GetMeta( item, vlc_meta_Artist )
+#define input_item_GetGenre( item ) input_item_GetMeta( item, vlc_meta_Genre )
+#define input_item_GetCopyright( item ) input_item_GetMeta( item, vlc_meta_Copyright )
+#define input_item_GetAlbum( item ) input_item_GetMeta( item, vlc_meta_Album )
+#define input_item_GetTrackNum( item ) input_item_GetMeta( item, vlc_meta_TrackNumber )
+#define input_item_GetDescription( item ) input_item_GetMeta( item, vlc_meta_Description )
+#define input_item_GetRating( item ) input_item_GetMeta( item, vlc_meta_Rating )
+#define input_item_GetDate( item ) input_item_GetMeta( item, vlc_meta_Date )
+#define input_item_GetGetting( item ) input_item_GetMeta( item, vlc_meta_Getting )
+#define input_item_GetURL( item ) input_item_GetMeta( item, vlc_meta_URL )
+#define input_item_GetLanguage( item ) input_item_GetMeta( item, vlc_meta_Language )
+#define input_item_GetNowPlaying( item ) input_item_GetMeta( item, vlc_meta_NowPlaying )
+#define input_item_GetPublisher( item ) input_item_GetMeta( item, vlc_meta_Publisher )
+#define input_item_GetEncodedBy( item ) input_item_GetMeta( item, vlc_meta_EncodedBy )
+#define input_item_GetArtURL( item ) input_item_GetMeta( item, vlc_meta_ArtworkURL )
+#define input_item_GetTrackID( item ) input_item_GetMeta( item, vlc_meta_TrackID )
+#define input_item_GetSetting( item ) input_item_GetMeta( item, vlc_meta_Setting )
+
+VLC_EXPORT( char *, input_ItemGetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) );
+VLC_EXPORT(int, input_ItemAddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) LIBVLC_FORMAT( 4, 5 ) );
+
+#define input_ItemNew( a,b,c ) input_ItemNewExt( a, b, c, 0, NULL, -1 )
+#define input_ItemNewExt(a,b,c,d,e,f) __input_ItemNewExt( VLC_OBJECT(a),b,c,d,e,f)
+VLC_EXPORT( input_item_t *, __input_ItemNewExt, (vlc_object_t *, const char *, const char*, int, const char *const *, mtime_t i_duration ) );
+VLC_EXPORT( input_item_t *, input_ItemNewWithType, ( vlc_object_t *, const char *, const char *e, int, const char *const *, mtime_t i_duration, int ) );
+
+#define input_ItemGetById(a,b) __input_ItemGetById( VLC_OBJECT(a),b )
+VLC_EXPORT( input_item_t *, __input_ItemGetById, (vlc_object_t *, int ) );
+
+/*****************************************************************************
+ * Meta data helpers
+ *****************************************************************************/
+static inline void vlc_audio_replay_gain_MergeFromMeta( audio_replay_gain_t *p_dst,
+ const vlc_meta_t *p_meta )
+{
+ char * psz_value;
+
+ if( !p_meta )
+ return;
+
+ if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_TRACK_GAIN" )) ||
+ (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_RADIO" )) )
+ {
+ p_dst->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = true;
+ p_dst->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+ }
+ else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_TRACK_PEAK" )) ||
+ (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_PEAK" )) )
+ {
+ p_dst->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = true;
+ p_dst->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+ }
+ else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_ALBUM_GAIN" )) ||
+ (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_AUDIOPHILE" )) )
+ {
+ p_dst->pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = true;
+ p_dst->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
+ }
+ else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_ALBUM_PEAK" )) )
+ {
+ p_dst->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = true;
+ p_dst->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
+ }
+}