Seeking how i could get the currently played notes and instruments in a soundtrack module, i've landed on this page:
https://www.love2d.org/wiki/Source:tell
It seems a bit high-level for what i want to get, but i've noticed that the argument is optional (i was reading source at the same time).
Code: Select all
int w_Source_tell(lua_State *L)
{
Source *t = luax_checksource(L, 1);
const char *unit = luaL_optstring(L, 2, "seconds");
Source::Unit u;
t->getConstant(unit, u);
lua_pushnumber(L, t->tell(u));
return 1;
}
TimeUnit unit ("seconds")
The type of unit for the return value.
See you.