Add button to open Audio/MIDI settings from MIDI section

pull/216/head v2.0.8
James Ball 2024-01-31 17:08:00 +00:00 zatwierdzone przez James H Ball
rodzic 2fcaa6431d
commit abad00a308
2 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -38,6 +38,13 @@ MidiComponent::MidiComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
envelope.addListener(&audioProcessor);
envelope.setGrid(EnvelopeComponent::GridBoth, EnvelopeComponent::GridNone, 0.1, 0.25);
if (juce::JUCEApplicationBase::isStandaloneApp()) {
addAndMakeVisible(midiSettingsButton);
midiSettingsButton.onClick = [this]() {
pluginEditor.openAudioSettings();
};
}
audioProcessor.attackTime->addListener(this);
audioProcessor.attackLevel->addListener(this);
audioProcessor.attackShape->addListener(this);
@ -105,6 +112,9 @@ void MidiComponent::resized() {
midiToggle.setBounds(topRow.removeFromLeft(120));
topRow.removeFromLeft(80);
voicesSlider.setBounds(topRow.removeFromLeft(250));
if (midiSettingsButton.isVisible()) {
midiSettingsButton.setBounds(topRow.removeFromRight(160));
}
area.removeFromTop(5);
keyboard.setBounds(area.removeFromBottom(50));
envelope.setBounds(area);

Wyświetl plik

@ -22,6 +22,7 @@ private:
juce::ToggleButton midiToggle{"Enable MIDI"};
juce::Slider voicesSlider;
juce::Label voicesLabel;
juce::TextButton midiSettingsButton{"Audio/MIDI Settings..."};
juce::MidiKeyboardComponent keyboard{audioProcessor.keyboardState, juce::MidiKeyboardComponent::horizontalKeyboard};
EnvelopeContainerComponent envelope;