示例#1
0
 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);
         }
     }
 }
示例#2
0
 // 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));
             }
         }
     }
 }
示例#3
0
 // 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));
             }
         }
     }
 }