Ejemplo n.º 1
0
        public static OscMessage FromBytes(byte[] bytes)
        {
            var addressPattern = OscString.GetValue(ref bytes);
            var argumentTags   = OscString.GetValue(ref bytes).Substring(1);
            var arguments      = argumentTags.Select(t => OscValue.FromBytes(t, ref bytes));

            return(new OscMessage(new OscAddressPattern(addressPattern), arguments));
        }
Ejemplo n.º 2
0
        public static OscValue FromBytes(char tag, ref byte[] bytes)
        {
            switch (tag)
            {
            case 'i': return(OscInt.FromBytes(ref bytes));

            case 'f': return(OscFloat.FromBytes(ref bytes));

            case 's': return(OscString.FromBytes(ref bytes));

            case 'b': return(OscBlob.FromBytes(ref bytes));

            default: throw new OscException($"Unable to read OSC argument with tag '{tag}'.");
            }
        }