mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CLuaInstance: Fix commit 9e331ee4e3
This commit is contained in:
@@ -90,8 +90,14 @@ int CLuaInstMisc::MiscNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::strFind(lua_State *L)
|
int CLuaInstMisc::strFind(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3 or 4))\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3 or 4))\n", __func__, numargs);
|
||||||
@@ -124,8 +130,14 @@ int CLuaInstMisc::strFind(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::strSub(lua_State *L)
|
int CLuaInstMisc::strSub(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3))\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3))\n", __func__, numargs);
|
||||||
@@ -150,8 +162,14 @@ int CLuaInstMisc::strSub(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::enableInfoClock(lua_State *L)
|
int CLuaInstMisc::enableInfoClock(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -222,8 +240,14 @@ int CLuaInstMisc::isMuted(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::runScriptExt(lua_State *L)
|
int CLuaInstMisc::runScriptExt(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
const char *script = luaL_checkstring(L, 2);
|
const char *script = luaL_checkstring(L, 2);
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
@@ -242,8 +266,14 @@ int CLuaInstMisc::runScriptExt(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::GetRevision(lua_State *L)
|
int CLuaInstMisc::GetRevision(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
unsigned int rev = 0;
|
unsigned int rev = 0;
|
||||||
std::string hw = "";
|
std::string hw = "";
|
||||||
#if HAVE_COOL_HARDWARE
|
#if HAVE_COOL_HARDWARE
|
||||||
@@ -257,8 +287,14 @@ int CLuaInstMisc::GetRevision(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::checkVersion(lua_State *L)
|
int CLuaInstMisc::checkVersion(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaMisc *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
||||||
|
@@ -85,8 +85,14 @@ int CLuaInstVideo::VideoNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::setBlank(lua_State *L)
|
int CLuaInstVideo::setBlank(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -97,8 +103,14 @@ int CLuaInstVideo::setBlank(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::ShowPicture(lua_State *L)
|
int CLuaInstVideo::ShowPicture(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
const char *fname = luaL_checkstring(L, 2);
|
const char *fname = luaL_checkstring(L, 2);
|
||||||
CFrameBuffer::getInstance()->showFrame(fname);
|
CFrameBuffer::getInstance()->showFrame(fname);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -106,16 +118,28 @@ int CLuaInstVideo::ShowPicture(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::StopPicture(lua_State *L)
|
int CLuaInstVideo::StopPicture(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
CFrameBuffer::getInstance()->stopFrame();
|
CFrameBuffer::getInstance()->stopFrame();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstVideo::PlayFile(lua_State *L)
|
int CLuaInstVideo::PlayFile(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D = NULL;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
LUA_DEBUG("CLuaInstVideo::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstVideo::%s %d\n", __func__, lua_gettop(L));
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
@@ -155,8 +179,14 @@ int CLuaInstVideo::PlayFile(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
bool stop = true;
|
bool stop = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -172,8 +202,14 @@ int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::channelRezap(lua_State *L)
|
int CLuaInstVideo::channelRezap(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
CNeutrinoApp::getInstance()->channelRezap();
|
CNeutrinoApp::getInstance()->channelRezap();
|
||||||
if (CNeutrinoApp::getInstance()->getMode() == CNeutrinoApp::mode_radio)
|
if (CNeutrinoApp::getInstance()->getMode() == CNeutrinoApp::mode_radio)
|
||||||
CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
|
CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
|
||||||
@@ -182,8 +218,14 @@ int CLuaInstVideo::channelRezap(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
/* workaround for deprecated functions */
|
||||||
if (!D) return 0;
|
CLuaVideo *D;
|
||||||
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
||||||
|
D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
}
|
||||||
|
/* CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0; */
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 2) {
|
if (numargs < 2) {
|
||||||
printf("CLuaInstVideo::%s: no arguments\n", __func__);
|
printf("CLuaInstVideo::%s: no arguments\n", __func__);
|
||||||
|
Reference in New Issue
Block a user