kopia lustrzana https://github.com/jameshball/osci-render
Move randomise button, change icon, and add a tooltip
rodzic
566ecc0968
commit
d553e94c6f
|
@ -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 |
|
@ -25,6 +25,8 @@ EffectsComponent::EffectsComponent(OscirenderAudioProcessor& p, OscirenderAudioP
|
||||||
|
|
||||||
addAndMakeVisible(randomiseButton);
|
addAndMakeVisible(randomiseButton);
|
||||||
|
|
||||||
|
randomiseButton.setTooltip("Randomise all effect parameter values, randomise which effects are enabled, and randomise their order.");
|
||||||
|
|
||||||
randomiseButton.onClick = [this] {
|
randomiseButton.onClick = [this] {
|
||||||
itemData.randomise();
|
itemData.randomise();
|
||||||
listBox.updateContent();
|
listBox.updateContent();
|
||||||
|
@ -46,8 +48,10 @@ EffectsComponent::~EffectsComponent() {
|
||||||
|
|
||||||
void EffectsComponent::resized() {
|
void EffectsComponent::resized() {
|
||||||
auto area = getLocalBounds();
|
auto area = getLocalBounds();
|
||||||
auto titleBar = area.removeFromTop(20);
|
auto titleBar = area.removeFromTop(30);
|
||||||
randomiseButton.setBounds(titleBar.removeFromRight(20));
|
titleBar.removeFromLeft(100);
|
||||||
|
|
||||||
|
randomiseButton.setBounds(titleBar.removeFromLeft(20));
|
||||||
area = area.reduced(20);
|
area = area.reduced(20);
|
||||||
frequency.setBounds(area.removeFromTop(30));
|
frequency.setBounds(area.removeFromTop(30));
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ SmoothEffect::SmoothEffect() {}
|
||||||
SmoothEffect::~SmoothEffect() {}
|
SmoothEffect::~SmoothEffect() {}
|
||||||
|
|
||||||
Point SmoothEffect::apply(int index, Point input, const std::vector<double>& values, double sampleRate) {
|
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;
|
weight *= 0.95;
|
||||||
double strength = 10;
|
double strength = 10;
|
||||||
weight = std::log(strength * weight + 1) / std::log(strength + 1);
|
weight = std::log(strength * weight + 1) / std::log(strength + 1);
|
||||||
|
|
|
@ -5,6 +5,8 @@ class SvgButton : public juce::DrawableButton, public juce::AudioProcessorParame
|
||||||
public:
|
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) {
|
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);
|
auto doc = juce::XmlDocument::parse(svg);
|
||||||
|
|
||||||
|
setMouseCursor(juce::MouseCursor::PointingHandCursor);
|
||||||
|
|
||||||
changeSvgColour(doc.get(), colour);
|
changeSvgColour(doc.get(), colour);
|
||||||
normalImage = juce::Drawable::createFromSVG(*doc);
|
normalImage = juce::Drawable::createFromSVG(*doc);
|
||||||
|
|
Ładowanie…
Reference in New Issue