There is a dynamic delegate (not multicast) in the OSC plugin that lets you bind a Blueprint event or function using a FOSCDispatchMessageEventBP& delegate that’s used in this UFUNCTION below –
void UOSCServer::BindEventToOnOSCAddressPatternMatchesPath(const FOSCAddress& InOSCAddressPattern, const FOSCDispatchMessageEventBP& InEvent)
The delegate FOSCDispatchMessageEventBP& is never declared in the class body so you cannot directly bind to using BindDynamic() from a UOSCServer*.
Ideally you would want something like
OSCDispatchMessageEventBP.BindDynamic(Outer Object, Function Pointer)
But you can’t because it’s never declared as a UPROPERTY() in any class scope.
Defining one of those delegates in another class throws an unidentified identifier exception.
Perhaps the bigger issue is that the TMap for the address patterns is a private member of the UOSCServer class and there is no setter for it. The getter does not return a reference either just a copy to a TArray. So I can’t manage bound address patterns at all.
I can bind the the dynamic multicast delegates for the basic OnOscMessageReceived because it’s defined in UOSCServer, which you could parse out an address, but why do that when you could just not fire the event at all? Seems strange that this feature is blueprint only.
Any thoughts on how to approach this issue? I’m trying to only do this in C++.