From e12a68a74d9527d4becde122da4ff1ad6550564e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 5 Jan 2024 17:15:47 +1100 Subject: split lua stubs into one set for ldoc, and one set for lua-ls --- .luarc.json | 3 ++- config.ld | 4 +-- ldoc-stubs/alerts.lua | 13 ++++++++++ ldoc-stubs/backstack.lua | 13 ++++++++++ ldoc-stubs/bluetooth.lua | 13 ++++++++++ ldoc-stubs/database.lua | 59 +++++++++++++++++++++++++++++++++++++++++++++ ldoc-stubs/playback.lua | 19 +++++++++++++++ ldoc-stubs/power.lua | 18 ++++++++++++++ ldoc-stubs/queue.lua | 22 +++++++++++++++++ ldoc-stubs/types.lua | 35 +++++++++++++++++++++++++++ ldoc-stubs/volume.lua | 14 +++++++++++ luals-stubs/alerts.lua | 11 +++++++++ luals-stubs/backstack.lua | 11 +++++++++ luals-stubs/bluetooth.lua | 8 ++++++ luals-stubs/database.lua | 33 +++++++++++++++++++++++++ luals-stubs/playback.lua | 10 ++++++++ luals-stubs/power.lua | 10 ++++++++ luals-stubs/queue.lua | 11 +++++++++ luals-stubs/types.lua | 13 ++++++++++ luals-stubs/volume.lua | 8 ++++++ src/lua/stubs/alerts.lua | 13 ---------- src/lua/stubs/backstack.lua | 13 ---------- src/lua/stubs/bluetooth.lua | 14 ----------- src/lua/stubs/database.lua | 59 --------------------------------------------- src/lua/stubs/playback.lua | 15 ------------ src/lua/stubs/power.lua | 18 -------------- src/lua/stubs/queue.lua | 22 ----------------- src/lua/stubs/types.lua | 27 --------------------- src/lua/stubs/volume.lua | 14 ----------- 29 files changed, 325 insertions(+), 198 deletions(-) create mode 100644 ldoc-stubs/alerts.lua create mode 100644 ldoc-stubs/backstack.lua create mode 100644 ldoc-stubs/bluetooth.lua create mode 100644 ldoc-stubs/database.lua create mode 100644 ldoc-stubs/playback.lua create mode 100644 ldoc-stubs/power.lua create mode 100644 ldoc-stubs/queue.lua create mode 100644 ldoc-stubs/types.lua create mode 100644 ldoc-stubs/volume.lua create mode 100644 luals-stubs/alerts.lua create mode 100644 luals-stubs/backstack.lua create mode 100644 luals-stubs/bluetooth.lua create mode 100644 luals-stubs/database.lua create mode 100644 luals-stubs/playback.lua create mode 100644 luals-stubs/power.lua create mode 100644 luals-stubs/queue.lua create mode 100644 luals-stubs/types.lua create mode 100644 luals-stubs/volume.lua delete mode 100644 src/lua/stubs/alerts.lua delete mode 100644 src/lua/stubs/backstack.lua delete mode 100644 src/lua/stubs/bluetooth.lua delete mode 100644 src/lua/stubs/database.lua delete mode 100644 src/lua/stubs/playback.lua delete mode 100644 src/lua/stubs/power.lua delete mode 100644 src/lua/stubs/queue.lua delete mode 100644 src/lua/stubs/types.lua delete mode 100644 src/lua/stubs/volume.lua diff --git a/.luarc.json b/.luarc.json index eae0da56..a0e9e1b7 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,6 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "workspace.library": ["lib/luavgl/src", "src/lua/stubs"], + "workspace.library": ["lib/luavgl/src", "luals-stubs"], + "workspace.ignoreDir": ["ldoc-stubs"], "runtime.version": "Lua 5.4", } diff --git a/config.ld b/config.ld index a705ca05..e1c54172 100644 --- a/config.ld +++ b/config.ld @@ -1,3 +1,3 @@ -file = {'src/lua/stubs'} +file = {'ldoc-stubs'} project = "Tangara" -description = "Lua modules provided by Tangara's firmware" \ No newline at end of file +description = "Lua modules provided by Tangara's firmware" diff --git a/ldoc-stubs/alerts.lua b/ldoc-stubs/alerts.lua new file mode 100644 index 00000000..9b541d84 --- /dev/null +++ b/ldoc-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 diff --git a/ldoc-stubs/backstack.lua b/ldoc-stubs/backstack.lua new file mode 100644 index 00000000..d4807d37 --- /dev/null +++ b/ldoc-stubs/backstack.lua @@ -0,0 +1,13 @@ +--- Module for adding and removing screens from the system's backstack. +-- @module backstack + +local backstack = {} + +--- Pushes a new screen onto the backstack. +-- @tparam function constructor Called to create the UI for the new screen. A new default root object and group will be set before calling this function. The function provided should return a table holding any bindings used by this screen; the returned value is retained so long as this screen is present in the backstack. +function backstack.push(constructor) end + +--- Removes the currently active screen, and instead shows the screen underneath it on the backstack. Does nothing if this is the only existing screen. +function backstack.pop() end + +return backstack diff --git a/ldoc-stubs/bluetooth.lua b/ldoc-stubs/bluetooth.lua new file mode 100644 index 00000000..3160ef7e --- /dev/null +++ b/ldoc-stubs/bluetooth.lua @@ -0,0 +1,13 @@ +--- Properties and functions for handling Bluetooth connectivity +-- @module bluetooth +local bluetooth = {} + +--- Whether or not the Bluetooth stack is currently enabled. This property is writeable, and can be used to enable or disable Bluetooth. +-- @see types.Property +bluetooth.enabled = types.Property + +--- Whether or not there is an active connection to another Bluetooth device. +-- @see types.Property +bluetooth.connected = types.Property + +return bluetooth diff --git a/ldoc-stubs/database.lua b/ldoc-stubs/database.lua new file mode 100644 index 00000000..97359ab1 --- /dev/null +++ b/ldoc-stubs/database.lua @@ -0,0 +1,59 @@ +--- Module for accessing and updating data about the user's library of tracks. +-- @module database + +local database = {} + +--- Returns a list of all indexes in the database. +-- @treturn Array(Index) +function database.indexes() end + +--- An iterator is a userdata type that behaves like an ordinary Lua iterator. +-- @type Iterator +local Iterator = {} + +--- A TrackId is a unique identifier, representing a playable track in the +--- user's library. +-- @type TrackId +local TrackId = {} + +--- A record is an item within an Index, representing some value at a specific +--- depth. +-- @type Record +local Record = {} + +--- Gets the human-readable text representing this record. The `__tostring` +--- metatable function is an alias of this function. +-- @treturn string +function Record:title() end + +--- Returns the value that this record represents. This may be either a track +--- id, for records which uniquely identify a track, or it may be a new +--- Iterator representing the next level of depth for the current index. +--- +--- For example, each Record in the "All Albums" index corresponds to an entire +--- album of tracks; the 'contents' of such a Record is an iterator returning +--- each track in the album represented by the Record. The contents of each of +--- the returned 'track' Records would be a full Track, as there is no further +--- disambiguation needed. +-- @treturn TrackId|Iterator(Record) +function Record:contents() end + +--- An index is heirarchical, sorted, view of the tracks within the database. +--- For example, the 'All Albums' index contains, first, a sorted list of every +--- album name in the library. Then, at the second level of the index, a sorted +--- list of every track within each album. +-- @type Index +local Index = {} + +--- Gets the human-readable name of this index. This is typically something +--- like "All Albums", or "Albums by Artist". The `__tostring` metatable +--- function is an alias of this function. +-- @treturn string +function Index:name() end + +--- Returns a new iterator that can be used to access every record within the +--- first level of this index. +-- @treturn Iterator(Record) +function Index:iter() end + +return database diff --git a/ldoc-stubs/playback.lua b/ldoc-stubs/playback.lua new file mode 100644 index 00000000..07ed65f6 --- /dev/null +++ b/ldoc-stubs/playback.lua @@ -0,0 +1,19 @@ +--- Properties for interacting with the audio playback system +-- @module playback + +local playback = {} + +--- Whether or not any audio is *allowed* to be played. If there is a current track, then this is essentially an indicator of whether playback is paused or unpaused. +-- @see types.Property +playback.playing = types.Property + +--- Rich information about the currently playing track. +-- @see types.Property +-- @see types.Track +playback.track = types.Property + +--- The current playback position within the current track, in seconds. +-- @see types.Property +playback.position = types.Property + +return playback diff --git a/ldoc-stubs/power.lua b/ldoc-stubs/power.lua new file mode 100644 index 00000000..466cafed --- /dev/null +++ b/ldoc-stubs/power.lua @@ -0,0 +1,18 @@ +--- Properties and functions that deal with the device's battery and power state +-- @module power + +local power = {} + +--- The battery's current charge as a percentage +-- @see types.Property +power.battery_pct = types.Property + +--- The battery's current voltage, in millivolts. +-- @see types.Property +power.battery_millivolts = types.Property + +--- Whether or not the device is currently receiving external power +-- @see types.Property +power.plugged_in = types.Property + +return power diff --git a/ldoc-stubs/queue.lua b/ldoc-stubs/queue.lua new file mode 100644 index 00000000..83849624 --- /dev/null +++ b/ldoc-stubs/queue.lua @@ -0,0 +1,22 @@ +--- Properties and functions for inspecting and manipulating the track playback queue +-- @module queue + +local queue = {} + +--- The index in the queue of the currently playing track. This may be zero if the queue is empty. +-- @see types.Property +queue.position = types.Property + +--- The total number of tracks in the queue, including tracks which have already been played. +-- @see types.Property +queue.size = types.Property + +--- Determines whether or not the queue will be restarted after the final track is played. +-- @see types.Property +queue.replay = types.Property + +--- Determines whether, when progressing to the next track in the queue, the next track will be chosen randomly. The random selection algorithm used is a Miller Shuffle, which guarantees that no repeat selections will be made until every item in the queue has been played. +-- @see types.Property +queue.random = types.Property + +return queue diff --git a/ldoc-stubs/types.lua b/ldoc-stubs/types.lua new file mode 100644 index 00000000..3480610c --- /dev/null +++ b/ldoc-stubs/types.lua @@ -0,0 +1,35 @@ +--- Userdata-based types used throughout the rest of the API. These types are +--- not generally constructable within Lua code. +-- @module types +local types = {} + +--- A observable value, owned by the C++ firmware. +-- @type Property +types.Property = {} + +--- Gets the current value +-- @return The property's current value. +function Property:get() end + +--- Sets a new value. Not all properties may be set from within Lua code. For +--- example, it makes little sense to attempt to override the current battery +--- level. +-- @param val The new value. This should generally be of the same type as the existing value. +-- @return true if the new value was applied, or false if the backing C++ code rejected the new value (e.g. if it was out of range, or the wrong type). +function Property:set(val) end + +--- Invokes the given function once immediately with the current value, and then again whenever the value changes. +--- The function is invoked for *all* changes; both from the underlying C++ data, and from calls to `set` (if this is a Lua-writeable property). +--- The binding will be active **only** so long as the given function remains in scope. +-- @param fn callback function to apply property values. Must accept one argument; the updated value. +-- @return fn, for more ergonmic use with anonymous closures. +function Property:bind(fn) end + +--- Table containing information about a track. Most fields are optional. +-- @type Track +types.Track = {} + +--- The title of the track, or the filename if no title is available. +types.Track.title = "" + +return Property diff --git a/ldoc-stubs/volume.lua b/ldoc-stubs/volume.lua new file mode 100644 index 00000000..7eff24c5 --- /dev/null +++ b/ldoc-stubs/volume.lua @@ -0,0 +1,14 @@ +--- 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 volume + +local volume = {} + +--- The current volume as a percentage of the current volume limit. +-- @see types.Property +volume.current_pct = types.Property + +--- The current volume in terms of decibels relative to line level. +-- @see types.Property +volume.current_db = types.Property + +return volume diff --git a/luals-stubs/alerts.lua b/luals-stubs/alerts.lua new file mode 100644 index 00000000..d430f12d --- /dev/null +++ b/luals-stubs/alerts.lua @@ -0,0 +1,11 @@ +--- @meta + +--- @class alerts +local alerts = {} + +--- @param constructor function +function alerts.show(constructor) end + +function alerts.hide() end + +return alerts diff --git a/luals-stubs/backstack.lua b/luals-stubs/backstack.lua new file mode 100644 index 00000000..2e4eccb3 --- /dev/null +++ b/luals-stubs/backstack.lua @@ -0,0 +1,11 @@ +--- @meta + +--- @class backstack +local backstack = {} + +--- @param constructor function +function backstack.push(constructor) end + +function backstack.pop() end + +return backstack diff --git a/luals-stubs/bluetooth.lua b/luals-stubs/bluetooth.lua new file mode 100644 index 00000000..09fc7606 --- /dev/null +++ b/luals-stubs/bluetooth.lua @@ -0,0 +1,8 @@ +--- @meta + +--- @class bluetooth +--- @field enabled Property +--- @field connected Property +local bluetooth = {} + +return bluetooth diff --git a/luals-stubs/database.lua b/luals-stubs/database.lua new file mode 100644 index 00000000..e23c085b --- /dev/null +++ b/luals-stubs/database.lua @@ -0,0 +1,33 @@ +--- @meta + +--- @class database +local database = {} + +--- @return Index[] +function database.indexes() end + +--- @class Iterator +local Iterator = {} + +--- @class TrackId +local TrackId = {} + +--- @class Record +local Record = {} + +--- @return string +function Record:title() end + +--- @return TrackId|Iterator(Record) +function Record:contents() end + +--- @class Index +local Index = {} + +--- @return string +function Index:name() end + +--- @return Iterator(Record) +function Index:iter() end + +return database diff --git a/luals-stubs/playback.lua b/luals-stubs/playback.lua new file mode 100644 index 00000000..cd54ddb3 --- /dev/null +++ b/luals-stubs/playback.lua @@ -0,0 +1,10 @@ +--- @meta + +--- Properties for interacting with the audio playback system +--- @class playback +--- @field playing Property Whether or not audio is allowed to be played. if there is a current track, then this indicated whether playback is paused or unpaused. If there is no current track, this determines what will happen when the first track is added to the queue. +--- @field track Property The currently playing track. +--- @field position Property The current playback position within the current track, in seconds. +local playback = {} + +return playback diff --git a/luals-stubs/power.lua b/luals-stubs/power.lua new file mode 100644 index 00000000..226f8200 --- /dev/null +++ b/luals-stubs/power.lua @@ -0,0 +1,10 @@ +--- @meta + +--- Properties and functions that deal with the device's battery and power state. +--- @class power +--- @field battery_pct Property The battery's current charge, as a percentage of the maximum charge. +--- @field battery_millivolts Property The battery's current voltage, in millivolts. +--- @field plugged_in Property Whether or not the device is currently receiving external power. +local power = {} + +return power diff --git a/luals-stubs/queue.lua b/luals-stubs/queue.lua new file mode 100644 index 00000000..0c63b8c1 --- /dev/null +++ b/luals-stubs/queue.lua @@ -0,0 +1,11 @@ +--- @meta + +--- Properties and functions for inspecting and manipulating the track playback queue +--- @class queue +--- @field position Property The index in the queue of the currently playing track. This may be zero if the queue is empty. Writeable. +--- @field size Property The total number of tracks in the queue, including tracks which have already been played. +--- @field replay Property Whether or not the queue will be restarted after the final track is played. Writeable. +--- @field random Property Determines whether, when progressing to the next track in the queue, the next track will be chosen randomly. The random selection algorithm used is a Miller Shuffle, which guarantees that no repeat selections will be made until every item in the queue has been played. Writeable. +local queue = {} + +return queue diff --git a/luals-stubs/types.lua b/luals-stubs/types.lua new file mode 100644 index 00000000..ecfee29b --- /dev/null +++ b/luals-stubs/types.lua @@ -0,0 +1,13 @@ +--- @meta + +---@class Property +local property = {} + +function property:get() end + +function property:set(val) end + +--- @param fn function +function property:bind(fn) end + +return property diff --git a/luals-stubs/volume.lua b/luals-stubs/volume.lua new file mode 100644 index 00000000..42d65884 --- /dev/null +++ b/luals-stubs/volume.lua @@ -0,0 +1,8 @@ +--- @meta + +--- @class volume +--- @field current_pct Property +--- @field current_db Property +local volume = {} + +return volume diff --git a/src/lua/stubs/alerts.lua b/src/lua/stubs/alerts.lua deleted file mode 100644 index 9b541d84..00000000 --- a/src/lua/stubs/alerts.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- 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 diff --git a/src/lua/stubs/backstack.lua b/src/lua/stubs/backstack.lua deleted file mode 100644 index d4807d37..00000000 --- a/src/lua/stubs/backstack.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- Module for adding and removing screens from the system's backstack. --- @module backstack - -local backstack = {} - ---- Pushes a new screen onto the backstack. --- @tparam function constructor Called to create the UI for the new screen. A new default root object and group will be set before calling this function. The function provided should return a table holding any bindings used by this screen; the returned value is retained so long as this screen is present in the backstack. -function backstack.push(constructor) end - ---- Removes the currently active screen, and instead shows the screen underneath it on the backstack. Does nothing if this is the only existing screen. -function backstack.pop() end - -return backstack diff --git a/src/lua/stubs/bluetooth.lua b/src/lua/stubs/bluetooth.lua deleted file mode 100644 index 2fba1ec6..00000000 --- a/src/lua/stubs/bluetooth.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- Properties and functions for handling Bluetooth connectivity --- @module bluetooth - -local bluetooth = {} - ---- Whether or not the Bluetooth stack is currently enabled. This property is writeable, and can be used to enable or disable Bluetooth. --- @treturn types.Property a boolean property -function bluetooth.enabled() end - ---- Whether or not there is an active connection to another Bluetooth device. --- @treturn types.Property a boolean property -function bluetooth.connected() end - -return bluetooth diff --git a/src/lua/stubs/database.lua b/src/lua/stubs/database.lua deleted file mode 100644 index 97359ab1..00000000 --- a/src/lua/stubs/database.lua +++ /dev/null @@ -1,59 +0,0 @@ ---- Module for accessing and updating data about the user's library of tracks. --- @module database - -local database = {} - ---- Returns a list of all indexes in the database. --- @treturn Array(Index) -function database.indexes() end - ---- An iterator is a userdata type that behaves like an ordinary Lua iterator. --- @type Iterator -local Iterator = {} - ---- A TrackId is a unique identifier, representing a playable track in the ---- user's library. --- @type TrackId -local TrackId = {} - ---- A record is an item within an Index, representing some value at a specific ---- depth. --- @type Record -local Record = {} - ---- Gets the human-readable text representing this record. The `__tostring` ---- metatable function is an alias of this function. --- @treturn string -function Record:title() end - ---- Returns the value that this record represents. This may be either a track ---- id, for records which uniquely identify a track, or it may be a new ---- Iterator representing the next level of depth for the current index. ---- ---- For example, each Record in the "All Albums" index corresponds to an entire ---- album of tracks; the 'contents' of such a Record is an iterator returning ---- each track in the album represented by the Record. The contents of each of ---- the returned 'track' Records would be a full Track, as there is no further ---- disambiguation needed. --- @treturn TrackId|Iterator(Record) -function Record:contents() end - ---- An index is heirarchical, sorted, view of the tracks within the database. ---- For example, the 'All Albums' index contains, first, a sorted list of every ---- album name in the library. Then, at the second level of the index, a sorted ---- list of every track within each album. --- @type Index -local Index = {} - ---- Gets the human-readable name of this index. This is typically something ---- like "All Albums", or "Albums by Artist". The `__tostring` metatable ---- function is an alias of this function. --- @treturn string -function Index:name() end - ---- Returns a new iterator that can be used to access every record within the ---- first level of this index. --- @treturn Iterator(Record) -function Index:iter() end - -return database diff --git a/src/lua/stubs/playback.lua b/src/lua/stubs/playback.lua deleted file mode 100644 index 340da37d..00000000 --- a/src/lua/stubs/playback.lua +++ /dev/null @@ -1,15 +0,0 @@ ---- Properties for interacting with the audio playback system --- @module playback - -local playback = {} - ---- Whether or not any audio is *allowed* to be played. If there is a current track, then this is essentially an indicator of whether playback is paused or unpaused. ---- This value isn't meaningful if there is no current track. --- @treturn types.Property a boolean property -function playback.playing() end - -function playback:track() end - -function playback:position() end - -return playback diff --git a/src/lua/stubs/power.lua b/src/lua/stubs/power.lua deleted file mode 100644 index 30fe7520..00000000 --- a/src/lua/stubs/power.lua +++ /dev/null @@ -1,18 +0,0 @@ ---- Properties and functions that deal with the device's battery and power state --- @module power - -local power = {} - ---- battery_pct returns the battery's current charge as a percentage --- @treturn types.Property an integer property, from 0 to 100 -function power.battery_pct() end - ---- battery_millivolts returns the battery's current voltage in millivolts --- @treturn types.Property an integer property, typically from about 3000 to about 4200. -function power.battery_millivolts() end - ---- plugged_in returns whether or not the device is currently receiving external power --- @treturn types.Property a boolean property -function power.plugged_in() end - -return power \ No newline at end of file diff --git a/src/lua/stubs/queue.lua b/src/lua/stubs/queue.lua deleted file mode 100644 index 000c35d3..00000000 --- a/src/lua/stubs/queue.lua +++ /dev/null @@ -1,22 +0,0 @@ ---- Properties and functions for inspecting and manipulating the track playback queue --- @module queue - -local queue = {} - ---- queue.position returns the index in the queue of the currently playing track. This may be zero if the queue is empty. --- @treturn types.Property a positive integer property, which is a 1-based index -function queue.position() end - ---- queue.size returns the total number of tracks in the queue, including tracks which have already been played. --- @treturn types.Property a positive integer property -function queue.size() end - ---- queue.replay determines whether or not the queue will be restarted after the final track is played. --- @treturn types.Property a writeable boolean property -function queue.replay() end - ---- queue.random determines whether, when progressing to the next track in the queue, the next track will be chosen randomly. The random selection algorithm used is a Miller Shuffle, which guarantees that no repeat selections will be made until every item in the queue has been played. --- @treturn types.Property a writeable boolean property -function queue.random() end - -return queue \ No newline at end of file diff --git a/src/lua/stubs/types.lua b/src/lua/stubs/types.lua deleted file mode 100644 index 1f6970bd..00000000 --- a/src/lua/stubs/types.lua +++ /dev/null @@ -1,27 +0,0 @@ ---- Userdata-based types used throughout the rest of the API. These types are ---- not generally constructable within Lua code. --- @module types - ---- A value sourced from the C++ firmware. --- @type Property -local Property = {} - ---- Gets the current value --- @return The property's current value. -function Property:get() end - ---- Sets a new value. Not all properties may be set from within Lua code. For ---- example, it makes little sense to attempt to override the current battery ---- level. --- @param val The new value. This should generally be of the same type as the existing value. --- @return true if the new value was applied, or false if the backing C++ code rejected the new value (e.g. if it was out of range, or the wrong type). -function Property:set(val) end - ---- Invokes the given function once immediately with the current value, and then again whenever the value changes. ---- The function is invoked for *all* changes; both from the underlying C++ data, and from calls to `set` (if this is a Lua-writeable property). ---- The binding will be active **only** so long as the given function remains in scope. --- @param fn callback function to apply property values. Must accept one argument; the updated value. --- @return fn, for more ergonmic use with anonymous closures. -function Property:bind(fn) end - -return Property diff --git a/src/lua/stubs/volume.lua b/src/lua/stubs/volume.lua deleted file mode 100644 index 15499630..00000000 --- a/src/lua/stubs/volume.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- 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 volume - -local volume = {} - ---- Returns the current volume as a percentage of the current volume limit. --- @treturn types.Property an integer property -function volume.current_pct() end - ---- Returns the current volume in terms of dB from line level. --- @treturn types.Property an integer property -function volume.current_db() end - -return volume -- cgit v1.2.3