diff options
Diffstat (limited to 'apps/plugins/lua/rocklib.c')
-rw-r--r-- | apps/plugins/lua/rocklib.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 1d20989009..9518fe955b 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "lauxlib.h" | 30 | #include "lauxlib.h" |
31 | #include "rocklib.h" | 31 | #include "rocklib.h" |
32 | #include "lib/helper.h" | 32 | #include "lib/helper.h" |
33 | #include "lib/pluginlib_actions.h" | ||
34 | 33 | ||
35 | /* | 34 | /* |
36 | * http://www.lua.org/manual/5.1/manual.html#lua_CFunction | 35 | * http://www.lua.org/manual/5.1/manual.html#lua_CFunction |
@@ -88,19 +87,9 @@ RB_WRAP(current_path) | |||
88 | 87 | ||
89 | RB_WRAP(get_plugin_action) | 88 | RB_WRAP(get_plugin_action) |
90 | { | 89 | { |
91 | static const struct button_mapping *m1[] = { pla_main_ctx }; | ||
92 | int timeout = luaL_checkint(L, 1); | 90 | int timeout = luaL_checkint(L, 1); |
93 | int btn; | ||
94 | |||
95 | #ifdef HAVE_REMOTE_LCD | ||
96 | static const struct button_mapping *m2[] = { pla_main_ctx, pla_remote_ctx }; | ||
97 | bool with_remote = luaL_optint(L, 2, 0); | 91 | bool with_remote = luaL_optint(L, 2, 0); |
98 | if (with_remote) | 92 | int btn = get_plugin_action(timeout, with_remote); |
99 | btn = pluginlib_getaction(timeout, m2, 2); | ||
100 | else | ||
101 | #endif | ||
102 | btn = pluginlib_getaction(timeout, m1, 1); | ||
103 | |||
104 | lua_pushinteger(L, btn); | 93 | lua_pushinteger(L, btn); |
105 | return 1; | 94 | return 1; |
106 | } | 95 | } |
@@ -829,6 +818,14 @@ LUALIB_API int luaopen_rock(lua_State *L) | |||
829 | RB_CONSTANT(PLAYLIST_PREPEND), | 818 | RB_CONSTANT(PLAYLIST_PREPEND), |
830 | RB_CONSTANT(PLAYLIST_REPLACE), | 819 | RB_CONSTANT(PLAYLIST_REPLACE), |
831 | 820 | ||
821 | /* queue sys events */ | ||
822 | RB_CONSTANT(SYS_USB_CONNECTED), | ||
823 | RB_CONSTANT(SYS_USB_DISCONNECTED), | ||
824 | RB_CONSTANT(SYS_TIMEOUT), | ||
825 | RB_CONSTANT(SYS_POWEROFF), | ||
826 | RB_CONSTANT(SYS_CHARGER_CONNECTED), | ||
827 | RB_CONSTANT(SYS_CHARGER_DISCONNECTED), | ||
828 | |||
832 | #ifdef HAVE_TOUCHSCREEN | 829 | #ifdef HAVE_TOUCHSCREEN |
833 | RB_CONSTANT(TOUCHSCREEN_POINT), | 830 | RB_CONSTANT(TOUCHSCREEN_POINT), |
834 | RB_CONSTANT(TOUCHSCREEN_BUTTON), | 831 | RB_CONSTANT(TOUCHSCREEN_BUTTON), |