Commit 56d92ad2 authored by Antoine Cellerier's avatar Antoine Cellerier

* Add "Stream and media info panel" ( http/dialogs/main,

  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 (*)
parent ca1768de
...@@ -71,6 +71,10 @@ sout and playlist . ...@@ -71,6 +71,10 @@ sout and playlist .
<img src="images/playlist.png" alt="Playlist" /> <img src="images/playlist.png" alt="Playlist" />
<span class="btn_text">Playlist</span> <span class="btn_text">Playlist</span>
</button> </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; &nbsp;
<button id="btn_fullscreen" onclick="fullscreen();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Fullscreen" > <button id="btn_fullscreen" onclick="fullscreen();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Fullscreen" >
<img src="images/fullscreen.png" alt="Fullscreen" /> <img src="images/fullscreen.png" alt="Fullscreen" />
...@@ -99,3 +103,14 @@ sout and playlist . ...@@ -99,3 +103,14 @@ sout and playlist .
<span id="nowplaying">(?)</span> <span id="nowplaying">(?)</span>
</div> </div>
</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>
...@@ -33,12 +33,14 @@ Note that the sout chain is used and sent to VLC by the input dialog ...@@ -33,12 +33,14 @@ Note that the sout chain is used and sent to VLC by the input dialog
</div> </div>
<div class="controls"> <div class="controls">
<label for="sout_mrl">Destination (MRL)</label> <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 =" /> <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="submit" value="Ok" onclick="vlm_output_change();" />
<input type="hidden" id="sout_dest" /> <input type="hidden" id="sout_dest" />
<vlc id="else" /> <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();" /> <input type="submit" value="Save" onclick="save_sout();" />
<vlc id="end" /> <vlc id="end" />
<input type="button" value="Cancel" onclick="reset_sout();"/> <input type="button" value="Cancel" onclick="reset_sout();"/>
......
...@@ -39,7 +39,7 @@ sout and vlmelements . ...@@ -39,7 +39,7 @@ sout and vlmelements .
</div> </div>
<div class="controls"> <div class="controls">
<label for="vlm_command">VLM command:</label> <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();" /> <input type="button" value="Send" onclick="vlm_send();" />
<br /> <br />
<span id="vlm_error"></span> <span id="vlm_error"></span>
......
...@@ -238,6 +238,13 @@ function toggle_btn_text() ...@@ -238,6 +238,13 @@ function toggle_btn_text()
} }
} }
function clear_children( elt )
{
if( elt )
while( elt.hasChildNodes() )
elt.removeChild( elt.firstChild );
}
/********************************************************************** /**********************************************************************
* Interface actions * Interface actions
*********************************************************************/ *********************************************************************/
...@@ -390,6 +397,36 @@ function parse_status() ...@@ -390,6 +397,36 @@ function parse_status()
document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Play' ); document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Play' );
document.getElementById( 'btn_pause' ).setAttribute( 'title', '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 else
{ {
......
...@@ -260,13 +260,6 @@ function clear_vlm_add() ...@@ -260,13 +260,6 @@ function clear_vlm_add()
document.getElementById( 'vlm_vod_name' ).value = ""; document.getElementById( 'vlm_vod_name' ).value = "";
} }
function clear_children( elt )
{
if( elt )
while( elt.hasChildNodes() )
elt.removeChild( elt.firstChild );
}
function create_button( caption, action ) function create_button( caption, action )
{ {
var link = document.createElement( "input" ); var link = document.createElement( "input" );
...@@ -409,6 +402,7 @@ function parse_vlm_elements() ...@@ -409,6 +402,7 @@ function parse_vlm_elements()
text.setAttribute( 'type', 'text' ); text.setAttribute( 'type', 'text' );
text.setAttribute( 'size', '40' ); text.setAttribute( 'size', '40' );
text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_input' ); 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( text );
item.appendChild( document.createTextNode( ' ' ) ); item.appendChild( document.createTextNode( ' ' ) );
item.appendChild( create_button( 'Edit', 'vlm_input_edit("vlm_elt_'+elt.getAttribute('name')+'_input");') ); item.appendChild( create_button( 'Edit', 'vlm_input_edit("vlm_elt_'+elt.getAttribute('name')+'_input");') );
...@@ -419,7 +413,7 @@ function parse_vlm_elements() ...@@ -419,7 +413,7 @@ function parse_vlm_elements()
if( inputs.length > 0 ) if( inputs.length > 0 )
{ {
var ilist = document.createElement( "ol" ); var ilist = document.createElement( "ol" );
ilist.setAttribute( 'start', '0' ); ilist.setAttribute( 'start', '1' );
item.appendChild( ilist ); item.appendChild( ilist );
for( i = 0; i < inputs.length; i++ ) for( i = 0; i < inputs.length; i++ )
{ {
...@@ -447,6 +441,7 @@ function parse_vlm_elements() ...@@ -447,6 +441,7 @@ function parse_vlm_elements()
text.setAttribute( 'type', 'text' ); text.setAttribute( 'type', 'text' );
text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_output' ); text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_output' );
text.setAttribute( 'value', 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( text );
item.appendChild( document.createTextNode( ' ' ) ); item.appendChild( document.createTextNode( ' ' ) );
...@@ -466,6 +461,7 @@ function parse_vlm_elements() ...@@ -466,6 +461,7 @@ function parse_vlm_elements()
text.setAttribute( 'type', 'text' ); text.setAttribute( 'type', 'text' );
text.setAttribute( 'size', '40' ); text.setAttribute( 'size', '40' );
text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_option' ); 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( text );
item.appendChild( document.createTextNode( ' ' ) ); item.appendChild( document.createTextNode( ' ' ) );
item.appendChild( create_button( 'Add option', 'vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ) ); item.appendChild( create_button( 'Add option', 'vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ) );
......
...@@ -97,4 +97,13 @@ ...@@ -97,4 +97,13 @@
<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> <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> <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> <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> </root>
...@@ -106,6 +106,22 @@ div.list_element ul { ...@@ -106,6 +106,22 @@ div.list_element ul {
margin: 0px; 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 { div.pl_node {
padding-left: 20px; padding-left: 20px;
font-style: italic; font-style: italic;
......
...@@ -1683,7 +1683,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, ...@@ -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( "chapter", "%d", Integer );
APPEND_INPUT_INFO( "seekable", "%d", Bool ); APPEND_INPUT_INFO( "seekable", "%d", Bool );
#undef APPEND_INPUT_INFO #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 ) ); vlm_MessageAdd( msg_instance, vlm_MessageNew( "playlistindex", psz_tmp ) );
free( psz_tmp ); free( psz_tmp );
vlm_MessageAdd( msg_child, msg_instance ); vlm_MessageAdd( msg_child, msg_instance );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment