]> git.sesse.net Git - vlc/commitdiff
* http interface: added "fullscreen" and "keep" functions
authorSimon Latapie <garf@videolan.org>
Tue, 4 Nov 2003 15:52:52 +0000 (15:52 +0000)
committerSimon Latapie <garf@videolan.org>
Tue, 4 Nov 2003 15:52:52 +0000 (15:52 +0000)
modules/control/http.c
share/http/index.html

index 81cef3388ecf1ad25b741f0e0adad8abc4ca794d..1ab5a8a6c4c58ed0d83394b2e10a683e870ad151 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -37,6 +37,8 @@
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 
+#include <vlc/vout.h> /* for fullscreen */
+
 #include "httpd.h"
 
 #ifdef HAVE_SYS_STAT_H
@@ -1323,6 +1325,8 @@ enum macroType
         MVLC_DEL,
         MVLC_EMPTY,
         MVLC_SEEK,
+        MVLC_KEEP,
+        MVLC_FULLSCREEN,
 
         MVLC_CLOSE,
         MVLC_SHUTDOWN,
@@ -1355,6 +1359,8 @@ StrToMacroTypeTab [] =
         { "next",           MVLC_NEXT },
         { "previous",       MVLC_PREVIOUS },
         { "seek",           MVLC_SEEK },
+        { "keep",           MVLC_KEEP },
+        { "fullscreen",     MVLC_FULLSCREEN },
 
         /* playlist management */
         { "add",            MVLC_ADD },
@@ -1480,6 +1486,20 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
                                       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;
@@ -1550,6 +1570,57 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
                     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 )
index dacbabe306c127b35e70df845d769b8015650321..51b4631cd6a587b4cb851a4742702b0427194c4d 100644 (file)
@@ -10,7 +10,7 @@
         <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>
@@ -25,7 +25,7 @@
         <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>
@@ -59,6 +59,7 @@
   
     <div class="sectitle">VLC Playlist</div>
     <div class="section"> 
+
     <form method="get" action="">
      <table>
         <vlc id="foreach" param1="pl" param2="playlist" />
@@ -75,6 +76,7 @@
         <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/>