/// <summary> /// Register a single background thread method for 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 address was valid, false otherwise</returns> public bool TryAddMethod(string address, Action <OscMessageValues> valueReadMethod) { var pair = new OscActionPair(valueReadMethod); k_SingleCallbackToPair.Add(valueReadMethod, pair); return(AddressSpace.TryAddMethod(address, pair)); }
/// <summary> /// Add a background thread read callback and main thread callback associated with an OSC address. /// </summary> /// <param name="address">The OSC address to associate a method with</param> /// <returns>True if the address was valid & methods associated with it, false otherwise</returns> public bool TryAddMethodPair(string address, Action <OscMessageValues> read, Action mainThread) => AddressSpace.TryAddMethod(address, new OscActionPair(read, mainThread));
/// <summary> /// Add a background thread read callback and main thread callback associated with an OSC address. /// </summary> /// <param name="address">The OSC address to associate a method with</param> /// <param name="actionPair">The pair of callbacks to add</param> /// <returns>True if the address was valid & methods associated with it, false otherwise</returns> public bool TryAddMethodPair(string address, OscActionPair actionPair) => AddressSpace.TryAddMethod(address, actionPair);