From d06bfc8aadebbd5e79d183a98095fe227964abef Mon Sep 17 00:00:00 2001 From: Xavier Martin Date: Tue, 16 Mar 2004 10:55:02 +0000 Subject: [PATCH] Move playlist item in the interface http --- modules/control/http.c | 18 +++++++++++++++++- share/http/index.html | 12 ++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/modules/control/http.c b/modules/control/http.c index c921f7fec8..d7431bab75 100644 --- a/modules/control/http.c +++ b/modules/control/http.c @@ -1254,6 +1254,7 @@ enum macroType MVLC_SEEK, MVLC_KEEP, MVLC_SORT, + MVLC_MOVE, MVLC_VOLUME, MVLC_FULLSCREEN, @@ -1297,6 +1298,7 @@ StrToMacroTypeTab [] = { "delete", MVLC_DEL }, { "empty", MVLC_EMPTY }, { "sort", MVLC_SORT }, + { "move", MVLC_MOVE }, /* admin control */ { "close", MVLC_CLOSE }, @@ -1798,7 +1800,7 @@ static void MacroDo( httpd_file_sys_t *p_args, { playlist_SortAuthor( p_sys->p_playlist , i_order ); msg_Dbg( p_intf, "requested playlist sort by author (%d)" , i_order ); - } else if( !strcmp( type , "Shuffle" ) ) + } else if( !strcmp( type , "shuffle" ) ) { playlist_Sort( p_sys->p_playlist , SORT_RANDOM, ORDER_NORMAL ); msg_Dbg( p_intf, "requested playlist shuffle"); @@ -1806,6 +1808,20 @@ static void MacroDo( httpd_file_sys_t *p_args, break; } + case MVLC_MOVE: + { + char psz_pos[6]; + char psz_newpos[6]; + int i_pos; + int i_newpos; + uri_extract_value( p_request, "psz_pos", psz_pos, 6 ); + uri_extract_value( p_request, "psz_newpos", psz_newpos, 6 ); + i_pos = atoi( psz_pos ); + i_newpos = atoi( psz_newpos ); + playlist_Move( p_sys->p_playlist, i_pos, i_newpos + 1 ); + msg_Dbg( p_intf, "requested move playlist item %d to %d", i_pos, i_newpos); + break; + } /* admin function */ case MVLC_CLOSE: diff --git a/share/http/index.html b/share/http/index.html index 03b5ebbd7c..8f076bd0b1 100644 --- a/share/http/index.html +++ b/share/http/index.html @@ -10,7 +10,7 @@ - + @@ -85,6 +85,14 @@ +
Move Item
+
+
+ Move the item number to +
+
+ +
VLC Playlist
@@ -96,7 +104,7 @@ - + with