]> git.sesse.net Git - vlc/commitdiff
Provide more item meta data to HTTP RPN.
authorScott Lyons <scottalyons@Ringo-2.local>
Wed, 15 Oct 2008 00:40:28 +0000 (20:40 -0400)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Thu, 16 Oct 2008 15:28:10 +0000 (18:28 +0300)
Working on a few remote-control applications that require more details
about the files in the playlist and the currently playing file. Also
fixed the RPN module so that the fields listed as possible arguments
for vlc_get_meta actually matches the list of fields in the Developer's
wiki.

Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
modules/control/http/rpn.c
modules/control/http/util.c
share/http/requests/playlist.xml
share/http/requests/status.xml

index 75c62d16cb0818c5dbbcf1e2b2bcd5fdb529e3a5..32f715bd3a8cbfcf90bc1b85eb01fb3bdf563248 100644 (file)
@@ -1014,6 +1014,54 @@ void EvaluateRPN( intf_thread_t *p_intf, mvar_t  *vars,
                 {
                     psz_val = input_item_GetGenre( p_item );
                 }
+                else if( !strcmp( psz_meta, "COPYRIGHT" ) )
+                {
+                     psz_val = input_item_GetCopyright( p_item );
+                }
+                else if( !strcmp( psz_meta, "TRACK_NUMBER" ) )
+                {
+                    psz_val = input_item_GetTrackNum( p_item );
+                }
+                else if( !strcmp( psz_meta, "DESCRIPTION" ) )
+                {
+                    psz_val = input_item_GetDescription( p_item );
+                }
+                else if( !strcmp( psz_meta, "RATING" ) )
+                {
+                    psz_val = input_item_GetRating( p_item );
+                }
+                else if( !strcmp( psz_meta, "DATE" ) )
+                {
+                    psz_val = input_item_GetDate( p_item );
+                }
+                else if( !strcmp( psz_meta, "URL" ) )
+                {
+                    psz_val = input_item_GetURL( p_item );
+                }
+                else if( !strcmp( psz_meta, "LANGUAGE" ) )
+                {
+                    psz_val = input_item_GetLanguage( p_item );
+                }
+                else if( !strcmp( psz_meta, "NOW_PLAYING" ) )
+                {
+                    psz_val = input_item_GetNowPlaying( p_item );
+                }
+                else if( !strcmp( psz_meta, "PUBLISHER" ) )
+                {
+                    psz_val = input_item_GetPublisher( p_item );
+                }
+                else if( !strcmp( psz_meta, "ENCODED_BY" ) )
+                {
+                    psz_val = input_item_GetEncodedBy( p_item );
+                }
+                else if( !strcmp( psz_meta, "ART_URL" ) )
+                {
+                    psz_val = input_item_GetEncodedBy( p_item );
+                }
+                else if( !strcmp( psz_meta, "TRACK_ID" ) )
+                {
+                    psz_val = input_item_GetTrackID( p_item );
+                }
 #undef p_item
             }
             if( psz_val == NULL ) psz_val = strdup( "" );
index 65a36df6aedcc92a614ecd44086444f8d5cfa910..52cadd9b27a3c02e700cd23c737288f59847f04f 100644 (file)
@@ -384,10 +384,59 @@ void PlaylistListNode( intf_thread_t *p_intf, playlist_t *p_pl,
         else
             mvar_AppendNewVar( itm, "ro", "rw" );
 
-        sprintf( value, "%ld",
-                 (long) input_item_GetDuration( p_node->p_input ) );
+        sprintf( value, "%"PRId64, input_item_GetDuration( p_node->p_input ) );
         mvar_AppendNewVar( itm, "duration", value );
 
+        //Adding extra meta-information to each playlist item
+
+        psz = input_item_GetTitle( p_node->p_input );
+        mvar_AppendNewVar( itm, "title", psz );
+
+        psz = input_item_GetArtist( p_node->p_input );
+        mvar_AppendNewVar( itm, "artist", psz );
+
+        psz = input_item_GetGenre( p_node->p_input );
+        mvar_AppendNewVar( itm, "genre", psz );
+
+        psz = input_item_GetCopyright( p_node->p_input );
+        mvar_AppendNewVar( itm, "copyright", psz );
+
+        psz = input_item_GetAlbum( p_node->p_input );
+        mvar_AppendNewVar( itm, "album", psz );
+
+        psz = input_item_GetTrackNum( p_node->p_input );
+        mvar_AppendNewVar( itm, "track", psz );
+
+        psz = input_item_GetDescription( p_node->p_input );
+        mvar_AppendNewVar( itm, "description", psz );
+
+        psz = input_item_GetRating( p_node->p_input );
+        mvar_AppendNewVar( itm, "rating", psz );
+
+        psz = input_item_GetDate( p_node->p_input );
+        mvar_AppendNewVar( itm, "date", psz );
+
+        psz = input_item_GetURL( p_node->p_input );
+        mvar_AppendNewVar( itm, "url", psz );
+
+        psz = input_item_GetLanguage( p_node->p_input );
+        mvar_AppendNewVar( itm, "language", psz );
+
+        psz = input_item_GetNowPlaying( p_node->p_input );
+        mvar_AppendNewVar( itm, "now_playing", psz );
+
+        psz = input_item_GetPublisher( p_node->p_input );
+        mvar_AppendNewVar( itm, "publisher", psz );
+
+        psz = input_item_GetEncodedBy( p_node->p_input );
+        mvar_AppendNewVar( itm, "encoded_by", psz );
+
+        psz = input_item_GetArtURL( p_node->p_input );
+        mvar_AppendNewVar( itm, "art_url", psz );
+
+        psz = input_item_GetTrackID( p_node->p_input );
+        mvar_AppendNewVar( itm, "track_id", psz );
+
         mvar_AppendVar( s, itm );
     }
     else
index 5a3fb5c3169059366da84850700390627b93bd7b..46ecfb9715df25e8ad76e561e9cdd69c40b3e88d 100644 (file)
   <vlc id="end" />
   <vlc id="if" param1="pl.type value 'Node' strcmp" />
     <vlc id="rpn" param1="1 +" />
-    <leaf id="<vlc id="value" param1="pl.index" />" <vlc id="if" param1="pl.current" /> current="current" <vlc id="end" /> uri="<vlc id="value" param1="pl.uri xml_encode" />" name="<vlc id="value" param1="pl.name xml_encode" />" ro="<vlc id="value" param1="pl.ro" />" duration="<vlc id="value" param1="pl.duration" />" />
+    <leaf id="<vlc id="value" param1="pl.index" />" <vlc id="if" param1="pl.current" /> current="current" <vlc id="end" /> uri="<vlc id="value" param1="pl.uri xml_encode" />" name="<vlc id="value" param1="pl.name xml_encode" />" ro="<vlc id="value" param1="pl.ro" />" duration="<vlc id="value" param1="pl.duration" />">
+               <title><![CDATA[<vlc id="value" param1="pl.title xml_encode" />]]></title>
+               <artist><![CDATA[<vlc id="value" param1="pl.artist" xml_encode />]]></artist>
+               <genre><![CDATA[<vlc id="value" param1="pl.genre xml_encode" />]]></genre>
+               <copyright><![CDATA[<vlc id="value" param1="pl.copyright xml_encode" />]]></copyright>
+               <album><![CDATA[<vlc id="value" param1="pl.album xml_encode" />]]></album>
+               <track><![CDATA[<vlc id="value" param1="pl.track xml_encode" />]]></track>
+               <description><![CDATA[<vlc id="value" param1="pl.description xml_encode" />]]></description>
+               <rating><![CDATA[<vlc id="value" param1="pl.rating xml_encode" />]]></rating>
+               <date><![CDATA[<vlc id="value" param1="pl.date xml_encode" />]]></date>
+               <url><![CDATA[<vlc id="value" param1="pl.url xml_encode" />]]></url>
+               <language><![CDATA[<vlc id="value" param1="pl.language xml_encode" />]]></language>
+               <now_playing><![CDATA[<vlc id="value" param1="pl.now_playing xml_encode" />]]></now_playing>
+               <publisher><![CDATA[<vlc id="value" param1="pl.publisher xml_encode" />]]></publisher>
+               <encoded_by><![CDATA[<vlc id="value" param1="pl.encoded_by xml_encode" />]]></encoded_by>
+               <art_url><![CDATA[<vlc id="value" param1="pl.art_url xml_encode" />]]></art_url>
+               <track_id><![CDATA[<vlc id="value" param1="pl.track_id xml_encode" />]]></track_id>
+       </leaf>
   <vlc id="else" />
     <node id="<vlc id="value" param1="pl.index" />" name="<vlc id="value" param1="pl.name xml_encode" />" ro="<vlc id="value" param1="pl.ro" />" >
     <vlc id="if" param1="first_item value 0 ="/>
index c180fa293d1a03f8937aeb257742abd9c449a3a0..3dd459a0d55aa924d67df899c984cb597ed60665 100644 (file)
         <vlc id="end" />
       </category>
     <vlc id="end" />
-  </information>
+          <meta-information>
+                   <title><![CDATA[<vlc id="value" param1="'TITLE' vlc_get_meta xml_encode" />]]></title>
+                   <artist><![CDATA[<vlc id="value" param1="'ARTIST' vlc_get_meta xml_encode" />]]></artist>
+                   <genre><![CDATA[<vlc id="value" param1="'GENRE' vlc_get_meta xml_encode" />]]></genre>
+                   <copyright><![CDATA[<vlc id="value" param1="'COPYRIGHT' vlc_get_meta xml_encode" />]]></copyright>
+                   <album><![CDATA[<vlc id="value" param1="'ALBUM' vlc_get_meta xml_encode" />]]></album>
+                   <track><![CDATA[<vlc id="value" param1="'TRACK_NUMBER' vlc_get_meta xml_encode" />]]></track>
+                   <description><![CDATA[<vlc id="value" param1="'DESCRIPTION' vlc_get_meta xml_encode" />]]></description>
+                   <rating><![CDATA[<vlc id="value" param1="'RATING' vlc_get_meta xml_encode" />]]></rating>
+                   <date><![CDATA[<vlc id="value" param1="'DATE' vlc_get_meta xml_encode" />]]></date>
+                   <url><![CDATA[<vlc id="value" param1="'URL' vlc_get_meta xml_encode" />]]></url>
+                   <language><![CDATA[<vlc id="value" param1="'LANGUAGE' vlc_get_meta xml_encode" />]]></language>
+                   <now_playing><![CDATA[<vlc id="value" param1="'NOW_PLAYING' vlc_get_meta xml_encode" />]]></now_playing>
+                   <publisher><![CDATA[<vlc id="value" param1="'PUBLISHER' vlc_get_meta xml_encode" />]]></publisher>
+                   <encoded_by><![CDATA[<vlc id="value" param1="'ENCODED_BY' vlc_get_meta xml_encode" />]]></encoded_by>
+                   <art_url><![CDATA[<vlc id="value" param1="'ART_URL' vlc_get_meta xml_encode" />]]></art_url>
+                   <track_id><![CDATA[<vlc id="value" param1="'TRACK_ID' vlc_get_meta xml_encode" />]]></track_id>
+                   </meta-information>
+          </information>
   <stats>
     <readbytes><vlc id="value" param1="read_bytes" /></readbytes>
     <inputbitrate><vlc id="value" param1="input_bitrate" /></inputbitrate>