mirror of
https://github.com/jwetzell/osc-go.git
synced 2026-09-10 15:59:28 +00:00
remove OSC prefix from types
This commit is contained in:
+13
-13
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user