summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-09-11 22:27:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-09-11 22:27:34 +0300
commit9834746e6a7e5cf04a32273155265bc3a2f57180 (patch)
tree66366fe9d2f74b09cc70bed366ad7d6c542c94ad /plugins/MirLua/src
parent9a774c4e9e76e660c14a5f725252bbc275b13906 (diff)
old good sound services became finally functions
Diffstat (limited to 'plugins/MirLua/src')
-rw-r--r--plugins/MirLua/src/m_sounds.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp
index ea7c2a5e6a..b7e86b4c91 100644
--- a/plugins/MirLua/src/m_sounds.cpp
+++ b/plugins/MirLua/src/m_sounds.cpp
@@ -7,16 +7,7 @@ static int sounds_AddSound(lua_State *L)
ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE)));
ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4)));
- SKINSOUNDDESCEX ssd = { sizeof(SKINSOUNDDESCEX) };
- ssd.pszName = name;
- ssd.dwFlags = SSDF_UNICODE;
- ssd.pwszDescription = description;
- ssd.pwszSection = section;
- ssd.pwszDefaultFile = filePath;
-
- int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
-
- INT_PTR res = CallService("Skin/Sounds/AddNew", hScriptLangpack, (LPARAM)&ssd);
+ int res = Skin_AddSound(name, section, description, filePath, CMLuaScript::GetScriptIdFromEnviroment(L));
lua_pushboolean(L, res == 0);
return 1;
@@ -26,7 +17,7 @@ static int sounds_PlaySound(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
- INT_PTR res = SkinPlaySound(name);
+ INT_PTR res = Skin_PlaySound(name);
lua_pushboolean(L, res == 0);
return 1;
@@ -36,7 +27,7 @@ static int sounds_PlayFile(lua_State *L)
{
ptrW filePath(mir_utf8decodeW(luaL_checkstring(L, 1)));
- INT_PTR res = SkinPlaySoundFile(filePath);
+ INT_PTR res = Skin_PlaySoundFile(filePath);
lua_pushboolean(L, res == 0);
return 1;