OSC messages registered and filter class


#1

Hi,
i built a custom client of casparcg in dotnet which i’m using for playout, cg and atem switcher synchronously and in some cases i’m using it for some automation and currently i’m using osc with some registered methods for getting file time/frame of specific channel and layer

sOscServer.RegisterMethod("/channel/1/stage/layer/15/file/frame");
sOscServer.RegisterMethod("/channel/1/stage/layer/16/file/frame");
sOscServer.RegisterMethod("/channel/1/stage/layer/17/file/frame");

but i’m looking for right way to register and filter osc messages for individual channels and layers instead of registered 100 methods of channel 1 and layer 1-100 for file time/frame

what i’m trying to achieve is register osc method only when i need to get time/frame and after that remove it for example
when client user going to play a file on channel 2 and layer 24 then before playing register osc method “/channel/2/stage/layer/24/file/frame” and remove it when layer is empty

so i’m thinking to define a class with channel, layer and frames properties and list it with registered methods data

and for usage filter it with specific channel and layer

but i’m confuse if this is the right way or if there is something better then this

i need your expertise and guidance

thanks


#2

Hi,
You can use my library if you want.
You can use regex to filter message.

Regards.


#3

Thanks
I’ll try with it to implement will you please share the right way for implementation
For example while using CasparCG at some point i need osc for file time of channel 2 layer 42 ?


#4

Wow I’m using your library and it’s very simple and clean
Is it ok to create new instance of Osc listener for every player in my application with filtered method or should I use only one static instance
Actually I have multiple players and multiple layers in every player in my application


#5

Thanks Noumann,

You can try to use multiple instance, just check performance to ensure no problem. Can you advise me of your test please ?

If you have issue with multiple instance just share with me I can look to find a solution for you.
Regards


#6

Right now I’m not able to test it soon but yeah sure I’ll share with you multiple instance result.

and I think we should add another filter to whitelist for getting specific channel and layer data with event manager instead of adding another instance.
It’ll be nice if you add this in your class this will make it more useful.