From e13f2913dff71412b958e44014b76f3d7fbd6038 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 9 Aug 2014 18:04:48 +0200 Subject: [PATCH] Fixes #1540: added Lua playDuration() --- radio/src/lua.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 2d3a86011..f4fabfe20 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -283,6 +283,14 @@ static int luaPlayNumber(lua_State *L) return 0; } +static int luaPlayDuration(lua_State *L) +{ + int duration = luaL_checkinteger(L, 1); + bool playTime = (luaL_checkinteger(L, 2) != 0); + playDuration(duration, playTime ? PLAY_TIME : 0, 0); + return 0; +} + static int luaKillEvents(lua_State *L) { int event = luaL_checkinteger(L, 1); @@ -1363,6 +1371,7 @@ void luaInit() lua_register(L, "playFile", luaPlayFile); lua_register(L, "playNumber", luaPlayNumber); + lua_register(L, "playDuration", luaPlayDuration); lua_register(L, "popupInput", luaPopupInput); lua_register(L, "defaultStick", luaDefaultStick); lua_register(L, "defaultChannel", luaDefaultChannel);