Save visualiser fullscreen state to project

pull/249/head
James H Ball 2024-08-22 14:42:54 +01:00
rodzic 9672e826ac
commit 997de907bc
6 zmienionych plików z 12 dodań i 10 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -179,6 +179,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
booleanParameters.push_back(smudgesEnabled); booleanParameters.push_back(smudgesEnabled);
booleanParameters.push_back(upsamplingEnabled); booleanParameters.push_back(upsamplingEnabled);
booleanParameters.push_back(legacyVisualiserEnabled); booleanParameters.push_back(legacyVisualiserEnabled);
booleanParameters.push_back(visualiserFullScreen);
for (auto parameter : booleanParameters) { for (auto parameter : booleanParameters) {
addParameter(parameter); 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* 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* 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* 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>( std::shared_ptr<Effect> persistenceEffect = std::make_shared<Effect>(
new EffectParameter( new EffectParameter(
"Persistence", "Persistence",

Wyświetl plik

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