From 2aac6bb66eec7f69627d8c157800c2f6759aa98b Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 7 Dec 2015 19:13:09 +0000 Subject: MirLua: added PlayFile in m_sound git-svn-id: http://svn.miranda-ng.org/main/trunk@15830 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_sound.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/MirLua/src/m_sound.cpp b/plugins/MirLua/src/m_sound.cpp index 00b3bdf963..3411f72971 100644 --- a/plugins/MirLua/src/m_sound.cpp +++ b/plugins/MirLua/src/m_sound.cpp @@ -32,11 +32,23 @@ static int lua_Play(lua_State *L) return 1; } +static int lua_PlayFile(lua_State *L) +{ + const char *path = luaL_checkstring(L, 1); + + INT_PTR res = SkinPlaySoundFile(ptrT(mir_utf8decodeT(path))); + lua_pushnumber(L, res); + + return 1; +} + static luaL_Reg soundApi[] = { { "Add", lua_Add }, { "Play", lua_Play }, + { "PlayFile", lua_PlayFile }, + { NULL, NULL } }; -- cgit v1.2.3