Move randomise button, change icon, and add a tooltip

pull/218/head
James Ball 2024-02-20 18:18:53 +00:00
rodzic 566ecc0968
commit d553e94c6f
4 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5M17,15A2,2 0 0,0 15,17A2,2 0 0,0 17,19A2,2 0 0,0 19,17A2,2 0 0,0 17,15Z" /></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17,3L22.25,7.5L17,12L22.25,16.5L17,21V18H14.26L11.44,15.18L13.56,13.06L15.5,15H17V12L17,9H15.5L6.5,18H2V15H5.26L14.26,6H17V3M2,6H6.5L9.32,8.82L7.2,10.94L5.26,9H2V6Z" /></svg>

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 354 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 244 B

Wyświetl plik

@ -25,6 +25,8 @@ EffectsComponent::EffectsComponent(OscirenderAudioProcessor& p, OscirenderAudioP
addAndMakeVisible(randomiseButton);
randomiseButton.setTooltip("Randomise all effect parameter values, randomise which effects are enabled, and randomise their order.");
randomiseButton.onClick = [this] {
itemData.randomise();
listBox.updateContent();
@ -46,8 +48,10 @@ EffectsComponent::~EffectsComponent() {
void EffectsComponent::resized() {
auto area = getLocalBounds();
auto titleBar = area.removeFromTop(20);
randomiseButton.setBounds(titleBar.removeFromRight(20));
auto titleBar = area.removeFromTop(30);
titleBar.removeFromLeft(100);
randomiseButton.setBounds(titleBar.removeFromLeft(20));
area = area.reduced(20);
frequency.setBounds(area.removeFromTop(30));

Wyświetl plik

@ -5,7 +5,7 @@ SmoothEffect::SmoothEffect() {}
SmoothEffect::~SmoothEffect() {}
Point SmoothEffect::apply(int index, Point input, const std::vector<double>& values, double sampleRate) {
double weight = values[0];
double weight = juce::jmax(values[0], 0.00001);
weight *= 0.95;
double strength = 10;
weight = std::log(strength * weight + 1) / std::log(strength + 1);

Wyświetl plik

@ -5,6 +5,8 @@ class SvgButton : public juce::DrawableButton, public juce::AudioProcessorParame
public:
SvgButton(juce::String name, juce::String svg, juce::Colour colour, juce::Colour colourOn, BooleanParameter* toggle = nullptr) : juce::DrawableButton(name, juce::DrawableButton::ButtonStyle::ImageFitted), toggle(toggle) {
auto doc = juce::XmlDocument::parse(svg);
setMouseCursor(juce::MouseCursor::PointingHandCursor);
changeSvgColour(doc.get(), colour);
normalImage = juce::Drawable::createFromSVG(*doc);