Added settings support
This commit is contained in:
parent
abe0b37f7d
commit
a49e996e1b
26
video.lua
26
video.lua
|
@ -2,11 +2,33 @@ local args = { ... }
|
|||
local dfpwm = require("cc.audio.dfpwm")
|
||||
local ccpi = require("ccpi")
|
||||
|
||||
local monitor = peripheral.find("monitor")
|
||||
settings.define("video.speaker.left", {
|
||||
description = "Speaker ID for left audio channel",
|
||||
default = peripheral.getName(peripheral.find("speaker")),
|
||||
type = "string"
|
||||
})
|
||||
|
||||
settings.define("video.speaker.right", {
|
||||
description = "Speaker ID for right audio channel",
|
||||
default = nil,
|
||||
type = "string"
|
||||
})
|
||||
|
||||
settings.define("video.monitor", {
|
||||
description = "Monitor to draw frames on",
|
||||
default = peripheral.getName(peripheral.find("monitor")),
|
||||
type = "string"
|
||||
})
|
||||
|
||||
local monitor = peripheral.wrap(settings.get("video.monitor"))
|
||||
local speakers = {
|
||||
l = peripheral.find("speaker"),
|
||||
l = peripheral.wrap(settings.get("video.speaker.left")),
|
||||
r = nil
|
||||
}
|
||||
local r_spk_id = settings.get("video.speaker.right")
|
||||
if r_spk_id then
|
||||
speakers.r = peripheral.wrap(r_spk_id)
|
||||
end
|
||||
|
||||
local delay = 0
|
||||
local loading_concurrency = 8
|
||||
|
|
Loading…
Reference in New Issue