/// <summary> /// Subscribes to a topic. See <a href="https://www.audiokinetic.com/library/edge/?source=SDK&id=waapi__subscribe.html" target="_blank">Subscribing to Topics in the Wwise Authoring API</a> for more information. /// </summary> /// <param name="Uri">Topic to subscribe to</param> /// <param name="Options">Elements of the Wwise objects to return</param> /// <param name="Callback">C# delegate to execute when subscription is triggered</param> /// <param name="TimeoutMs">Timeout in milliseconds to wait on the Wwise Authoring application to respond</param> /// <param name="SubscriptionID">Unique ID representing the subscription</param> /// <param name="Result">Result of the subscription attempt</param> /// <returns>Subscription success</returns> public static bool Subscribe(string Uri, string Options, WaapiEventCallback Callback, int TimeoutMs, out ulong SubscriptionID, out string Result) { int ResultLength; bool res = AkWaapiClient_PINVOKE.Subscribe(Uri, Options, out SubscriptionID, TimeoutMs, out ResultLength); if (res) { WaapiEventCallbacks.Add(SubscriptionID, Callback); } res &= GetLastString(ResultLength, out Result); return(res); }
/// <summary> /// Subscribes to a topic. See <a href="https://www.audiokinetic.com/library/edge/?source=SDK&id=waapi__subscribe.html" target="_blank">Subscribing to Topics in the Wwise Authoring API</a> for more information. /// </summary> /// <param name="Uri">Topic to subscribe to</param> /// <param name="Options">Elements of the Wwise objects to return</param> /// <param name="Callback">C# delegate to execute when subscription is triggered</param> /// <param name="SubscriptionID">Unique ID representing the subscription</param> /// <param name="Result">Result of the subscription attempt</param> /// <returns>Subscription success</returns> public static bool Subscribe(string Uri, string Options, WaapiEventCallback Callback, out ulong SubscriptionID, out string Result) { try { int ResultLength; bool res = AkWaapiClient_PINVOKE.Subscribe(Uri, Options, out SubscriptionID, out ResultLength); if (res) { WaapiEventCallbacks.Add(SubscriptionID, Callback); } res &= GetLastString(ResultLength, out Result); return(res); } catch { SubscriptionID = 0; Result = string.Empty; return(false); } }