From 4e1bd47217b8bb255f8722b2d0356008c31f874b Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Mon, 26 Nov 2012 17:51:30 +0100 Subject: [PATCH] Export some #defines to lua scripts --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.c b/main.c index cbae3ad..eeec118 100644 --- a/main.c +++ b/main.c @@ -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));