Skip to content

Commit

Permalink
fix: resolume isn't osc spec compliant
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chabad360 committed Dec 30, 2021
1 parent 5de37f8 commit ea9bf36
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ require (
nhooyr.io/websocket v1.8.7
)

//replace github.com/chabad360/go-osc => ../go-osc

require (
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
27 changes: 15 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ var (
p = pure.New()
httpServer *http.Server
conn net.PacketConn
buf = bytes.NewBuffer(make([]byte, 0, 65535))
wg sync.WaitGroup
running bool
message = &osc.Message{Arguments: []interface{}{"?"}}
client *net.UDPConn
b = new(bytes.Buffer)
t = time.Tick(time.Minute)
//buf = bytes.NewBuffer(make([]byte, 0, 65535))
wg sync.WaitGroup
running bool
message = &osc.Message{Arguments: []interface{}{"?"}}
client *net.UDPConn
b = new(bytes.Buffer)
t = time.Tick(time.Minute)
)

func main() {
Expand Down Expand Up @@ -178,20 +178,23 @@ func listenOSC(conn net.PacketConn, wg *sync.WaitGroup) {
if errors.Is(err, net.ErrClosed) {
return
}
continue
}

if packet != nil {
switch p := packet.(type) {
fmt.Println(packet)
switch data := packet.(type) {
default:
continue
case *osc.Message:
procMsg(p)
fmt.Println(data)
procMsg(data)

case *osc.Bundle:
for _, p := range p.Elements {
switch p := p.(type) {
for _, elem := range data.Elements {
switch data := elem.(type) {
case *osc.Message:
procMsg(p)
procMsg(data)
case *osc.Bundle:
panic("stop nesting bundles")
}
Expand Down

0 comments on commit ea9bf36

Please sign in to comment.