* http.c : http mini-server ;)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: http.c,v 1.27 2003/11/03 03:21:37 garf Exp $
+ * $Id: http.c,v 1.28 2003/11/04 15:52:52 garf Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
#include <vlc/vlc.h>
#include <vlc/intf.h>
+#include <vlc/vout.h> /* for fullscreen */
+
#include "httpd.h"
#ifdef HAVE_SYS_STAT_H
MVLC_DEL,
MVLC_EMPTY,
MVLC_SEEK,
+ MVLC_KEEP,
+ MVLC_FULLSCREEN,
MVLC_CLOSE,
MVLC_SHUTDOWN,
{ "next", MVLC_NEXT },
{ "previous", MVLC_PREVIOUS },
{ "seek", MVLC_SEEK },
+ { "keep", MVLC_KEEP },
+ { "fullscreen", MVLC_FULLSCREEN },
/* playlist management */
{ "add", MVLC_ADD },
p_sys->p_playlist->i_index - 1 );
msg_Dbg( p_intf, "requested playlist next" );
break;
+ case MVLC_FULLSCREEN:
+ if( p_sys->p_input )
+ {
+ vout_thread_t *p_vout;
+ p_vout = vlc_object_find( p_sys->p_input,
+ VLC_OBJECT_VOUT, FIND_CHILD );
+
+ if( p_vout )
+ {
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ vlc_object_release( p_vout );
+ }
+ }
+ break;
case MVLC_SEEK:
{
vlc_value_t val;
if( p_items ) free( p_items );
break;
}
+ case MVLC_KEEP:
+ {
+ int i_item, *p_items = NULL, i_nb_items = 0;
+ char item[512], *p_parser = p_request;
+ int i,j,temp;
+
+ /* Get the list of items to keep */
+ while( (p_parser =
+ uri_extract_value( p_parser, "item", item, 512 )) )
+ {
+ if( !*item ) continue;
+
+ i_item = atoi( item );
+ p_items = realloc( p_items, (i_nb_items + 3) *
+ sizeof(int) );
+ p_items[i_nb_items + 1] = i_item;
+ i_nb_items++;
+ }
+
+ /* sort item list */
+ for( i=1 ; i < (i_nb_items + 1) ; i++)
+ {
+ for( j=(i+1) ; j < (i_nb_items + 1) ; j++)
+ {
+ if( p_items[j] > p_items[i] )
+ {
+ temp = p_items[j];
+ p_items[j] = p_items[i];
+ p_items[i] = temp;
+ }
+ }
+ }
+
+ p_items[0] = p_sys->p_playlist->i_size;
+ p_items[ i_nb_items + 1 ] = -1;
+
+ /* The items need to be deleted from in reversed order */
+ for( i=0 ; i <= i_nb_items ; i++ )
+ {
+ for( j = (p_items[i] - 1) ; j > p_items[i + 1] ; j-- )
+ {
+ playlist_Delete( p_sys->p_playlist,
+ j );
+ msg_Dbg( p_intf, "requested playlist delete: %d",
+ j );
+ }
+ }
+
+ if( p_items ) free( p_items );
+ break;
+ }
case MVLC_EMPTY:
{
while( p_sys->p_playlist->i_size > 0 )
<meta http-equiv="refresh" content="0;URL=/" />
<vlc id="end" />
- <vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek" />
+ <vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek,fullscreen,keep" />
<vlc id="set" param1="sout" param2="string" />
</head>
<body>
<td><input type="submit" name="control" value="pause" /></td>
<td><input type="submit" name="control" value="previous" /></td>
<td><input type="submit" name="control" value="next" /></td>
- <td><input type="submit" name="control" value="empty" /></td>
+ <td><input type="submit" name="control" value="fullscreen" /></td>
<td><a href="info.html">Informations</a></td>
<td><a href="admin/">Administration</a></td>
</tr>
<div class="sectitle">VLC Playlist</div>
<div class="section">
+
<form method="get" action="">
<table>
<vlc id="foreach" param1="pl" param2="playlist" />
<vlc id="end" />
</table>
<td><input type="submit" name="control" value="delete" /></td>
+ <td><input type="submit" name="control" value="keep" /></td>
</form>
</div>
<hr/>