From 747e6131bc10bab7cd2300fbc228f8f490ffb9e8 Mon Sep 17 00:00:00 2001 From: lshems Date: Thu, 13 Jun 2019 17:07:07 +0200 Subject: [PATCH] Update api_model.cpp (#6492) Added carryTrim to input API's --- radio/src/lua/api_model.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 481bbf4b8..344b13101 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -335,8 +335,9 @@ Return input data for given input and line number * `switch` (number) input switch index * `curveType` (number) curve type (function, expo, custom curve) * `curveValue` (number) curve index + * `carryTrim` (boolean) input trims applied -@status current Introduced in 2.0.0, curveType/curveValue added in 2.3 +@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3 */ static int luaModelGetInput(lua_State *L) { @@ -354,6 +355,7 @@ static int luaModelGetInput(lua_State *L) lua_pushtableinteger(L, "switch", expo->swtch); lua_pushtableinteger(L, "curveType", expo->curve.type); lua_pushtableinteger(L, "curveValue", expo->curve.value); + lua_pushtableinteger(L, "carryTrim", expo->carryTrim); } else { lua_pushnil(L); @@ -372,7 +374,7 @@ Insert an Input at specified line @param value (table) input data, see model.getInput() -@status current Introduced in 2.0.0, curveType/curveValue added in 2.3 +@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3 */ static int luaModelInsertInput(lua_State *L) { @@ -413,6 +415,9 @@ static int luaModelInsertInput(lua_State *L) else if (!strcmp(key, "curveValue")) { expo->curve.value = luaL_checkinteger(L, -1); } + else if (!strcmp(key, "carryTrim")) { + expo->carryTrim= lua_toboolean(L, -1); + } } }