I have made some plugins that work with the default slider but i want to change it to my own, But it won’t come up on the interface, Do you no what the problem could be? I can show you the code for the project. Thanks.
If you want help with your project from other developers its always better to have your code checked into a repo somewhere it can be easily read and referred to … github is great for this.
Its nearly impossible to give you any hints about things without looking at code. You could also include the code in a post, but generally this is less easier to debug than having a repo …
First off, your title implies that you want a dial instead of a slider… If you want to use a JUCE default dial, you can use juce::Slider::setSliderStyle(juce::Slider::SliderStyle::Rotary)
.
note that a slider and a dial are, more or less, the same thing in terms of the way the UI interacts with the user. As such, there are not separate JUCE types for these sorts of things. When considering UI, instead of this dichotomy, I would consider in what direction the user’s mouse/trackpad/touch input should correspond to an increase or decrease in the value that the slider represents)
More relevant, there are 2 primary simple ways to change the way a juce::Slider
to look a certain way.
-
use a
juce::LookAndFeel
. Inherit from one of the default types and override thejuce::Slider::LookAndFeelMethods
(for instance, if you want a knob, overridedrawRotarySlider()
). -
Inherit from
juce::Slider
itself, overriding thepaint()
method , and, if necessary, theresized()
method (whichSlider
inherits fromComponent
). This is more flexible, as it allows you to directly draw the component using a juce::Graphics object, which flexibly lets you draw stuff into the bounds of the component you are.
Thanks for getting back to me, I have tried that, I also have my own custom look and feel class, Is th possible to send you the file to see where my error is please?
Regards
Sure. The best way to do that is to set up a Github or Gitlab repository.
If you don’t know how to use them, they’re nothing to be afraid of.
I don’t have a github, Can i just send it as a email.
Regards
no. the required context isn’t really there in just one file, and nobody wants to download random zips. go ahead and put it up.
plus, its easy enough to make an account on one of several such services
Thanks for getting back to me, I have setup an account but it says the file is to big.
Regards
So i have had to add the plugineditor files and the customlookand feel files. Thanks.
https://github.com/JIMJAY624/Interface
Thanks for getting back to me, I have setup an account but it says the file is to big.
Regards
Thanks for getting back to me my repo is https://github.com/JIMJAY624/Interface
you forgot to addAndMakeVisible() on the sliders. all juce components need to know which their parent component is and be told to be visible in order to show up.
also you should remove most of the lines in the constructor about preparing the sliders and instead use the slider attachments you have there. you don’t eveb have to wrap them in unique_ptr if you write an initializer list before the constructor’s function body
Thanks for getting back to me, My repo is GitHub - JIMJAY624/Interface
ok thanks