Reuse internals to create a compactDescription for OSCMessage and create message from compactDescription #48
Replies: 1 comment
-
I'm not familiar with If you're looking for a way to both construct an OSC tag characters are, for the most part, obfuscated from the user in OSCKit in favor of using Swift language concrete value types. OSC value types, including their tag characters and encoding/decoding logic is found within Sources/OSCKitCore/OSCValue. For example, Int32 ( As such, tag characters aren't defined in a single enumeration. Part of the reason is that certain OSC types have variable tag identities and are not static.
let char = Character("i")
// array: should contain one entry if there is a match, or empty if no types match.
let types = OSCSerialization.shared.tagIdentities(for: char) (Although, this will be renamed
If a concrete value conforms to let value: Double = 3.14 // Double conforms to OSCValue
let id = value.oscTagIdentity
switch id {
case let .atomic(char):
// char is a Character instance; atomic (static) character for this OSC value type
case let .variable(chars):
// chars is a Character array of possible characters for the given value type (ie: Bool can be T or F)
case let .variadic(minCount, maxCount):
// characters may vary depending on value's contents, such as an OSC Array
}
And there is no direct way to determine if an OSC value type encodes data ('an argument') or not, apart from whether its concrete type's static |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’d like to reuse the convenient message shorthand of specifying the address, type tag, and arguments as a string that liblo's bundled
oscsend
andoscdump
command-line tools use:If I only care about a subset of types, the string parsing seems straightforward. But is there a convenient way to:
Beta Was this translation helpful? Give feedback.
All reactions