]> git.sesse.net Git - vlc/commitdiff
* Add "Stream and media info panel" ( http/dialogs/main,
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 30 Jan 2006 17:33:05 +0000 (17:33 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 30 Jan 2006 17:33:05 +0000 (17:33 +0000)
  http/images/info.png, http/style.css, http/js/functions.js )

* Make instance playlist position consitent with position used in
  inputdeln (starts from 1 and not 0) ( src/misc/vlm.c, http/js/vlm.js )

* Make it possible to use "enter key" in some text boxes to confirm (*)

share/http/dialogs/main
share/http/dialogs/sout
share/http/dialogs/vlm
share/http/images/info.png [new file with mode: 0644]
share/http/js/functions.js
share/http/js/vlm.js
share/http/requests/status.xml
share/http/style.css
src/misc/vlm.c

index 67db9e0810c85515d632c9ba03d6abd0ffd01c51..3c54241589b6ecff1662687b17573bc7b6e65ceb 100644 (file)
@@ -71,6 +71,10 @@ sout and playlist .
       <img src="images/playlist.png" alt="Playlist" />
       <span class="btn_text">Playlist</span>
     </button>
+    <button id="btn_info" onclick="toggle_show('info');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Info" >
+      <img src="images/info.png" alt="Info" />
+      <span class="btn_text">Info</span>
+    </button>
     &nbsp;
     <button id="btn_fullscreen" onclick="fullscreen();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Fullscreen" >
       <img src="images/fullscreen.png" alt="Fullscreen" />
@@ -99,3 +103,14 @@ sout and playlist .
     <span id="nowplaying">(?)</span>
   </div>
 </div>
+
+<div id="info" class="dialog" style="display: none;" >
+  <div class="title">
+    Stream and media info
+    <button id="btn_info_hide" onclick="hide( 'info' );">
+      Hide
+    </button>
+  </div>
+  <div id="infotree">
+  </div>
+</div>
index 7f921667c1c67555d9753bff9ffc9533b201637a..27c1f2eae6a8d8c01aceb5d7bb860d7d7c359121 100644 (file)
@@ -33,12 +33,14 @@ Note that the sout chain is used and sent to VLC by the input dialog
   </div>
   <div class="controls">
     <label for="sout_mrl">Destination (MRL)</label>
-    <input type="text" name="sout_mrl" id="sout_mrl" size="60" />
-    <br/>
     <vlc id="if" param1="page value 'vlm' strcmp 0 =" />
+      <input type="text" name="sout_mrl" id="sout_mrl" size="60" onkeypress="if( event.keyCode == 13 ) vlm_output_change();"/>
+      <br/>
       <input type="submit" value="Ok" onclick="vlm_output_change();" />
       <input type="hidden" id="sout_dest" />
     <vlc id="else" />
+      <input type="text" name="sout_mrl" id="sout_mrl" size="60" onkeypress="if( event.keyCode == 13 ) save_sout();" />
+      <br/>
       <input type="submit" value="Save" onclick="save_sout();" />
     <vlc id="end" />
     <input type="button" value="Cancel" onclick="reset_sout();"/>
index d86e6ae298a589992ee1ae860c0f24ce9944eb65..24861401aa2440b85c841120e302034b3783974c 100644 (file)
@@ -39,7 +39,7 @@ sout and vlmelements .
   </div>
   <div class="controls">
     <label for="vlm_command">VLM command:</label>
-    <input type="text" id="vlm_command" size="60" />
+    <input type="text" id="vlm_command" size="60" onkeypress="if( event.keyCode == 13 ) vlm_send();" />
     <input type="button" value="Send" onclick="vlm_send();" />
     <br />
     <span id="vlm_error"></span>
diff --git a/share/http/images/info.png b/share/http/images/info.png
new file mode 100644 (file)
index 0000000..46dee72
Binary files /dev/null and b/share/http/images/info.png differ
index d4542b3c0e906e21761e34bbe468c1fb1512f01a..796ecd12e3187891395ea395f499a6f1aeca0a20 100644 (file)
@@ -238,6 +238,13 @@ function toggle_btn_text()
     }
 }
 
+function clear_children( elt )
+{   
+    if( elt )
+        while( elt.hasChildNodes() )
+            elt.removeChild( elt.firstChild );
+}
+
 /**********************************************************************
  * Interface actions
  *********************************************************************/
@@ -390,6 +397,36 @@ function parse_status()
                 document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Play' );
                 document.getElementById( 'btn_pause' ).setAttribute( 'title', 'Play' );
             }
+
+            var tree = document.createElement( "ul" );
+            var categories = status.getElementsByTagName( 'category' );
+            var i;
+            for( i = 0; i < categories.length; i++ )
+            {
+                var item = document.createElement( "li" );
+                item.appendChild( document.createTextNode( categories[i].getAttribute( 'name' ) ) );
+                var subtree = document.createElement( "dl" );
+                var infos = categories[i].getElementsByTagName( 'info' );
+                var j;
+                for( j = 0; j < infos.length; j++ )
+                {
+                    var subitem = document.createElement( "dt" );
+                    subitem.appendChild( document.createTextNode( infos[j].getAttribute( 'name' ) ) );
+                    subtree.appendChild( subitem );
+                    if( infos[j].hasChildNodes() )
+                    {
+                        var subitem = document.createElement( "dd" );
+                        subitem.appendChild( document.createTextNode( infos[j].firstChild.data ) );
+                        subtree.appendChild( subitem );
+                    }
+                }
+                item.appendChild( subtree );
+                tree.appendChild( item );
+            }
+            var infotree = document.getElementById('infotree' );
+            clear_children( infotree );
+            infotree.appendChild( tree );
+            
         }
         else
         {
index f5ffb520d986568bd1d32f47cae804876d4ba417..69e73dcab90322d8b53a0db1cdf63ac40e457da7 100644 (file)
@@ -260,13 +260,6 @@ function clear_vlm_add()
     document.getElementById( 'vlm_vod_name' ).value = "";
 }
 
-function clear_children( elt )
-{
-    if( elt )
-        while( elt.hasChildNodes() )
-            elt.removeChild( elt.firstChild );
-}
-
 function create_button( caption, action )
 {
     var link = document.createElement( "input" );
@@ -409,6 +402,7 @@ function parse_vlm_elements()
                     text.setAttribute( 'type', 'text' );
                     text.setAttribute( 'size', '40' );
                     text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_input' );
+                    text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_add_input("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_input").value );' );
                     item.appendChild( text );
                     item.appendChild( document.createTextNode( ' ' ) );
                     item.appendChild( create_button( 'Edit', 'vlm_input_edit("vlm_elt_'+elt.getAttribute('name')+'_input");') );
@@ -419,7 +413,7 @@ function parse_vlm_elements()
                     if( inputs.length > 0 )
                     {
                         var ilist = document.createElement( "ol" );
-                        ilist.setAttribute( 'start', '0' );
+                        ilist.setAttribute( 'start', '1' );
                         item.appendChild( ilist );
                         for( i = 0; i < inputs.length; i++ )
                         {
@@ -447,6 +441,7 @@ function parse_vlm_elements()
                     text.setAttribute( 'type', 'text' );
                     text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_output' );
                     text.setAttribute( 'value', output );
+                    text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 )  vlm_output("'+elt.getAttribute( 'name' )+ '",document.getElementById("vlm_elt_'+elt.getAttribute( 'name' )+'_output").value);' );
                     item.appendChild( text );
 
                     item.appendChild( document.createTextNode( ' ' ) );
@@ -466,6 +461,7 @@ function parse_vlm_elements()
                     text.setAttribute( 'type', 'text' );
                     text.setAttribute( 'size', '40' );
                     text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_option' );
+                    text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' );
                     item.appendChild( text );
                     item.appendChild( document.createTextNode( ' ' ) );
                     item.appendChild( create_button( 'Add option', 'vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ) );
index 202fac7e225db721f084a8fe3603fe9d87ab1aeb..d92bd64ab4cb7ac2375361e0968f1ff932b11304 100644 (file)
   <fullscreen><vlc id="if" param1="'VLC_OBJECT_VOUT' vlc_obj_exists" /><vlc id="value" param1="'fullscreen' 'VLC_OBJECT_VOUT' vlc_var_get" /><vlc id="end" /></fullscreen>
   <loop><vlc id="value" param1="'loop' 'VLC_OBJECT_PLAYLIST' vlc_var_get"/></loop>
   <repeat><vlc id="value" param1="'repeat' 'VLC_OBJECT_PLAYLIST' vlc_var_get" /></repeat>
+  <information>
+    <vlc id="foreach" param1="inf" param2="information" />
+      <category name="<vlc id="value" param1="inf.name" />">
+        <vlc id="foreach" param1="subinf" param2="inf.info" />
+          <info name="<vlc id="value" param1="subinf.name" />"><vlc id="value" param1="subinf.value" /></info>
+        <vlc id="end" />
+      </category>
+    <vlc id="end" />
+  </information>
 </root>
index 792158083f8d13b3b25088fb618a74f4799a17be..780528a0748655fd070e21ac5de9e2e8e1a17293 100644 (file)
@@ -106,6 +106,22 @@ div.list_element ul {
        margin: 0px;
 }
 
+div#infotree ul {
+       padding: 0.4em;
+       margin: 0em;
+}
+div#infotree li {
+       font-weight: bold;
+       font-size: 0.8em;
+}
+div#infotree dl {
+       font-weight: normal;
+       padding: 0em 1em;
+}
+div#infotree dt {
+       text-decoration: underline;
+}
+
 div.pl_node {
        padding-left: 20px;
        font-style: italic;
index ed2cbf6137e1c1d46b75ae1b8f32ce1a6df0b89d..22202037748cdcce0acf43150fa2eca802f0efdf 100644 (file)
@@ -1683,7 +1683,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media,
             APPEND_INPUT_INFO( "chapter", "%d", Integer );
             APPEND_INPUT_INFO( "seekable", "%d", Bool );
 #undef APPEND_INPUT_INFO
-            asprintf( &psz_tmp, "%d", p_instance->i_index );
+            asprintf( &psz_tmp, "%d", p_instance->i_index + 1 );
             vlm_MessageAdd( msg_instance, vlm_MessageNew( "playlistindex", psz_tmp ) );
             free( psz_tmp );
             vlm_MessageAdd( msg_child, msg_instance );