From 623553622c2675378933f56446f6c0e168e57512 Mon Sep 17 00:00:00 2001 From: "Riley L." Date: Sat, 30 Mar 2024 18:33:19 +0100 Subject: [PATCH] arson... again also update password or whatever --- cmd/log/log.go | 8 ++++---- cmd/obsconnect/config.yml | 2 +- cmd/obsconnect/obs.go | 38 +++++++++++++++++++------------------- go.mod | 2 +- mixer.go | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmd/log/log.go b/cmd/log/log.go index 70060b8..ef57a45 100644 --- a/cmd/log/log.go +++ b/cmd/log/log.go @@ -1,7 +1,7 @@ package main import ( - "github.com/rileys-trash-can/newtecrs82obs" + "github.com/rileys-trash-can/rs8" "log" "os" ) @@ -12,7 +12,7 @@ func main() { } port := os.Args[1] - conn, err := nt8.Open(port) + conn, err := rs8.Open(port) if err != nil { log.Fatalf("Failed to connect: %s", err) } @@ -25,10 +25,10 @@ func main() { e := <-ch switch event := e.(type) { - case *nt8.EventButton: + case *rs8.EventButton: log.Printf("%T %#v", event, event) - case *nt8.EventSlider: + case *rs8.EventSlider: log.Printf("%X %3d", event.Type, event.Value) } } diff --git a/cmd/obsconnect/config.yml b/cmd/obsconnect/config.yml index 033ac74..d33ad34 100644 --- a/cmd/obsconnect/config.yml +++ b/cmd/obsconnect/config.yml @@ -3,7 +3,7 @@ serial.port: "/dev/ttyUSB0" boolshit: true obs.addr: "10.10.42.160:4444" -obs.pass: "asdfgh" +obs.pass: "LiviT2005" trans.auto: "Fade" trans.take: "Cut" diff --git a/cmd/obsconnect/obs.go b/cmd/obsconnect/obs.go index 9d20719..d991167 100644 --- a/cmd/obsconnect/obs.go +++ b/cmd/obsconnect/obs.go @@ -6,7 +6,7 @@ import ( obss "github.com/andreykaipov/goobs/api/events/subscriptions" obssc "github.com/andreykaipov/goobs/api/requests/scenes" obst "github.com/andreykaipov/goobs/api/requests/transitions" - "github.com/rileys-trash-can/newtecrs82obs" + "github.com/rileys-trash-can/rs8" "gopkg.in/yaml.v3" "log" "math/rand" @@ -50,7 +50,7 @@ func main() { readconfig() port := Config.Serial - conn, err := nt8.Open(port) + conn, err := rs8.Open(port) if err != nil { log.Fatalf("Failed to connect: %s", err) } @@ -126,34 +126,34 @@ func main() { switch event := l.(type) { case *obse.CurrentPreviewSceneChanged: log.Printf("current preview scene: %s %d", event.SceneName, scenenamemap[event.SceneName]+1) - program := make([]nt8.CmdLight, 0) + program := make([]rs8.CmdLight, 0) for i := uint8(0); i < 8; i++ { - program = append(program, nt8.CmdLight{ - Type: nt8.ButtonPreview, + program = append(program, rs8.CmdLight{ + Type: rs8.ButtonPreview, Value: i, - State: nt8.LightOff, + State: rs8.LightOff, }) } - program[7-scenenamemap[event.SceneName]].State = nt8.LightOn + program[7-scenenamemap[event.SceneName]].State = rs8.LightOn conn.LightCmdCh <- program break case *obse.CurrentProgramSceneChanged: log.Printf("current program scene: %s %d", event.SceneName, scenenamemap[event.SceneName]+1) - program := make([]nt8.CmdLight, 0) + program := make([]rs8.CmdLight, 0) for i := uint8(0); i < 8; i++ { - program = append(program, nt8.CmdLight{ - Type: nt8.ButtonProgram, + program = append(program, rs8.CmdLight{ + Type: rs8.ButtonProgram, Value: i, - State: nt8.LightOff, + State: rs8.LightOff, }) } - program[7-scenenamemap[event.SceneName]].State = nt8.LightOn + program[7-scenenamemap[event.SceneName]].State = rs8.LightOn conn.LightCmdCh <- program break @@ -182,30 +182,30 @@ func main() { case e := <-ch: switch event := e.(type) { - case *nt8.EventButton: + case *rs8.EventButton: if event.Direction != 0 { continue } switch event.Type { - case nt8.ButtonProgram: + case rs8.ButtonProgram: log.Printf("Setting Program to %d", 7-event.Value) obsc.Scenes.SetCurrentProgramScene(&obssc.SetCurrentProgramSceneParams{ SceneName: &sceneindex[7-event.Value], }) break - case nt8.ButtonPreview: + case rs8.ButtonPreview: log.Printf("Setting Program to %d", 7-event.Value) obsc.Scenes.SetCurrentPreviewScene(&obssc.SetCurrentPreviewSceneParams{ SceneName: &sceneindex[7-event.Value], }) break - case nt8.ButtonAutoTakeDSK: + case rs8.ButtonAutoTakeDSK: switch event.Value { case 0x01: // TAKE or 0x02 - if deb(nt8.ButtonAutoTakeDSK<<8 | 0x01) { + if deb(rs8.ButtonAutoTakeDSK<<8 | 0x01) { continue } @@ -274,8 +274,8 @@ func main() { } break - case *nt8.EventSlider: - if event.Type == nt8.SliderTbar { + case *rs8.EventSlider: + if event.Type == rs8.SliderTbar { value := (float64(event.Value)) / 250 if value > 1 { value = 1 diff --git a/go.mod b/go.mod index 9b2afb5..34b4ec7 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/rileys-trash-can/newtecrs82obs +module github.com/rileys-trash-can/rs8 go 1.22.1 diff --git a/mixer.go b/mixer.go index 22e6562..87c4228 100644 --- a/mixer.go +++ b/mixer.go @@ -1,4 +1,4 @@ -package nt8 +package rs8 import ( "bufio"