diff --git a/modules/control/http.c b/modules/control/http.c index c921f7fec80c6f8d4db9a9a842c73dad7d813bf1..d7431bab758c0e05b90880ffce6928aa4cb6b5e2 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 03b5ebbd7cf343b842def76e198d225522e6e840..8f076bd0b16f470a822f8d32848e5b765f259aa5 100644 --- a/share/http/index.html +++ b/share/http/index.html @@ -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,fullscreen,keep,volume,sort" /> + <vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek,fullscreen,keep,volume,sort,move" /> <vlc id="set" param1="sout" param2="string" /> </head> <body> @@ -85,6 +85,14 @@ </form> </div> + <div class="sectitle">Move Item</div> + <div class="section"> + <form method="get" action=""> + Move the item number <input type="text" name="psz_pos" size="5" /> to <input type="text" name="psz_newpos" size="5" /> <input type="submit" name="control" value="move" /> + </form> + </div> + </div> + <div class="sectitle">VLC Playlist</div> <div class="section"> <form method="get" action=""> @@ -96,7 +104,7 @@ <option value="title">title</option> <option value="group">group</option> <option value="author">author</option> - <option value="Shuffle">Shuffle</option> + <option value="shuffle">shuffle</option> </select> with <select name="order"> <option value="0">normal order</option>