diff options
| author | Tess Eisenberger <github@teisen.be> | 2025-02-01 16:15:17 -0800 |
|---|---|---|
| committer | teisenbe <teisenbe@noreply.codeberg.org> | 2025-02-02 04:48:42 +0000 |
| commit | 1d485c97b0c03577a40b34fb762c76e98f417fa4 (patch) | |
| tree | 38e42bdf95e99d26f39a3a30499ae96d6f07c877 /src/tangara/lua/lua_controls.cpp | |
| parent | e8eaf3df10a896cb28e91cfc416b19303926a00a (diff) | |
| download | tangara-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/lua_controls.cpp')
| -rw-r--r-- | src/tangara/lua/lua_controls.cpp | 17 |
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 { |
