1
0
Fork 0

Added settings support

This commit is contained in:
Casey 2024-09-15 03:41:47 +03:00
parent abe0b37f7d
commit a49e996e1b
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 24 additions and 2 deletions

View File

@ -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