From 34cae4e6e4bb00b3453bcdab084368a949c908a4 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 5 Jan 2024 10:38:35 +1100 Subject: add an alerts module for lua, and implement a volume indicator with it --- src/lua/stubs/alerts.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/lua/stubs/alerts.lua (limited to 'src/lua/stubs/alerts.lua') diff --git a/src/lua/stubs/alerts.lua b/src/lua/stubs/alerts.lua new file mode 100644 index 00000000..9b541d84 --- /dev/null +++ b/src/lua/stubs/alerts.lua @@ -0,0 +1,13 @@ +--- Module for interacting with playback volume. The Bluetooth and wired outputs store their current volume separately; this API only allows interacting with the volume of the currently used output device. +-- @module alerts + +local alerts = {} + +--- Returns the current volume as a percentage of the current volume limit. +-- @tparam function constructor Called to create the UI for the alert. A new default root object and group will be set before calling this function.i Alerts are non-interactable; the group created for the constructor will not be granted focus. +function alerts.show(constructor) end + +--- Dismisses any visible alerts, removing them from the screen. +function alerts.hide() end + +return alerts -- cgit v1.2.3