Merge pull request #58 from jameshball/open-oscilloscope-button

Add button to open software oscilloscope
pull/170/head
James H Ball 2023-08-27 16:41:34 +01:00 zatwierdzone przez GitHub
commit 8bb67e3c8d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -83,6 +83,13 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
};
addAndMakeVisible(visualiser);
addAndMakeVisible(openOscilloscope);
openOscilloscope.onClick = [this] {
// TODO: Log if this fails
juce::URL("https://james.ball.sh/oscilloscope").launchInDefaultBrowser();
};
addAndMakeVisible(frequencyLabel);
callbackIndex = audioProcessor.pitchDetector.addCallback(
@ -133,6 +140,8 @@ void MainComponent::resized() {
frequencyLabel.setBounds(bounds.removeFromTop(20));
bounds.removeFromTop(padding);
openOscilloscope.setBounds(bounds.removeFromBottom(buttonHeight).withSizeKeepingCentre(160, buttonHeight));
bounds.removeFromBottom(padding);
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
visualiser.setBounds(bounds.withSizeKeepingCentre(minDim, minDim));
}

Wyświetl plik

@ -30,6 +30,7 @@ private:
juce::TextButton createFile{"Create File"};
VisualiserComponent visualiser{2, audioProcessor};
juce::TextButton openOscilloscope{"Open Oscilloscope"};
juce::Label frequencyLabel;
int callbackIndex = -1;