exa04 / cyma

Visualizers for nih-plug UIs made using VIZIA.
https://exa04.github.io/cyma/book
Mozilla Public License 2.0
35 stars 1 forks source link

Allow range to be bound to application data #53

Closed exa04 closed 6 months ago

exa04 commented 7 months ago

Allows for values, as well as lenses to be passed into the Graph, Grid, Meter and Oscilloscope.

This pull request introduces the RangeModifiers trait. The trait allows for the respective views to have their ranges and scalings bound to a lens, or set to a value. It is implemented for:

Also, this PR fixes some annoyances when updating the ranges of certain views.

[!CAUTION] This PR introduces a breaking change for graphs! If you want to fill them from a certain position, you will now have to do so by calling fill_from_max or fill_from on them.

magnetophon commented 7 months ago

Going by the checkboxes, this PR is ready for testing. Is it indeed?

exa04 commented 7 months ago

Yes, it is :)

magnetophon commented 7 months ago

Great! I will then!

The FillFrom enum looks like a very handy feature. Is it planned for Meter as well? I am currently "hacking" this in for lamb.

exa04 commented 7 months ago

Great idea! I'll base the Meter fill logic on that, too.

exa04 commented 6 months ago

Alright, LGTM!