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

@hvparam type trig is ignored when generating DPF and Javascript user interfaces #13

Open
vulcu opened this issue Dec 5, 2023 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vulcu
Copy link
Owner

vulcu commented Dec 5, 2023

The current version of HVCC (0.9) does not appear to render the trig input type correctly when generating DPF or Javascript user interfaces, and appears to treat them as a float (e.g. if defined as |r <name> @hvparam 0 1 0 trig| the UI will be a slider from 0 to 1). Suggest following up with Wasted-Audio or checking if a future release of HVCC addresses the issue.

@vulcu vulcu added bug Something isn't working help wanted Extra attention is needed labels Dec 6, 2023
@dromer
Copy link

dromer commented Dec 16, 2023

Javascript certainly doesn't listen for this property, but the DPF generator should: https://github.com/Wasted-Audio/hvcc/blob/develop/hvcc/generators/c2dpf/templates/HeavyDPF.cpp#L126-L127

What do you mean exactly with "UI will be a slider"? It will depend on your host or UI code how this parameter is presented.

@dromer
Copy link

dromer commented Dec 16, 2023

Ah I realize you meant the auto-generated ImGui UI, this is indeed still very limited.

I'm happy to accept pull requests that implement more features into these generated UIs.

@vulcu
Copy link
Owner Author

vulcu commented Dec 17, 2023

thanks! and yes, it's the auto-generated ImGui UI that renders it as a slider. Does HVCC have any existing way to influence the auto-generated ImGui, or would I need to write separate UI code and find some alternative way of compiling that with the Heavy output? What is the UI intent for the trig type? I assumed it'd be like the 'bool' type (e.g. a switch), but momentary.

For Javascript it looks like I could write my own elements to replace the autogenerated UI, that seems straightforward and will probably be what I take on next. Is the lack of trig support something that just hasn't been implemented in HVCC yet, or is that a limitation of emcc?

@dromer
Copy link

dromer commented Dec 17, 2023

The trig type is for the plugin interface as I linked. This allows plugin hosts to recognize this feature (not applicable to all plugin formats and hosts).
If you want the UI to have different UX based on this type you'll need to modify the ImGui and html template codes:

https://github.com/Wasted-Audio/hvcc/blob/develop/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp
https://github.com/Wasted-Audio/hvcc/blob/develop/hvcc/generators/c2js/template/index.html

ps; I implemented this type system for the DPF wrapper specifically. None of the other types respond to this yet. I'm actually considering replacing it with the already existing @hv_event receiver case. Which the JS wrapper already supports. This sends a bang into the patch.

@vulcu
Copy link
Owner Author

vulcu commented Dec 18, 2023

Thanks! I think this gives me what I need to explore this further, I'll have a look at the template codes, ideally I need to find some means of providing visual feedback as well (even just simple indicators).

The docs state that @hv_event is currently only supported by Unity, so I didn't think to try it. I'll give that a try for JS and how it goes, having a button to input a bang would work perfect for what I need.

@dromer
Copy link

dromer commented Dec 18, 2023

Yeah being able to send values out of the patch has been requested before. I'll need to sit down to come up with a good way to do this for plugins.

Will write a feature request for this to keep track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants