void oscReceiver_ReceivedBundle(object sender, OscBundleEventArgs e) { e.AutoUnpack = false; if (topic == null || e.Bundle.FirstAddress.StartsWith(topic)) { T packet = packetConverter.FromOscBundle(e.Bundle, topic); if (packet != null) { OnReceivedPacket(packet); } } }
// Invoke the ReceivedBundle event protected virtual void OnReceivedBundle(OscBundleEventArgs e) { if (ReceivedBundle != null) { ReceivedBundle(this, e); } if (e.AutoUnpack) { foreach (OscData part in e.Bundle.Parts) { if (part is OscMessage) { OnReceivedMessage(new OscMessageEventArgs(e.Timestamp, (OscMessage)part)); } else if (part is OscBundle) { OnReceivedBundle(new OscBundleEventArgs(e.Timestamp, (OscBundle)part)); } } } }