|
@@ -289,6 +289,19 @@ int w_Source_getRolloff(lua_State *L)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int w_Source_getType(lua_State *L)
|
|
|
+{
|
|
|
+ Source *t = luax_checksource(L, 1);
|
|
|
+ Source::Type stype = t->getType();
|
|
|
+ const char *typestr;
|
|
|
+
|
|
|
+ if (!Source::getConstant(stype, typestr))
|
|
|
+ return luaL_error(L, "Unknown Source type.");
|
|
|
+
|
|
|
+ lua_pushstring(L, typestr);
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
static const luaL_Reg functions[] =
|
|
|
{
|
|
|
{ "play", w_Source_play },
|
|
@@ -324,6 +337,8 @@ static const luaL_Reg functions[] =
|
|
|
{ "setRolloff", w_Source_setRolloff},
|
|
|
{ "getRolloff", w_Source_getRolloff},
|
|
|
|
|
|
+ { "getType", w_Source_getType },
|
|
|
+
|
|
|
{ 0, 0 }
|
|
|
};
|
|
|
|