From 02954cd40bf36082a63b56eb5211bd27f5f0b4c4 Mon Sep 17 00:00:00 2001 From: Tom Kirchner Date: Tue, 31 Dec 2024 17:02:40 -0800 Subject: [PATCH] Expose more properties to Lua for UI --- src/tangara/lua/property.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/tangara/lua/property.cpp b/src/tangara/lua/property.cpp index 847bbe15..3302172f 100644 --- a/src/tangara/lua/property.cpp +++ b/src/tangara/lua/property.cpp @@ -265,6 +265,22 @@ static void pushTrack(lua_State* L, const audio::TrackInfo& track) { lua_pushliteral(L, "encoding"); lua_pushstring(L, codecs::StreamTypeToString(track.encoding).c_str()); lua_settable(L, -3); + + lua_pushliteral(L, "uri"); + lua_pushstring(L, track.uri.c_str()); + lua_settable(L, -3); + + lua_pushliteral(L, "sample_rate"); + lua_pushinteger(L, track.format.sample_rate); + lua_settable(L, -3); + + lua_pushliteral(L, "num_channels"); + lua_pushinteger(L, track.format.num_channels); + lua_settable(L, -3); + + lua_pushliteral(L, "bits_per_sample"); + lua_pushinteger(L, track.format.bits_per_sample); + lua_settable(L, -3); } static void pushDevice(lua_State* L,