Skip to content

Commit

Permalink
v2.0.4 update
Browse files Browse the repository at this point in the history
  • Loading branch information
cuinjune committed Dec 17, 2018
1 parent a35798c commit b5f062d
Show file tree
Hide file tree
Showing 18 changed files with 323 additions and 114 deletions.
7 changes: 5 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
v2.0.4: 17 Dec 2018

* fixed setTable method from Array class not working on Windows
* fixed crash issue when outputting large sized table through outlet
* fixed Array:setTable() bug on Windows
* renamed Array:getTable() and Array:setTable() to Array:get() and Array:set()
* added additional argument to Array:get() and Array:set() to set onset value
* fixed crashing issue when returning a large sized table as a list
* disabled printing the bug fix version on the pd console
* added "examples/pd/misc" example to show various pd objects emulation

v2.0.3: 23 Nov 2018

Expand Down
29 changes: 15 additions & 14 deletions Linux64External/src/ofeliaBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4002,23 +4002,24 @@ static int _wrap_Array_setAt(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Ar
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setAt",1,SWIGTYPE_p_Array); }
arg2 = (int)lua_tonumber(L, 2); { arg3 = static_cast<t_float>(lua_tonumber(L, 3)); } (arg1)->setAt(arg2,arg3);
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_getTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::getTable",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_getTable",1,SWIGTYPE_p_Array); }
(arg1)->getTable(arg2,arg3); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
static int _wrap_Array_get(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; int arg4 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::get",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::get",1,"Array *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("Array::get",2,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_get",1,SWIGTYPE_p_Array); }
arg4 = (int)lua_tonumber(L, 2); (arg1)->get(arg2,arg3,arg4); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
lua_pushnumber(L, static_cast<lua_Number>((*arg2)[i].w_float)); lua_rawseti(L, -2, i + 1); } SWIG_arg++; }
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_setTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; SWIG_check_num_args("Array::setTable",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::setTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setTable",1,SWIGTYPE_p_Array); }
{ if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
static int _wrap_Array_set(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; int arg4 ; SWIG_check_num_args("Array::set",3,3)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::set",1,"Array *"); if(!lua_isnumber(L,3)) SWIG_fail_arg("Array::set",3,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_set",1,SWIGTYPE_p_Array); } {
if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
arg2 = static_cast<lua_Integer>(lua_tointeger(L, -1)); if (!arg2) SWIG_exception(SWIG_RuntimeError, "table is empty");
arg3 = static_cast<t_float *>(getbytes(arg2 * sizeof(t_float))); for (int i = 0; i < arg2; ++i) { lua_pushinteger(L, i + 1);
lua_gettable(L, 2); if (lua_isnumber(L, -1)) arg3[i] = static_cast<t_float>(lua_tonumber(L, -1)); else
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } (arg1)->setTable(arg2,arg3); {
freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } arg4 = (int)lua_tonumber(L, 3);
(arg1)->set(arg2,arg3,arg4); { freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
freebytes(arg3, arg2 * sizeof(t_float)); } lua_error(L); return SWIG_arg; }
static int _wrap_Array_getSize(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int result;
SWIG_check_num_args("Array::getSize",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getSize",1,"Array *");
Expand Down Expand Up @@ -4050,8 +4051,8 @@ static swig_lua_method swig_Array_methods[]= {
{ "exists", _wrap_Array_exists},
{ "getAt", _wrap_Array_getAt},
{ "setAt", _wrap_Array_setAt},
{ "getTable", _wrap_Array_getTable},
{ "setTable", _wrap_Array_setTable},
{ "get", _wrap_Array_get},
{ "set", _wrap_Array_set},
{ "getSize", _wrap_Array_getSize},
{ "setSize", _wrap_Array_setSize},
{0,0}
Expand Down
17 changes: 11 additions & 6 deletions Linux64External/src/ofeliaBindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,23 +931,28 @@ class Array
garray_redraw(a);
}
}
void getTable(t_word **vecp, int *sizep)
void get(t_word **vecp, int *sizep, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
*vecp = vec;
*sizep = size;
if (onset < 0) onset = 0;
*vecp = vec + onset;
*sizep = size - onset;
}
}
void setTable(int n, t_floatarg *f)
void set(int n, t_floatarg *f, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
if (onset < 0) onset = 0;
for (int i = 0; i < n; ++i)
vec[i].w_float = f[i];
garray_resize_long(a, long(n));
{
int io = i + onset;
if (io < size) vec[io].w_float = f[i];
else break;
}
garray_redraw(a);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Linux64External/src/ofeliaBindings.i
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void lua_len(lua_State *L, int i)
freebytes(*$1, 2 * sizeof(int));
}

/* used for Array:getTable() */
/* used for Array:get() */
%typemap(in, numinputs = 0) (t_word **vecp, int *sizep)
(t_word *tmp = nullptr, int tsize = 0)
%{
Expand All @@ -279,7 +279,7 @@ static void lua_len(lua_State *L, int i)
SWIG_arg++;
}

/* used for Inlet:setFloatInlets() and Array:setTable() */
/* used for Inlet:setFloatInlets() and Array:set() */
%typemap(in) (int n, t_floatarg *f)
{
if (!lua_istable(L, $input))
Expand Down
29 changes: 15 additions & 14 deletions LinuxArmv6External/src/ofeliaBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4002,23 +4002,24 @@ static int _wrap_Array_setAt(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Ar
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setAt",1,SWIGTYPE_p_Array); }
arg2 = (int)lua_tonumber(L, 2); { arg3 = static_cast<t_float>(lua_tonumber(L, 3)); } (arg1)->setAt(arg2,arg3);
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_getTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::getTable",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_getTable",1,SWIGTYPE_p_Array); }
(arg1)->getTable(arg2,arg3); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
static int _wrap_Array_get(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; int arg4 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::get",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::get",1,"Array *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("Array::get",2,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_get",1,SWIGTYPE_p_Array); }
arg4 = (int)lua_tonumber(L, 2); (arg1)->get(arg2,arg3,arg4); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
lua_pushnumber(L, static_cast<lua_Number>((*arg2)[i].w_float)); lua_rawseti(L, -2, i + 1); } SWIG_arg++; }
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_setTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; SWIG_check_num_args("Array::setTable",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::setTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setTable",1,SWIGTYPE_p_Array); }
{ if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
static int _wrap_Array_set(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; int arg4 ; SWIG_check_num_args("Array::set",3,3)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::set",1,"Array *"); if(!lua_isnumber(L,3)) SWIG_fail_arg("Array::set",3,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_set",1,SWIGTYPE_p_Array); } {
if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
arg2 = static_cast<lua_Integer>(lua_tointeger(L, -1)); if (!arg2) SWIG_exception(SWIG_RuntimeError, "table is empty");
arg3 = static_cast<t_float *>(getbytes(arg2 * sizeof(t_float))); for (int i = 0; i < arg2; ++i) { lua_pushinteger(L, i + 1);
lua_gettable(L, 2); if (lua_isnumber(L, -1)) arg3[i] = static_cast<t_float>(lua_tonumber(L, -1)); else
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } (arg1)->setTable(arg2,arg3); {
freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } arg4 = (int)lua_tonumber(L, 3);
(arg1)->set(arg2,arg3,arg4); { freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
freebytes(arg3, arg2 * sizeof(t_float)); } lua_error(L); return SWIG_arg; }
static int _wrap_Array_getSize(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int result;
SWIG_check_num_args("Array::getSize",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getSize",1,"Array *");
Expand Down Expand Up @@ -4050,8 +4051,8 @@ static swig_lua_method swig_Array_methods[]= {
{ "exists", _wrap_Array_exists},
{ "getAt", _wrap_Array_getAt},
{ "setAt", _wrap_Array_setAt},
{ "getTable", _wrap_Array_getTable},
{ "setTable", _wrap_Array_setTable},
{ "get", _wrap_Array_get},
{ "set", _wrap_Array_set},
{ "getSize", _wrap_Array_getSize},
{ "setSize", _wrap_Array_setSize},
{0,0}
Expand Down
17 changes: 11 additions & 6 deletions LinuxArmv6External/src/ofeliaBindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,23 +931,28 @@ class Array
garray_redraw(a);
}
}
void getTable(t_word **vecp, int *sizep)
void get(t_word **vecp, int *sizep, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
*vecp = vec;
*sizep = size;
if (onset < 0) onset = 0;
*vecp = vec + onset;
*sizep = size - onset;
}
}
void setTable(int n, t_floatarg *f)
void set(int n, t_floatarg *f, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
if (onset < 0) onset = 0;
for (int i = 0; i < n; ++i)
vec[i].w_float = f[i];
garray_resize_long(a, long(n));
{
int io = i + onset;
if (io < size) vec[io].w_float = f[i];
else break;
}
garray_redraw(a);
}
}
Expand Down
4 changes: 2 additions & 2 deletions LinuxArmv6External/src/ofeliaBindings.i
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void lua_len(lua_State *L, int i)
freebytes(*$1, 2 * sizeof(int));
}

/* used for Array:getTable() */
/* used for Array:get() */
%typemap(in, numinputs = 0) (t_word **vecp, int *sizep)
(t_word *tmp = nullptr, int tsize = 0)
%{
Expand All @@ -279,7 +279,7 @@ static void lua_len(lua_State *L, int i)
SWIG_arg++;
}

/* used for Inlet:setFloatInlets() and Array:setTable() */
/* used for Inlet:setFloatInlets() and Array:set() */
%typemap(in) (int n, t_floatarg *f)
{
if (!lua_istable(L, $input))
Expand Down
29 changes: 15 additions & 14 deletions WindowsExternal/src/ofeliaBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4002,23 +4002,24 @@ static int _wrap_Array_setAt(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Ar
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setAt",1,SWIGTYPE_p_Array); }
arg2 = (int)lua_tonumber(L, 2); { arg3 = static_cast<t_float>(lua_tonumber(L, 3)); } (arg1)->setAt(arg2,arg3);
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_getTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::getTable",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_getTable",1,SWIGTYPE_p_Array); }
(arg1)->getTable(arg2,arg3); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
static int _wrap_Array_get(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; t_word **arg2 = (t_word **) 0 ;
int *arg3 = (int *) 0 ; int arg4 ; t_word *tmp2 = nullptr ; int tsize2 = 0 ; arg2 = &tmp2; arg3 = &tsize2;
SWIG_check_num_args("Array::get",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::get",1,"Array *");
if(!lua_isnumber(L,2)) SWIG_fail_arg("Array::get",2,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_get",1,SWIGTYPE_p_Array); }
arg4 = (int)lua_tonumber(L, 2); (arg1)->get(arg2,arg3,arg4); { lua_newtable(L); for (int i = 0; i < *arg3; ++i) {
lua_pushnumber(L, static_cast<lua_Number>((*arg2)[i].w_float)); lua_rawseti(L, -2, i + 1); } SWIG_arg++; }
return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
static int _wrap_Array_setTable(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; SWIG_check_num_args("Array::setTable",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::setTable",1,"Array *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_setTable",1,SWIGTYPE_p_Array); }
{ if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
static int _wrap_Array_set(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int arg2 ;
t_floatarg *arg3 = (t_floatarg *) 0 ; int arg4 ; SWIG_check_num_args("Array::set",3,3)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::set",1,"Array *"); if(!lua_isnumber(L,3)) SWIG_fail_arg("Array::set",3,"int");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Array,0))){ SWIG_fail_ptr("Array_set",1,SWIGTYPE_p_Array); } {
if (!lua_istable(L, 2)) SWIG_exception(SWIG_RuntimeError, "argument mismatch: table expected"); lua_len(L, 2);
arg2 = static_cast<lua_Integer>(lua_tointeger(L, -1)); if (!arg2) SWIG_exception(SWIG_RuntimeError, "table is empty");
arg3 = static_cast<t_float *>(getbytes(arg2 * sizeof(t_float))); for (int i = 0; i < arg2; ++i) { lua_pushinteger(L, i + 1);
lua_gettable(L, 2); if (lua_isnumber(L, -1)) arg3[i] = static_cast<t_float>(lua_tonumber(L, -1)); else
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } (arg1)->setTable(arg2,arg3); {
freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
SWIG_exception(SWIG_RuntimeError, "unhandled argument type"); } } arg4 = (int)lua_tonumber(L, 3);
(arg1)->set(arg2,arg3,arg4); { freebytes(arg3, arg2 * sizeof(t_float)); } return SWIG_arg; if(0) SWIG_fail; fail: {
freebytes(arg3, arg2 * sizeof(t_float)); } lua_error(L); return SWIG_arg; }
static int _wrap_Array_getSize(lua_State* L) { int SWIG_arg = 0; Array *arg1 = (Array *) 0 ; int result;
SWIG_check_num_args("Array::getSize",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Array::getSize",1,"Array *");
Expand Down Expand Up @@ -4050,8 +4051,8 @@ static swig_lua_method swig_Array_methods[]= {
{ "exists", _wrap_Array_exists},
{ "getAt", _wrap_Array_getAt},
{ "setAt", _wrap_Array_setAt},
{ "getTable", _wrap_Array_getTable},
{ "setTable", _wrap_Array_setTable},
{ "get", _wrap_Array_get},
{ "set", _wrap_Array_set},
{ "getSize", _wrap_Array_getSize},
{ "setSize", _wrap_Array_setSize},
{0,0}
Expand Down
17 changes: 11 additions & 6 deletions WindowsExternal/src/ofeliaBindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,23 +931,28 @@ class Array
garray_redraw(a);
}
}
void getTable(t_word **vecp, int *sizep)
void get(t_word **vecp, int *sizep, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
*vecp = vec;
*sizep = size;
if (onset < 0) onset = 0;
*vecp = vec + onset;
*sizep = size - onset;
}
}
void setTable(int n, t_floatarg *f)
void set(int n, t_floatarg *f, int onset)
{
t_garray *a; int size; t_word *vec;
if (exists(&a) && getData(a, &size, &vec))
{
if (onset < 0) onset = 0;
for (int i = 0; i < n; ++i)
vec[i].w_float = f[i];
garray_resize_long(a, long(n));
{
int io = i + onset;
if (io < size) vec[io].w_float = f[i];
else break;
}
garray_redraw(a);
}
}
Expand Down
4 changes: 2 additions & 2 deletions WindowsExternal/src/ofeliaBindings.i
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void lua_len(lua_State *L, int i)
freebytes(*$1, 2 * sizeof(int));
}

/* used for Array:getTable() */
/* used for Array:get() */
%typemap(in, numinputs = 0) (t_word **vecp, int *sizep)
(t_word *tmp = nullptr, int tsize = 0)
%{
Expand All @@ -279,7 +279,7 @@ static void lua_len(lua_State *L, int i)
SWIG_arg++;
}

/* used for Inlet:setFloatInlets() and Array:setTable() */
/* used for Inlet:setFloatInlets() and Array:set() */
%typemap(in) (int n, t_floatarg *f)
{
if (!lua_istable(L, $input))
Expand Down
Loading

0 comments on commit b5f062d

Please sign in to comment.