/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::Rectangleposition = {140.f, 495.f, 35.f, 35.f}; juce::RectanglePlacement placement = (36); svg->setTransformToFit(position, placement); svg->draw(g, 1.0);
public juce::AudioProcessorParameter::Listener
void parameterValueChanged(int parameterIndex, float newvalue) override;
public juce::Timer
void timerCallback() override;
startTimerHz(60)
juce::atomic<bool> parametersChanged
parameterValueChanged()
withparametersChanged.set(true);
timerCallback()
function you can addif (parametersChanged.compareAndSetBool(false, true)) {repaint();}
juce::component
background_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()
juce::Component
hitTest()
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;} };