public void Receive(string sendName, BangReceiveCallback bangReceiver, bool asynchronous = false) { if (!sendNameBangReceiverDict.ContainsKey(sendName)) { LibPD.Subscribe(sendName); sendNameBangReceiverDict[sendName] = new List <PureDataBangReceiver>(); } sendNameBangReceiverDict[sendName].Add(new PureDataBangReceiver(sendName, bangReceiver, asynchronous, pureData)); }
public void Release(BangReceiveCallback bangCallback) { foreach (List <PureDataBangReceiver> bangReceivers in sendNameBangReceiverDict.Values) { for (int i = bangReceivers.Count - 1; i >= 0; i--) { if (bangReceivers[i].bangReceiver == bangCallback) { Release(bangReceivers[i]); } } } }
/// <summary> /// Unsubscribes a delegate so that it stops receiving bangs from Pure Data. /// </summary> /// <param name="bangReceiver">The subscribed delegate that will stop receiving bangs.</param> public static void Release(BangReceiveCallback bangReceiver) { instance.communicator.Release(bangReceiver); }
/// <summary> /// Subscribes a delegate so that it receives bangs from all <c>[send <paramref name="sendName"/>]</c> in Pure Data. /// </summary> /// <param name="sendName">The name of the sender from which the bangs will be received.</param> /// <param name="bangReceiver">The delegate that will receive the bangs.</param> /// <param name="asynchronous">If true, the bangs will be received as soon as they are sent by Pure Data, otherwise they will be received on the next Unity Update, FixedUpdate or LateUpdate.</param> public static void Receive(string sendName, BangReceiveCallback bangReceiver, bool asynchronous = false) { instance.communicator.Receive(sendName, bangReceiver, asynchronous); }
public PureDataBangReceiver(string sendName, BangReceiveCallback bangReceiver, bool asynchronous, PureData pureData) : base(sendName, asynchronous, pureData) { this.bangReceiver = bangReceiver; }
public PureDataBangReceiver(string sendName, BangReceiveCallback bangReceiver, bool asynchronous, PureData pureData) : base(sendName, asynchronous, pureData) { this.bangReceiver = bangReceiver; }