Skip to content

Commit ea9bf36

Browse files
committed
fix: resolume isn't osc spec compliant
When resolume is asked for the name of an empty clip, it returns a null byte as the name, while I'm not sure what they should put instead, it is technically not compliant.
1 parent 5de37f8 commit ea9bf36

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require (
99
nhooyr.io/websocket v1.8.7
1010
)
1111

12+
//replace github.com/chabad360/go-osc => ../go-osc
13+
1214
require (
1315
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
1416
github.com/davecgh/go-spew v1.1.1 // indirect

main.go

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ var (
3939
p = pure.New()
4040
httpServer *http.Server
4141
conn net.PacketConn
42-
buf = bytes.NewBuffer(make([]byte, 0, 65535))
43-
wg sync.WaitGroup
44-
running bool
45-
message = &osc.Message{Arguments: []interface{}{"?"}}
46-
client *net.UDPConn
47-
b = new(bytes.Buffer)
48-
t = time.Tick(time.Minute)
42+
//buf = bytes.NewBuffer(make([]byte, 0, 65535))
43+
wg sync.WaitGroup
44+
running bool
45+
message = &osc.Message{Arguments: []interface{}{"?"}}
46+
client *net.UDPConn
47+
b = new(bytes.Buffer)
48+
t = time.Tick(time.Minute)
4949
)
5050

5151
func main() {
@@ -178,20 +178,23 @@ func listenOSC(conn net.PacketConn, wg *sync.WaitGroup) {
178178
if errors.Is(err, net.ErrClosed) {
179179
return
180180
}
181+
continue
181182
}
182183

183184
if packet != nil {
184-
switch p := packet.(type) {
185+
fmt.Println(packet)
186+
switch data := packet.(type) {
185187
default:
186188
continue
187189
case *osc.Message:
188-
procMsg(p)
190+
fmt.Println(data)
191+
procMsg(data)
189192

190193
case *osc.Bundle:
191-
for _, p := range p.Elements {
192-
switch p := p.(type) {
194+
for _, elem := range data.Elements {
195+
switch data := elem.(type) {
193196
case *osc.Message:
194-
procMsg(p)
197+
procMsg(data)
195198
case *osc.Bundle:
196199
panic("stop nesting bundles")
197200
}

0 commit comments

Comments
 (0)