parent
aa1dd3d522
commit
e12a68a74d
@ -1,6 +1,7 @@ |
|||||||
{ |
{ |
||||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", |
"$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", |
"runtime.version": "Lua 5.4", |
||||||
} |
} |
||||||
|
|
||||||
|
@ -1,3 +1,3 @@ |
|||||||
file = {'src/lua/stubs'} |
file = {'ldoc-stubs'} |
||||||
project = "Tangara" |
project = "Tangara" |
||||||
description = "Lua modules provided by Tangara's firmware" |
description = "Lua modules provided by Tangara's firmware" |
@ -1,14 +1,13 @@ |
|||||||
--- Properties and functions for handling Bluetooth connectivity |
--- Properties and functions for handling Bluetooth connectivity |
||||||
-- @module bluetooth |
-- @module bluetooth |
||||||
|
|
||||||
local 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. |
--- 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 |
-- @see types.Property |
||||||
function bluetooth.enabled() end |
bluetooth.enabled = types.Property |
||||||
|
|
||||||
--- Whether or not there is an active connection to another Bluetooth device. |
--- Whether or not there is an active connection to another Bluetooth device. |
||||||
-- @treturn types.Property a boolean property |
-- @see types.Property |
||||||
function bluetooth.connected() end |
bluetooth.connected = types.Property |
||||||
|
|
||||||
return bluetooth |
return bluetooth |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -0,0 +1,11 @@ |
|||||||
|
--- @meta |
||||||
|
|
||||||
|
--- @class alerts |
||||||
|
local alerts = {} |
||||||
|
|
||||||
|
--- @param constructor function |
||||||
|
function alerts.show(constructor) end |
||||||
|
|
||||||
|
function alerts.hide() end |
||||||
|
|
||||||
|
return alerts |
@ -0,0 +1,11 @@ |
|||||||
|
--- @meta |
||||||
|
|
||||||
|
--- @class backstack |
||||||
|
local backstack = {} |
||||||
|
|
||||||
|
--- @param constructor function |
||||||
|
function backstack.push(constructor) end |
||||||
|
|
||||||
|
function backstack.pop() end |
||||||
|
|
||||||
|
return backstack |
@ -0,0 +1,8 @@ |
|||||||
|
--- @meta |
||||||
|
|
||||||
|
--- @class bluetooth |
||||||
|
--- @field enabled Property |
||||||
|
--- @field connected Property |
||||||
|
local bluetooth = {} |
||||||
|
|
||||||
|
return bluetooth |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -0,0 +1,8 @@ |
|||||||
|
--- @meta |
||||||
|
|
||||||
|
--- @class volume |
||||||
|
--- @field current_pct Property |
||||||
|
--- @field current_db Property |
||||||
|
local volume = {} |
||||||
|
|
||||||
|
return volume |
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
Loading…
Reference in new issue