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

surge-fx: replace AccSlider with sst/jucegui/Knob.h #7928

Merged
merged 27 commits into from
Jan 1, 2025

Conversation

shih1
Copy link
Contributor

@shih1 shih1 commented Dec 17, 2024

This PR switches from juce::Slider with sst-jucegui knobs.

it is a follow up on #7924

Extra changes

  • update sst-jucegui

  • Testing

    • Change modify knobs and switch FX
    • tested in reaper, live
    • tested clap, au, vst3
    • test accessibility

@baconpaul baconpaul marked this pull request as draft December 17, 2024 15:02
@baconpaul
Copy link
Collaborator

I converted to draft to avoid accidental merge. Have fun!

Copy link
Collaborator

@baconpaul baconpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to implement a stylesheet, just start with one of the built ins and customize

You also shouldn't need a style sheet just for the knobs. Instead give them a custom class if you need differentiated knobs, or just use the knob properties from the parent.

@@ -36,4 +40,298 @@ struct ConcreteCM : sst::jucegui::data::ContinuousModulatable
float getModulationValuePM1() const override { return mv; }
void setModulationValuePM1(const float &f) override { mv = f; }
bool isModulationBipolar() const override { return isBipolar(); } // sure why not
};

struct StyleSheetBuiltInImp : public sst::jucegui::style::StyleSheet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh we shouldn't need all this code. You should be able to start with the Dark and customize colors from there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example makes sense to me. Will update tmrw.


setTransform(juce::AffineTransform().scaled(1.0));

// @ BP this compiles but causes a segfault on launc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baconpaul this is what I think is supposed to happen but JUCE segfaults on isShowing(). I reverted to L153 instead.

I think once we resolve this issue i can move on to updating the param values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that should be in the if but also should not be null

did you make a non component the consumer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the editor a consumer, which is a component. My limited understanding is that the component is null when setting the style which doesn't make sense to me either.

If I made a non component the consumer, i think it should have failed to compile?

In my std::cout testing, it failed to even enter the isShowing().
I thought it might have been an issue with https://github.com/juce-framework/JUCE/blob/master/modules/juce_gui_basics/components/juce_Component.cpp#L342 But testing showed that it faulted on the entry of isShowing() from sst-jucegui.

@shih1 shih1 marked this pull request as ready for review December 30, 2024 18:21
@shih1 shih1 marked this pull request as draft December 30, 2024 19:08
@shih1
Copy link
Contributor Author

shih1 commented Jan 1, 2025

Screenshot 2025-01-01 at 8 32 08 PM

Copy link
Collaborator

@baconpaul baconpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good.

I had one question about an API point

And the thing I would test also is: when you do external VST automation of a param in reaper, does the knob repaint get called properly?

But with both those things I am very happy to merge this change!

src/surge-fx/SurgeFXEditor.cpp Outdated Show resolved Hide resolved
@shih1 shih1 marked this pull request as ready for review January 1, 2025 16:25
@shih1
Copy link
Contributor Author

shih1 commented Jan 1, 2025

did my final pass through and testing. lgtm 🚢

@shih1 shih1 marked this pull request as draft January 1, 2025 16:50
@shih1 shih1 marked this pull request as ready for review January 1, 2025 16:52
@baconpaul baconpaul merged commit cf87ac7 into surge-synthesizer:main Jan 1, 2025
25 checks passed
@shih1 shih1 mentioned this pull request Jan 3, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants