kopia lustrzana https://github.com/jameshball/osci-render
Merge pull request #58 from jameshball/open-oscilloscope-button
Add button to open software oscilloscopepull/170/head
commit
8bb67e3c8d
|
@ -83,6 +83,13 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
|
||||||
};
|
};
|
||||||
|
|
||||||
addAndMakeVisible(visualiser);
|
addAndMakeVisible(visualiser);
|
||||||
|
addAndMakeVisible(openOscilloscope);
|
||||||
|
|
||||||
|
openOscilloscope.onClick = [this] {
|
||||||
|
// TODO: Log if this fails
|
||||||
|
juce::URL("https://james.ball.sh/oscilloscope").launchInDefaultBrowser();
|
||||||
|
};
|
||||||
|
|
||||||
addAndMakeVisible(frequencyLabel);
|
addAndMakeVisible(frequencyLabel);
|
||||||
|
|
||||||
callbackIndex = audioProcessor.pitchDetector.addCallback(
|
callbackIndex = audioProcessor.pitchDetector.addCallback(
|
||||||
|
@ -133,6 +140,8 @@ void MainComponent::resized() {
|
||||||
frequencyLabel.setBounds(bounds.removeFromTop(20));
|
frequencyLabel.setBounds(bounds.removeFromTop(20));
|
||||||
|
|
||||||
bounds.removeFromTop(padding);
|
bounds.removeFromTop(padding);
|
||||||
|
openOscilloscope.setBounds(bounds.removeFromBottom(buttonHeight).withSizeKeepingCentre(160, buttonHeight));
|
||||||
|
bounds.removeFromBottom(padding);
|
||||||
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
|
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
|
||||||
visualiser.setBounds(bounds.withSizeKeepingCentre(minDim, minDim));
|
visualiser.setBounds(bounds.withSizeKeepingCentre(minDim, minDim));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ private:
|
||||||
juce::TextButton createFile{"Create File"};
|
juce::TextButton createFile{"Create File"};
|
||||||
|
|
||||||
VisualiserComponent visualiser{2, audioProcessor};
|
VisualiserComponent visualiser{2, audioProcessor};
|
||||||
|
juce::TextButton openOscilloscope{"Open Oscilloscope"};
|
||||||
|
|
||||||
juce::Label frequencyLabel;
|
juce::Label frequencyLabel;
|
||||||
int callbackIndex = -1;
|
int callbackIndex = -1;
|
||||||
|
|
Ładowanie…
Reference in New Issue