/assets/src makelist (in the juce_add_binary_data() function)
Example_svg for an Example.svg file.
paint() for example:
const auto svg = Drawable::createFromImageData(BinaryData::NOI_svg, BinaryData::NOI_svgSize);
// juce::AffineTransform scale = Set::scale(0.2);
juce::Rectangle position = {140.f, 495.f, 35.f, 35.f};
juce::RectanglePlacement placement = (36);
svg->setTransformToFit(position, placement);
svg->draw(g, 1.0);
public juce::AudioProcessorParameter::Listenervoid parameterValueChanged(int parameterIndex, float newvalue) override;public juce::Timervoid timerCallback() override;startTimerHz(60)juce::atomic<bool> parametersChangedparameterValueChanged() withparametersChanged.set(true);timerCallback() function you can addif (parametersChanged.compareAndSetBool(false, true)) {repaint();}juce::componentbackground_component object to the editoraddAndMakeVisible(background_component) in the editor constructor background_component.setBufferedToImage(true);paintOverChildren() instead of
paint() (by default, background_component is a children of the editor and thus painted over)resized() add background_component.setBounds(getBounds())background_component.paint()
in paintOverChildren()
namespace CustomColors
{
const juce::Colour brown = juce::Colour::fromString("FF50322a");
const juce::Colour green = juce::Colour::fromString("FF608537");
}juce::ComponenthitTest() methodclass circleSlider : public juce::Slider {
bool hitTest(int x, int y) override {
int h = this->getWidth() / 2;
int k = this->getHeight() / 2;
// disk equation
// (x-h)^2 + (y-k)^2 < r^2
// (h, k) the center of the circle, r it radius
// (x, y) the position to test
bool is_hit = (x - h) * (x - h) + (y - k) * (y - k) <= (h * h);
return is_hit;}
};