예제 #1
0
        /// <summary>
        /// Remove a single background thread method from an OSC address
        /// </summary>
        /// <param name="address">The OSC address to handle messages for</param>
        /// <param name="valueReadMethod">
        /// The method to execute immediately on the worker thread that reads values from the message
        /// </param>
        /// <returns>True if the method was removed from this address, false otherwise</returns>
        public bool RemoveMethod(string address, Action <OscMessageValues> valueReadMethod)
        {
            if (k_SingleCallbackToPair.TryGetValue(valueReadMethod, out var pair))
            {
                return(AddressSpace.RemoveMethod(address, pair) &&
                       k_SingleCallbackToPair.Remove(valueReadMethod));
            }

            return(false);
        }
예제 #2
0
 /// <summary>
 /// Remove a background thread read callback and main thread callback associated with an OSC address.
 /// </summary>
 /// <param name="address">The OSC address to remove methods from</param>
 /// <param name="actionPair">The pair of callbacks to remove</param>
 /// <returns>True if successfully removed, false otherwise</returns>
 public bool RemoveMethodPair(string address, OscActionPair actionPair)
 {
     // if the address space is null, this got called during cleanup / shutdown,
     // and effectively all addresses are removed by setting it to null
     return(AddressSpace == null || AddressSpace.RemoveMethod(address, actionPair));
 }