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
+13 -13
View File
@@ -80,11 +80,11 @@ func main() {
}
}
func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
func argToTypedArg(rawArg string, oscType string) osc.Arg {
switch oscType {
case "s":
return osc.OSCArg{
return osc.Arg{
Value: rawArg,
Type: "s",
}
@@ -94,7 +94,7 @@ func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
// ... handle error
panic(err)
}
return osc.OSCArg{
return osc.Arg{
Value: int32(number),
Type: "i",
}
@@ -104,7 +104,7 @@ func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
// ... handle error
panic(err)
}
return osc.OSCArg{
return osc.Arg{
Value: float32(number),
Type: "f",
}
@@ -114,7 +114,7 @@ func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
// ... handle error
panic(err)
}
return osc.OSCArg{
return osc.Arg{
Value: data,
Type: "b",
}
@@ -124,7 +124,7 @@ func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
// ... handle error
panic(err)
}
return osc.OSCArg{
return osc.Arg{
Value: int64(number),
Type: "h",
}
@@ -134,29 +134,29 @@ func argToTypedArg(rawArg string, oscType string) osc.OSCArg {
// ... handle error
panic(err)
}
return osc.OSCArg{
return osc.Arg{
Value: float64(number),
Type: "d",
}
case "T":
return osc.OSCArg{
return osc.Arg{
Value: true,
Type: "T",
}
case "F":
return osc.OSCArg{
return osc.Arg{
Value: false,
Type: "F",
}
case "N":
return osc.OSCArg{
return osc.Arg{
Value: nil,
Type: "N",
}
default:
fmt.Printf("unsupported OSC arg type: %s\n", oscType)
// TODO(jwetzell): something better than this like actual nil, err thing
return osc.OSCArg{}
return osc.Arg{}
}
}
@@ -185,9 +185,9 @@ func slipEncode(bytes []byte) []byte {
func send(host string, port int32, address string, args []string, types []string, protocol string, slip bool) {
oscMessage := osc.OSCMessage{
oscMessage := osc.Message{
Address: address,
Args: []osc.OSCArg{},
Args: []osc.Arg{},
}
for index, arg := range args {