Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wild-Card osc-address option to OscMessageDispatcher() #40

Open
zacksettel opened this issue Mar 5, 2023 · 0 comments
Open

Add Wild-Card osc-address option to OscMessageDispatcher() #40

zacksettel opened this issue Mar 5, 2023 · 0 comments
Assignees
Labels

Comments

@zacksettel
Copy link

zacksettel commented Mar 5, 2023

I have to forward all OSC messages to an additional target, which would be made easy to do, with this feature

Proposition: Modify OscMessageDispatcher.cs. to be able to apply all received OSC messages to a callback , whose address is "*" as shown below:

internal void Dispatch(string address, OscDataHandle data)
{
lock (_callbackMap)
{
MessageCallback callback;

            // Process any message on wild-card match
            if (_callbackMap.TryGetValue("*", out callback))
                callback(address, data);

            // Address-specified callback
            if (_callbackMap.TryGetValue(address, out callback))
                callback(address, data);

            // Monitor callback
            if (_callbackMap.TryGetValue(string.Empty, out callback))
                callback(address, data);
        }
    }

For this to be effective, so that a callback client could parse the OscDataHandle data, the following method should be added to OscDataHandle.cs:

List OscDataHandle.GetTypeTags()

Then the client could properly access the received message and take action.

@keijiro keijiro self-assigned this Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants