Index: apps/plugin.h =================================================================== --- apps/plugin.h (révision 22699) +++ apps/plugin.h (copie de travail) @@ -837,6 +837,9 @@ const char *appsversion; /* new stuff at the end, sort into place next time the API gets incompatible */ + void (*pcmbuf_beep)(unsigned int frequency, + size_t duration, + int amplitude); }; /* plugin header */ Index: apps/plugin.c =================================================================== --- apps/plugin.c (révision 22699) +++ apps/plugin.c (copie de travail) @@ -39,6 +39,7 @@ #include "talk.h" #include "version.h" #include "storage.h" +#include "pcmbuf.h" #if CONFIG_CHARGING #include "power.h" @@ -669,6 +670,7 @@ appsversion, /* new stuff at the end, sort into place next time the API gets incompatible */ + pcmbuf_beep, }; int plugin_load(const char* plugin, const void* parameter) Index: apps/plugins/lua/rocklib.c =================================================================== --- apps/plugins/lua/rocklib.c (révision 22699) +++ apps/plugins/lua/rocklib.c (copie de travail) @@ -413,6 +413,15 @@ return 1; } +RB_WRAP(beep) +{ + int frequency = luaL_checkint(L, 1); + int duration = luaL_checkint(L, 2); + int amplitude = luaL_checkint(L, 3); + rb->pcmbuf_beep(frequency, duration, amplitude); + return 0; +} + #ifdef HAVE_TOUCHSCREEN RB_WRAP(touchscreen_set_mode) { @@ -568,6 +577,7 @@ R(touchscreen_set_mode), #endif R(kbd_input), + R(beep), R(font_getstringsize), R(read_bmp_file),