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
1 changed files with 10 additions and 0 deletions

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));