Export some #defines to lua scripts

This commit is contained in:
Thomas Kolb 2012-11-26 17:51:30 +01:00
parent 1ed1717c62
commit 4e1bd47217

10
main.c
View file

@ -176,6 +176,16 @@ int main(int argc, char **argv) {
if(!lua_isnumber(L, -1)) return 2;
int center_module = lua_tointeger(L, -1);
// export some global constants
lua_pushnumber(L, SAMPLE_RATE);
lua_setglobal(L, "SAMPLE_RATE");
lua_pushnumber(L, BLOCK_LEN);
lua_setglobal(L, "BLOCK_LEN");
lua_pushnumber(L, DATALEN);
lua_setglobal(L, "DATALEN");
// allocate arrays
red = malloc(num_modules * sizeof(double));
green = malloc(num_modules * sizeof(double));