Commit 9934897a authored by Kelly Anderson's avatar Kelly Anderson Committed by Antoine Cellerier

Change goto to gotoitem for lua 5.2 compatibility. Maintain lua 5.1 backwards compatibility.

OK, this patch should take into account the recommendations.
Signed-off-by: default avatarAntoine Cellerier <dionoea@videolan.org>
parent 44432d8f
...@@ -123,7 +123,7 @@ static int vlclua_playlist_random( lua_State * L ) ...@@ -123,7 +123,7 @@ static int vlclua_playlist_random( lua_State * L )
return i_ret; return i_ret;
} }
static int vlclua_playlist_goto( lua_State * L ) static int vlclua_playlist_gotoitem( lua_State * L )
{ {
int i_id = luaL_checkint( L, 1 ); int i_id = luaL_checkint( L, 1 );
playlist_t *p_playlist = vlclua_get_playlist_internal( L ); playlist_t *p_playlist = vlclua_get_playlist_internal( L );
...@@ -377,7 +377,8 @@ static const luaL_Reg vlclua_playlist_reg[] = { ...@@ -377,7 +377,8 @@ static const luaL_Reg vlclua_playlist_reg[] = {
{ "repeat_", vlclua_playlist_repeat }, // ... provide repeat_ too. { "repeat_", vlclua_playlist_repeat }, // ... provide repeat_ too.
{ "loop", vlclua_playlist_loop }, { "loop", vlclua_playlist_loop },
{ "random", vlclua_playlist_random }, { "random", vlclua_playlist_random },
{ "goto", vlclua_playlist_goto }, { "goto", vlclua_playlist_gotoitem },
{ "gotoitem", vlclua_playlist_gotoitem },
{ "add", vlclua_playlist_add }, { "add", vlclua_playlist_add },
{ "enqueue", vlclua_playlist_enqueue }, { "enqueue", vlclua_playlist_enqueue },
{ "get", vlclua_playlist_get }, { "get", vlclua_playlist_get },
......
...@@ -535,7 +535,7 @@ commands_ordered = { ...@@ -535,7 +535,7 @@ commands_ordered = {
{ "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } }; { "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } };
{ "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } }; { "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } };
{ "prev"; { func = skip2(vlc.playlist.prev); help = "previous playlist item" } }; { "prev"; { func = skip2(vlc.playlist.prev); help = "previous playlist item" } };
{ "goto"; { func = skip2(vlc.playlist.goto); help = "goto item at index" } }; { "goto"; { func = skip2(vlc.playlist.gotoitem); help = "goto item at index" ; aliases = { "gotoitem" } } };
{ "repeat"; { func = skip2(vlc.playlist.repeat_); args = "[on|off]"; help = "toggle playlist repeat" } }; { "repeat"; { func = skip2(vlc.playlist.repeat_); args = "[on|off]"; help = "toggle playlist repeat" } };
{ "loop"; { func = skip2(vlc.playlist.loop); args = "[on|off]"; help = "toggle playlist loop" } }; { "loop"; { func = skip2(vlc.playlist.loop); args = "[on|off]"; help = "toggle playlist loop" } };
{ "random"; { func = skip2(vlc.playlist.random); args = "[on|off]"; help = "toggle playlist random" } }; { "random"; { func = skip2(vlc.playlist.random); args = "[on|off]"; help = "toggle playlist random" } };
......
...@@ -93,14 +93,14 @@ processcommands = function () ...@@ -93,14 +93,14 @@ processcommands = function ()
if id == -1 then if id == -1 then
vlc.playlist.play() vlc.playlist.play()
else else
vlc.playlist.goto(id) vlc.playlist.gotoitem(id)
end end
elseif command == "pl_pause" then elseif command == "pl_pause" then
if vlc.playlist.status() == "stopped" then if vlc.playlist.status() == "stopped" then
if id == -1 then if id == -1 then
vlc.playlist.play() vlc.playlist.play()
else else
vlc.playlist.goto(id) vlc.playlist.gotoitem(id)
end end
else else
vlc.playlist.pause() vlc.playlist.pause()
......
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