feat: add octave and halftone transpose menus

This commit is contained in:
Armin 2026-07-14 01:19:44 +02:00
commit 6432ab060d
4 changed files with 43 additions and 2 deletions

View file

@ -543,6 +543,27 @@ MainContentComponent::MainContentComponent(ChromaFlockProcessor& p)
scaleLabel.setJustificationType(juce::Justification::centredRight);
addAndMakeVisible(scaleLabel);
auto setupTransposeLabel = [&](juce::Label& label, const juce::String& text) {
label.setText(text, juce::dontSendNotification);
label.setFont(juce::Font(9.0f));
label.setColour(juce::Label::textColourId, juce::Colour(0xff888888));
label.setJustificationType(juce::Justification::centredLeft);
addAndMakeVisible(label);
};
setupTransposeLabel(octaveTransposeLabel, "OCT");
setupTransposeLabel(semitoneTransposeLabel, "SEMI");
setupCombo(octaveTransposeBox);
octaveTransposeBox.addItemList(juce::StringArray{"-3", "-2", "-1", "0", "+1", "+2", "+3"}, 1);
octaveTransposeAttach = std::make_unique<ComboBoxAttachment>(
processorRef.apvts, "octaveTranspose", octaveTransposeBox);
setupCombo(semitoneTransposeBox);
semitoneTransposeBox.addItemList(
juce::StringArray{getSemitoneChoices()}, 1);
semitoneTransposeAttach = std::make_unique<ComboBoxAttachment>(
processorRef.apvts, "semitoneTranspose", semitoneTransposeBox);
addAndMakeVisible(vuMeter);
addAndMakeVisible(waveformDisplay);
addAndMakeVisible(spectrumAnalyzer);
@ -886,6 +907,11 @@ void MainContentComponent::resized() {
patchLCD.setBounds(118, 8, 360, 28);
prevPresetButton.setBounds(486, 8, 28, 28);
nextPresetButton.setBounds(518, 8, 28, 28);
octaveTransposeLabel.setBounds(1112, 10, 30, 20);
octaveTransposeBox.setBounds(1142, 8, 64, 24);
semitoneTransposeLabel.setBounds(1214, 10, 32, 20);
semitoneTransposeBox.setBounds(1246, 8, 74, 24);
scaleLabel.setBounds(1520, 10, 42, 20);
uiScaleBox.setBounds(1566, 8, 80, 24);