26 :
UIBlock(5, 2,
"Reverb",
"reverb parameters")
29 irLength.setSliderStyle(juce::Slider::RotaryVerticalDrag);
30 preDelay.setSliderStyle(juce::Slider::RotaryVerticalDrag);
31 irGain.setSliderStyle(juce::Slider::RotaryVerticalDrag);
32 outGain.setSliderStyle(juce::Slider::RotaryVerticalDrag);
33 wetRatio.setSliderStyle(juce::Slider::RotaryVerticalDrag);
35 irLength.setTextBoxStyle(juce::Slider::TextBoxBelow,
true, 50, 20);
36 preDelay.setTextBoxStyle(juce::Slider::TextBoxBelow,
true, 50, 20);
37 irGain.setTextBoxStyle(juce::Slider::TextBoxBelow,
true, 50, 20);
38 outGain.setTextBoxStyle(juce::Slider::TextBoxBelow,
true, 50, 20);
39 wetRatio.setTextBoxStyle(juce::Slider::TextBoxBelow,
true, 50, 20);
41 irLength.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colour(0x00000000));
42 preDelay.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colour(0x00000000));
43 irGain.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colour(0x00000000));
44 outGain.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colour(0x00000000));
45 wetRatio.setColour(juce::Slider::ColourIds::textBoxOutlineColourId, juce::Colour(0x00000000));
47 irLength.setComponentID(processor.PID_IR_LENGTH);
48 preDelay.setComponentID(processor.PID_PREDELAY);
49 irGain.setComponentID(processor.PID_IR_GAIN);
50 outGain.setComponentID(processor.PID_AUDIO_OUT_GAIN);
51 wetRatio.setComponentID(processor.PID_WETRATIO);
54 irLengthLabel.setText(
"reverb length", juce::NotificationType::dontSendNotification);
55 irLengthLabel.setJustificationType(juce::Justification::centredBottom);
57 preDelayLabel.setText(
"predelay", juce::NotificationType::dontSendNotification);
58 preDelayLabel.setJustificationType(juce::Justification::centredBottom);
60 irGainLabel.setText(
"reverb volume", juce::NotificationType::dontSendNotification);
61 irGainLabel.setJustificationType(juce::Justification::centredBottom);
63 outGainLabel.setText(
"output volume", juce::NotificationType::dontSendNotification);
64 outGainLabel.setJustificationType(juce::Justification::centredBottom);
66 wetRatioLabel.setText(
"wet ratio", juce::NotificationType::dontSendNotification);
67 wetRatioLabel.setJustificationType(juce::Justification::centredBottom);
69 irLengthLabel.attachToComponent(&irLength,
false);
70 preDelayLabel.attachToComponent(&preDelay,
false);
71 irGainLabel.attachToComponent(&irGain,
false);
72 outGainLabel.attachToComponent(&outGain,
false);
73 wetRatioLabel.attachToComponent(&wetRatio,
false);
76 irLengthAttachment.reset(
new SliderAttachment(processor.parameters,
77 irLength.getComponentID(),
80 preDelayAttachment.reset(
new SliderAttachment(processor.parameters,
81 preDelay.getComponentID(),
84 irGainAttachment.reset(
new SliderAttachment(processor.parameters,
85 irGain.getComponentID(),
88 outGainAttachment.reset(
new SliderAttachment(processor.parameters,
89 outGain.getComponentID(),
92 wetRatioAttachment.reset(
new SliderAttachment(processor.parameters,
93 wetRatio.getComponentID(),
97 irLength.setNumDecimalPlacesToDisplay(2);
98 irLength.setTextValueSuffix(
" s");
100 preDelay.setNumDecimalPlacesToDisplay(2);
101 preDelay.setTextValueSuffix(
" ms");
103 irGain.setNumDecimalPlacesToDisplay(2);
104 irGain.setTextValueSuffix(
" dB");
106 outGain.setNumDecimalPlacesToDisplay(2);
107 outGain.setTextValueSuffix(
" dB");
109 wetRatio.setNumDecimalPlacesToDisplay(2);
112 addAndMakeVisible(irLength);
113 addAndMakeVisible(preDelay);
114 addAndMakeVisible(irGain);
115 addAndMakeVisible(outGain);
116 addAndMakeVisible(wetRatio);
122 g.fillAll(getLookAndFeel().findColour(juce::ResizableWindow::backgroundColourId));
124 g.setColour(juce::Colours::white);
127 juce::Rectangle<
int> bounds(getLocalBounds());
128 getLookAndFeel().drawGroupComponentOutline(g, bounds.getWidth(), bounds.getHeight(), getText(),
129 juce::Justification(juce::Justification::centredTop), *
this);
141 juce::Rectangle<
int> bounds(getLocalBounds());
143 int height = bounds.getHeight();
144 int padding = (
int)(height * 0.06);
145 bounds.reduce(padding, padding);
148 auto cells = getComponentCells(bounds);
150 irLength.setBounds(cells[0]);
151 preDelay.setBounds(cells[1]);
152 irGain.setBounds(cells[2]);
153 outGain.setBounds(cells[3]);
154 wetRatio.setBounds(cells[4]);
float getParam(const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) const
Internal method used to get (and check) a parameter's value.
void resized() override
Manages the layout of UIReverbBlock when the block is resized.
UIReverbBlock(AudioProcessor &processor)
Constructs an UIReverbBlock object.