remove OSC prefix from types

This commit is contained in:
Joel Wetzell
2026-09-10 08:30:59 -05:00
parent 303a782a74
commit 3f656a2349
10 changed files with 165 additions and 165 deletions
+7 -7
View File
@@ -102,7 +102,7 @@ func listenTCP(netAddress string, useSLIP bool, format string) {
type SLIP struct {
pendingBytes []byte
Packets chan osc.OSCPacket
Packets chan osc.Packet
}
func (s *SLIP) decode(bytes []byte) {
@@ -155,7 +155,7 @@ func handleSLIP(slip SLIP, format string) {
func handleTCPConnection(conn net.Conn, useSLIP bool, format string) {
slip := SLIP{
pendingBytes: []byte{},
Packets: make(chan osc.OSCPacket),
Packets: make(chan osc.Packet),
}
go handleSLIP(slip, format)
@@ -177,17 +177,17 @@ func handleTCPConnection(conn net.Conn, useSLIP bool, format string) {
}
}
func handlePacket(message osc.OSCPacket, format string) {
if bundle, ok := message.(*osc.OSCBundle); ok {
func handlePacket(message osc.Packet, format string) {
if bundle, ok := message.(*osc.Bundle); ok {
handleBundle(bundle, format)
} else if msg, ok := message.(*osc.OSCMessage); ok {
} else if msg, ok := message.(*osc.Message); ok {
handleMessage(msg, format)
} else {
fmt.Println("Received unknown OSC Packet type")
}
}
func handleMessage(message *osc.OSCMessage, format string) {
func handleMessage(message *osc.Message, format string) {
if format == "json" {
jsonData, _ := json.Marshal(message)
fmt.Println(string(jsonData))
@@ -196,7 +196,7 @@ func handleMessage(message *osc.OSCMessage, format string) {
}
}
func handleBundle(bundle *osc.OSCBundle, format string) {
func handleBundle(bundle *osc.Bundle, format string) {
for _, packet := range bundle.Contents {
handlePacket(packet, format)
}