예제 #1
0
 public static OSCPacket Parse(BinaryReader reader)
 {
     if (reader.PeekChar() == '#')
     {
         // OSC Bundle
         return(OSCBundle.Parse(reader));
     }
     else
     {
         return(OSCMessage.Parse(reader));
     }
 }
예제 #2
0
 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);
         }
     }
 }