-- $LastChangedDate: 2011-03-17 19:59:52 -0400 (Thu, 17 Mar 2011) $
-- Macros written in Lua to expand C++ code for bindings between C++/Lua.
-- Avoid lua_/LUA_ which is reserved by Lua.

bindTable = {

class = "Sound",
typesig = nil,
luaCanInstantiate = false,

headers =
[[
#include "base/module.hh"
using namespace base;
#include "sound/module.hh"
using namespace sound;
]],

func_Play = {
    comments = "bool Sound:Play( filename, loop:bool, volume:fp )",
    code = [[
        const fp volume                       = POP_FP( L );
        const sound::defs::ePlayLoop playLoop = sound::defs::ePlayLoop( POP_BOOL( L ) );
        const Sample::Name sampleName         = POP_STRING( L );
        lua_pushboolean( L, GET_SOUND().Play( sampleName, playLoop, volume ) );
        return 1;  // stack items to return
    ]]
},

func_Stop = {
    comments = "Sound:Stop( filename )",
    code = [[
        const string filename = POP_STRING( L );
        GET_SOUND().Stop( filename );
    ]]
},

}
