From c4ec089a90ae4a61a50a03cf8338d63488edfd62 Mon Sep 17 00:00:00 2001 From: ailurux Date: Tue, 17 Sep 2024 11:56:19 +1000 Subject: Added lua methods to access track data --- src/tangara/lua/property.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/tangara/lua/property.cpp') diff --git a/src/tangara/lua/property.cpp b/src/tangara/lua/property.cpp index 1be1fd2d..847bbe15 100644 --- a/src/tangara/lua/property.cpp +++ b/src/tangara/lua/property.cpp @@ -19,6 +19,7 @@ #include "lauxlib.h" #include "lua.h" #include "lua.hpp" +#include "lua/lua_database.hpp" #include "lua/lua_thread.hpp" #include "lvgl.h" #include "memory_resource.hpp" @@ -240,29 +241,6 @@ auto Property::set(const LuaValue& val) -> bool { return true; } -static auto pushTagValue(lua_State* L, const database::TagValue& val) -> void { - std::visit( - [&](auto&& arg) { - using T = std::decay_t; - if constexpr (std::is_same_v) { - lua_pushlstring(L, arg.data(), arg.size()); - } else if constexpr (std::is_same_v< - T, std::span>) { - lua_createtable(L, 0, arg.size()); - for (const auto& i : arg) { - lua_pushlstring(L, i.data(), i.size()); - lua_pushboolean(L, true); - lua_rawset(L, -3); - } - } else if constexpr (std::is_same_v) { - lua_pushinteger(L, arg); - } else { - lua_pushnil(L); - } - }, - val); -} - static void pushTrack(lua_State* L, const audio::TrackInfo& track) { lua_newtable(L); -- cgit v1.2.3