Save visualiser fullscreen state to project

pull/251/head^2
James H Ball 2024-08-22 14:42:54 +01:00 zatwierdzone przez James H Ball
rodzic 0ea3c319d7
commit 08a196fb2c
6 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

@ -124,19 +124,19 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
createFile.triggerClick();
};
if (!pluginEditor.visualiserFullScreen) {
if (!audioProcessor.visualiserFullScreen->getBoolValue()) {
addAndMakeVisible(pluginEditor.visualiser);
}
pluginEditor.visualiser.setFullScreenCallback([this](FullScreenMode mode) {
if (mode == FullScreenMode::TOGGLE) {
pluginEditor.visualiserFullScreen = !pluginEditor.visualiserFullScreen;
audioProcessor.visualiserFullScreen->setBoolValueNotifyingHost(!audioProcessor.visualiserFullScreen->getBoolValue());
} else if (mode == FullScreenMode::FULL_SCREEN) {
pluginEditor.visualiserFullScreen = true;
audioProcessor.visualiserFullScreen->setBoolValueNotifyingHost(true);
} else if (mode == FullScreenMode::MAIN_COMPONENT) {
pluginEditor.visualiserFullScreen = false;
audioProcessor.visualiserFullScreen->setBoolValueNotifyingHost(false);
}
pluginEditor.visualiser.setFullScreen(pluginEditor.visualiserFullScreen);
pluginEditor.visualiser.setFullScreen(audioProcessor.visualiserFullScreen->getBoolValue());
pluginEditor.resized();
pluginEditor.repaint();
@ -234,7 +234,7 @@ void MainComponent::resized() {
frequencyLabel.setBounds(bounds.removeFromTop(20));
bounds.removeFromTop(padding);
if (!pluginEditor.visualiserFullScreen) {
if (!audioProcessor.visualiserFullScreen->getBoolValue()) {
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
juce::Point<int> localTopLeft = {bounds.getX(), bounds.getY()};
juce::Point<int> topLeft = pluginEditor.getLocalPoint(this, localTopLeft);

Wyświetl plik

@ -143,7 +143,7 @@ void OscirenderAudioProcessorEditor::paint(juce::Graphics& g) {
void OscirenderAudioProcessorEditor::resized() {
auto area = getLocalBounds();
if (visualiserFullScreen) {
if (audioProcessor.visualiserFullScreen->getBoolValue()) {
visualiser.setBounds(area);
return;
}

Wyświetl plik

@ -49,7 +49,6 @@ public:
std::atomic<bool> editingCustomFunction = false;
VisualiserComponent visualiser{audioProcessor, nullptr, audioProcessor.legacyVisualiserEnabled->getBoolValue()};
std::atomic<bool> visualiserFullScreen = false;
SettingsComponent settings{audioProcessor, *this};
juce::ComponentAnimator codeEditorAnimator;

Wyświetl plik

@ -179,6 +179,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
booleanParameters.push_back(smudgesEnabled);
booleanParameters.push_back(upsamplingEnabled);
booleanParameters.push_back(legacyVisualiserEnabled);
booleanParameters.push_back(visualiserFullScreen);
for (auto parameter : booleanParameters) {
addParameter(parameter);

Wyświetl plik

@ -162,6 +162,8 @@ public:
BooleanParameter* smudgesEnabled = new BooleanParameter("Show Smudges", "smudgesEnabled", VERSION_HINT, true, "Adds a subtle layer of dirt/smudges to the oscilloscope display to make it look more realistic.");
BooleanParameter* upsamplingEnabled = new BooleanParameter("Upsample Audio", "upsamplingEnabled", VERSION_HINT, false, "Upsamples the audio before visualising it to make it appear more realistic, at the expense of performance.");
BooleanParameter* legacyVisualiserEnabled = new BooleanParameter("Use Legacy Visualiser", "legacyVisualiserEnabled", VERSION_HINT, false, "Replaces the realistic oscilloscope visualiser with the legacy visualiser. This may improve performance.");
BooleanParameter* visualiserFullScreen = new BooleanParameter("Visualiser Fullscreen", "visualiserFullScreen", VERSION_HINT, false, "Makes the software visualiser fullscreen.");
std::shared_ptr<Effect> persistenceEffect = std::make_shared<Effect>(
new EffectParameter(
"Persistence",

Wyświetl plik

@ -654,9 +654,9 @@
</LINUX_MAKE>
<VS2022 targetFolder="Builds/VisualStudio2022" smallIcon="pSc1mq" bigIcon="pSc1mq">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" targetName="osci-render" enablePluginBinaryCopyStep="1"/>
<CONFIGURATION isDebug="1" name="Debug" targetName="osci-render"/>
<CONFIGURATION isDebug="0" name="Release" targetName="osci-render" alwaysGenerateDebugSymbols="1"
debugInformationFormat="ProgramDatabase" enablePluginBinaryCopyStep="1"/>
debugInformationFormat="ProgramDatabase"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_audio_basics" path="../../../JUCE/modules"/>