public static OSCPacket Parse(BinaryReader reader) { if (reader.PeekChar() == '#') { // OSC Bundle return(OSCBundle.Parse(reader)); } else { return(OSCMessage.Parse(reader)); } }
private void OnBundleReceived(OSCBundle bundle) { foreach (OSCPacket packet in bundle.Contents) { if (packet is OSCBundle) { OSCBundle subBundle = packet as OSCBundle; OnBundleReceived(subBundle); } else { OSCMessage message = packet as OSCMessage; OnMessageReceived(message); } } }