summaryrefslogtreecommitdiff
path: root/src/tangara/lua
diff options
context:
space:
mode:
authorTess Eisenberger <github@teisen.be>2025-02-01 16:15:17 -0800
committerteisenbe <teisenbe@noreply.codeberg.org>2025-02-02 04:48:42 +0000
commit1d485c97b0c03577a40b34fb762c76e98f417fa4 (patch)
tree38e42bdf95e99d26f39a3a30499ae96d6f07c877 /src/tangara/lua
parente8eaf3df10a896cb28e91cfc416b19303926a00a (diff)
downloadtangara-fw-1d485c97b0c03577a40b34fb762c76e98f417fa4.tar.gz
Add optional support for changing volume while locked
This adds a new Controls setting for adjusting the behavior when locked, and an option for allowing volume control.
Diffstat (limited to 'src/tangara/lua')
-rw-r--r--src/tangara/lua/lua_controls.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tangara/lua/lua_controls.cpp b/src/tangara/lua/lua_controls.cpp
index baf40891..87b7ca16 100644
--- a/src/tangara/lua/lua_controls.cpp
+++ b/src/tangara/lua/lua_controls.cpp
@@ -42,7 +42,24 @@ static auto controls_schemes(lua_State* L) -> int {
return 1;
}
+static auto locked_controls_schemes(lua_State* L) -> int {
+ lua_newtable(L);
+
+ lua_pushliteral(L, "Disabled");
+ lua_rawseti(
+ L, -2,
+ static_cast<int>(drivers::NvsStorage::LockedInputModes::kDisabled));
+
+ lua_pushliteral(L, "Volume Only");
+ lua_rawseti(
+ L, -2,
+ static_cast<int>(drivers::NvsStorage::LockedInputModes::kVolumeOnly));
+
+ return 1;
+}
+
static const struct luaL_Reg kControlsFuncs[] = {{"schemes", controls_schemes},
+ {"locked_schemes", locked_controls_schemes},
{NULL, NULL}};
static auto lua_controls(lua_State* state) -> int {