From c39242a24ab809b0050ccddf650ca05d79bfc8c3 Mon Sep 17 00:00:00 2001 From: rude Date: Mon, 14 Dec 2009 19:51:31 +0100 Subject: [PATCH] It's now possible to control individual sources. --- src/modules/audio/wrap_Audio.cpp | 41 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/modules/audio/wrap_Audio.cpp b/src/modules/audio/wrap_Audio.cpp index 1cdd3a197..0db875b59 100644 --- a/src/modules/audio/wrap_Audio.cpp +++ b/src/modules/audio/wrap_Audio.cpp @@ -101,25 +101,58 @@ namespace audio int w_stop(lua_State * L) { - instance->stop(); + if(lua_gettop(L) == 0) + { + instance->stop(); + } + else + { + Source * s = luax_checksource(L, 1); + s->stop(); + } return 0; } int w_pause(lua_State * L) { - instance->pause(); + if(lua_gettop(L) == 0) + { + instance->pause(); + } + else + { + Source * s = luax_checksource(L, 1); + s->pause(); + } + return 0; } int w_resume(lua_State * L) { - instance->resume(); + if(lua_gettop(L) == 0) + { + instance->resume(); + } + else + { + Source * s = luax_checksource(L, 1); + s->resume(); + } return 0; } int w_rewind(lua_State * L) { - instance->rewind(); + if(lua_gettop(L) == 0) + { + instance->rewind(); + } + else + { + Source * s = luax_checksource(L, 1); + s->rewind(); + } return 0; }