mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
Limit rotary knob value text shown by 1 decimal
This commit is contained in:
parent
8c0f55f1e7
commit
d79af00b23
3 changed files with 47 additions and 26 deletions
|
|
@ -513,7 +513,6 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
|
||||||
setupLabel(filterLabel, "FILTER");
|
setupLabel(filterLabel, "FILTER");
|
||||||
setupCB(filterTypeBox, filterTypeAttach, "filterType", {"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"});
|
setupCB(filterTypeBox, filterTypeAttach, "filterType", {"LP 12dB", "LP 24dB", "Band Pass", "High Pass", "Notch"});
|
||||||
setupParam(filterCutoffKnob, filterCutoffAttach, "filterCutoff", "CUTOFF");
|
setupParam(filterCutoffKnob, filterCutoffAttach, "filterCutoff", "CUTOFF");
|
||||||
filterCutoffKnob.setNumDecimalPlacesToDisplay(1);
|
|
||||||
setupParam(filterResKnob, filterResAttach, "filterRes", "RES");
|
setupParam(filterResKnob, filterResAttach, "filterRes", "RES");
|
||||||
setupParam(filterEnvAmtKnob, filterEnvAmtAttach, "filterEnvAmt", "ENV AMT");
|
setupParam(filterEnvAmtKnob, filterEnvAmtAttach, "filterEnvAmt", "ENV AMT");
|
||||||
setupParam(keyTrackKnob, keyTrackAttach, "keyTrack", "KEY TRK");
|
setupParam(keyTrackKnob, keyTrackAttach, "keyTrack", "KEY TRK");
|
||||||
|
|
@ -634,20 +633,20 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
|
||||||
}
|
}
|
||||||
|
|
||||||
scaleLabel.setText("SCALE", juce::dontSendNotification);
|
scaleLabel.setText("SCALE", juce::dontSendNotification);
|
||||||
scaleLabel.setFont(juce::Font(juce::FontOptions(9.0f)));
|
scaleLabel.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||||
scaleLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
scaleLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||||
scaleLabel.setJustificationType(juce::Justification::centredRight);
|
scaleLabel.setJustificationType(juce::Justification::centredRight);
|
||||||
addAndMakeVisible(scaleLabel);
|
addAndMakeVisible(scaleLabel);
|
||||||
|
|
||||||
midiLabel.setText("MIDI IN", juce::dontSendNotification);
|
midiLabel.setText("MIDI IN", juce::dontSendNotification);
|
||||||
midiLabel.setFont(juce::Font(juce::FontOptions(9.0f)));
|
midiLabel.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||||
midiLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
midiLabel.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||||
midiLabel.setJustificationType(juce::Justification::centredLeft);
|
midiLabel.setJustificationType(juce::Justification::centredLeft);
|
||||||
addAndMakeVisible(midiLabel);
|
addAndMakeVisible(midiLabel);
|
||||||
|
|
||||||
auto setupTransposeLabel = [&](juce::Label& label, const juce::String& text) {
|
auto setupTransposeLabel = [&](juce::Label& label, const juce::String& text) {
|
||||||
label.setText(text, juce::dontSendNotification);
|
label.setText(text, juce::dontSendNotification);
|
||||||
label.setFont(juce::Font(juce::FontOptions(9.0f)));
|
label.setFont(juce::Font(juce::FontOptions(13.0f).withStyle("Bold")));
|
||||||
label.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
label.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
|
||||||
label.setJustificationType(juce::Justification::centredLeft);
|
label.setJustificationType(juce::Justification::centredLeft);
|
||||||
addAndMakeVisible(label);
|
addAndMakeVisible(label);
|
||||||
|
|
@ -944,6 +943,20 @@ void MainContentComponent::paint(juce::Graphics& g) {
|
||||||
g.setOpacity(1.0f);
|
g.setOpacity(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Header section background
|
||||||
|
{
|
||||||
|
auto rect = juce::Rectangle<float>(10.0f, 0.0f, 1640.0f, 80.0f);
|
||||||
|
auto glow = rect.expanded(6.0f);
|
||||||
|
g.setColour(juce::Colour(0xff222222).withAlpha(0.25f));
|
||||||
|
g.fillRoundedRectangle(glow, 12.0f);
|
||||||
|
juce::ColourGradient fillGrad(juce::Colour(0xBB222222), rect.getCentreX(), rect.getY(),
|
||||||
|
juce::Colour(0xBB111111), rect.getCentreX(), rect.getBottom(), false);
|
||||||
|
g.setGradientFill(fillGrad);
|
||||||
|
g.fillRoundedRectangle(rect, 9.0f);
|
||||||
|
g.setColour(juce::Colour(0xff333333));
|
||||||
|
g.drawRoundedRectangle(rect, 9.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
// Load logo
|
// Load logo
|
||||||
if (!logoLoaded) {
|
if (!logoLoaded) {
|
||||||
auto img = juce::ImageFileFormat::loadFrom(
|
auto img = juce::ImageFileFormat::loadFrom(
|
||||||
|
|
@ -1213,16 +1226,16 @@ void MainContentComponent::resized() {
|
||||||
int comboH2 = 28, labelH2 = 20;
|
int comboH2 = 28, labelH2 = 20;
|
||||||
int comboY2 = (headerH - comboH2) / 2;
|
int comboY2 = (headerH - comboH2) / 2;
|
||||||
int labelY2 = (headerH - labelH2) / 2;
|
int labelY2 = (headerH - labelH2) / 2;
|
||||||
octaveTransposeLabel.setBounds(1112, labelY2, 30, labelH2);
|
octaveTransposeLabel.setBounds(1112, labelY2, 44, labelH2);
|
||||||
octaveTransposeBox.setBounds(1142, comboY2, 64, comboH2);
|
octaveTransposeBox.setBounds(1156, comboY2, 64, comboH2);
|
||||||
semitoneTransposeLabel.setBounds(1214, labelY2, 32, labelH2);
|
semitoneTransposeLabel.setBounds(1226, labelY2, 46, labelH2);
|
||||||
semitoneTransposeBox.setBounds(1246, comboY2, 74, comboH2);
|
semitoneTransposeBox.setBounds(1272, comboY2, 74, comboH2);
|
||||||
|
|
||||||
midiLabel.setBounds(1340, labelY2, 46, labelH2);
|
midiLabel.setBounds(1354, labelY2, 64, labelH2);
|
||||||
midiLed.setBounds(1390, (headerH - 10) / 2, 10, 10);
|
midiLed.setBounds(1418, (headerH - 10) / 2, 10, 10);
|
||||||
|
|
||||||
scaleLabel.setBounds(1514, labelY2, 42, labelH2);
|
scaleLabel.setBounds(1514, labelY2, 58, labelH2);
|
||||||
uiScaleBox.setBounds(1560, comboY2, 80, comboH2);
|
uiScaleBox.setBounds(1574, comboY2, 80, comboH2);
|
||||||
|
|
||||||
// Visualizer area
|
// Visualizer area
|
||||||
int vizY = 746;
|
int vizY = 746;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,14 @@ private:
|
||||||
juce::Image knobOverlay;
|
juce::Image knobOverlay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class KnobSlider : public juce::Slider {
|
||||||
|
public:
|
||||||
|
using juce::Slider::Slider;
|
||||||
|
juce::String getTextFromValue(double v) override {
|
||||||
|
return juce::String::formatted("%.1f", v);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class ComboBoxLookAndFeel : public juce::LookAndFeel_V4 {
|
class ComboBoxLookAndFeel : public juce::LookAndFeel_V4 {
|
||||||
public:
|
public:
|
||||||
void drawComboBox(juce::Graphics& g, int width, int height,
|
void drawComboBox(juce::Graphics& g, int width, int height,
|
||||||
|
|
@ -146,36 +154,36 @@ private:
|
||||||
|
|
||||||
juce::ComboBox octaveTransposeBox, semitoneTransposeBox;
|
juce::ComboBox octaveTransposeBox, semitoneTransposeBox;
|
||||||
juce::ComboBox osc1WaveBox;
|
juce::ComboBox osc1WaveBox;
|
||||||
juce::Slider osc1OctKnob, osc1SemiKnob, osc1FineKnob, osc1LevelKnob;
|
KnobSlider osc1OctKnob, osc1SemiKnob, osc1FineKnob, osc1LevelKnob;
|
||||||
|
|
||||||
juce::ComboBox osc2WaveBox;
|
juce::ComboBox osc2WaveBox;
|
||||||
juce::Slider osc2OctKnob, osc2SemiKnob, osc2FineKnob, osc2LevelKnob, phaseOffsetKnob;
|
KnobSlider osc2OctKnob, osc2SemiKnob, osc2FineKnob, osc2LevelKnob, phaseOffsetKnob;
|
||||||
|
|
||||||
juce::ComboBox filterTypeBox;
|
juce::ComboBox filterTypeBox;
|
||||||
juce::Slider filterCutoffKnob, filterResKnob, filterEnvAmtKnob, keyTrackKnob;
|
KnobSlider filterCutoffKnob, filterResKnob, filterEnvAmtKnob, keyTrackKnob;
|
||||||
|
|
||||||
juce::Slider envAttackKnob, envDecayKnob, envSustainKnob, envReleaseKnob;
|
KnobSlider envAttackKnob, envDecayKnob, envSustainKnob, envReleaseKnob;
|
||||||
juce::Slider fEnvAttackKnob, fEnvDecayKnob, fEnvSustainKnob, fEnvReleaseKnob;
|
KnobSlider fEnvAttackKnob, fEnvDecayKnob, fEnvSustainKnob, fEnvReleaseKnob;
|
||||||
|
|
||||||
juce::Slider panKnob, driveKnob, masterKnob, pbRangeKnob;
|
KnobSlider panKnob, driveKnob, masterKnob, pbRangeKnob;
|
||||||
|
|
||||||
// FX controls
|
// FX controls
|
||||||
juce::ComboBox distTypeBox;
|
juce::ComboBox distTypeBox;
|
||||||
juce::Slider distAmountKnob, distSymmetryKnob, distToneKnob;
|
KnobSlider distAmountKnob, distSymmetryKnob, distToneKnob;
|
||||||
juce::Slider compThresholdKnob, compRatioKnob, compAttackKnob, compReleaseKnob, compMakeupKnob;
|
KnobSlider compThresholdKnob, compRatioKnob, compAttackKnob, compReleaseKnob, compMakeupKnob;
|
||||||
juce::Slider autoPanRateKnob, autoPanDepthKnob, autoPanPhaseKnob;
|
KnobSlider autoPanRateKnob, autoPanDepthKnob, autoPanPhaseKnob;
|
||||||
juce::Slider limiterThresholdKnob, limiterCeilingKnob, limiterReleaseKnob;
|
KnobSlider limiterThresholdKnob, limiterCeilingKnob, limiterReleaseKnob;
|
||||||
|
|
||||||
// LFO controls
|
// LFO controls
|
||||||
juce::Slider lfo1RateKnob, lfo1DepthKnob;
|
KnobSlider lfo1RateKnob, lfo1DepthKnob;
|
||||||
juce::ComboBox lfo1ShapeBox, lfo1DestBox, lfo1SyncBox;
|
juce::ComboBox lfo1ShapeBox, lfo1DestBox, lfo1SyncBox;
|
||||||
juce::Slider lfo2RateKnob, lfo2DepthKnob;
|
KnobSlider lfo2RateKnob, lfo2DepthKnob;
|
||||||
juce::ComboBox lfo2ShapeBox, lfo2DestBox, lfo2SyncBox;
|
juce::ComboBox lfo2ShapeBox, lfo2DestBox, lfo2SyncBox;
|
||||||
|
|
||||||
// FX2 controls
|
// FX2 controls
|
||||||
juce::Slider delayTimeKnob, delayFbKnob, delayMixKnob, delayPingPongKnob;
|
KnobSlider delayTimeKnob, delayFbKnob, delayMixKnob, delayPingPongKnob;
|
||||||
juce::ComboBox delaySyncBox;
|
juce::ComboBox delaySyncBox;
|
||||||
juce::Slider reverbSizeKnob, reverbDampKnob, reverbMixKnob;
|
KnobSlider reverbSizeKnob, reverbDampKnob, reverbMixKnob;
|
||||||
|
|
||||||
// Preset menu
|
// Preset menu
|
||||||
juce::TextButton presetButton{"PRESET"};
|
juce::TextButton presetButton{"PRESET"};
|
||||||
|
|
|
||||||
BIN
bg.png
BIN
bg.png
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 2.7 MiB |
Loading…
Add table
Add a link
Reference in a new issue