kopia lustrzana https://github.com/jameshball/osci-render
Make visualiser fullscreen work when controlled from the DAW
rodzic
8cedb4f55c
commit
09014614e5
|
@ -141,9 +141,13 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
|
||||||
resized();
|
resized();
|
||||||
repaint();
|
repaint();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
visualiserFullScreen->addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainComponent::~MainComponent() {}
|
MainComponent::~MainComponent() {
|
||||||
|
audioProcessor.visualiserParameters.visualiserFullScreen->removeListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
void MainComponent::updateFileLabel() {
|
void MainComponent::updateFileLabel() {
|
||||||
showLeftArrow = audioProcessor.getCurrentFileIndex() > 0;
|
showLeftArrow = audioProcessor.getCurrentFileIndex() > 0;
|
||||||
|
@ -160,6 +164,17 @@ void MainComponent::updateFileLabel() {
|
||||||
resized();
|
resized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainComponent::parameterValueChanged(int parameterIndex, float newValue) {
|
||||||
|
juce::MessageManager::callAsync([this] {
|
||||||
|
pluginEditor.resized();
|
||||||
|
pluginEditor.repaint();
|
||||||
|
resized();
|
||||||
|
repaint();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainComponent::parameterGestureChanged(int parameterIndex, bool gestureIsStarting) {}
|
||||||
|
|
||||||
void MainComponent::resized() {
|
void MainComponent::resized() {
|
||||||
juce::Rectangle<int> bounds = getLocalBounds().withTrimmedTop(20).reduced(20);
|
juce::Rectangle<int> bounds = getLocalBounds().withTrimmedTop(20).reduced(20);
|
||||||
auto buttonWidth = 120;
|
auto buttonWidth = 120;
|
||||||
|
|
|
@ -10,13 +10,16 @@
|
||||||
#include "components/SvgButton.h"
|
#include "components/SvgButton.h"
|
||||||
|
|
||||||
class OscirenderAudioProcessorEditor;
|
class OscirenderAudioProcessorEditor;
|
||||||
class MainComponent : public juce::GroupComponent {
|
class MainComponent : public juce::GroupComponent, public juce::AudioProcessorParameter::Listener {
|
||||||
public:
|
public:
|
||||||
MainComponent(OscirenderAudioProcessor&, OscirenderAudioProcessorEditor&);
|
MainComponent(OscirenderAudioProcessor&, OscirenderAudioProcessorEditor&);
|
||||||
~MainComponent() override;
|
~MainComponent() override;
|
||||||
|
|
||||||
void resized() override;
|
void resized() override;
|
||||||
void updateFileLabel();
|
void updateFileLabel();
|
||||||
|
void parameterValueChanged(int parameterIndex, float newValue) override;
|
||||||
|
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OscirenderAudioProcessor& audioProcessor;
|
OscirenderAudioProcessor& audioProcessor;
|
||||||
OscirenderAudioProcessorEditor& pluginEditor;
|
OscirenderAudioProcessorEditor& pluginEditor;
|
||||||
|
|
|
@ -20,15 +20,14 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p) : CommonPluginEdito
|
||||||
}
|
}
|
||||||
|
|
||||||
visualiserFullScreenChanged();
|
visualiserFullScreenChanged();
|
||||||
|
|
||||||
resized();
|
|
||||||
repaint();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
resized();
|
resized();
|
||||||
|
visualiserFullScreen->addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
SosciPluginEditor::~SosciPluginEditor() {
|
SosciPluginEditor::~SosciPluginEditor() {
|
||||||
|
audioProcessor.visualiserParameters.visualiserFullScreen->removeListener(this);
|
||||||
menuBar.setModel(nullptr);
|
menuBar.setModel(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,4 +84,14 @@ void SosciPluginEditor::visualiserFullScreenChanged() {
|
||||||
volume.setVisible(!fullScreen);
|
volume.setVisible(!fullScreen);
|
||||||
visualiserSettingsWrapper.setVisible(!fullScreen);
|
visualiserSettingsWrapper.setVisible(!fullScreen);
|
||||||
menuBar.setVisible(!fullScreen);
|
menuBar.setVisible(!fullScreen);
|
||||||
|
resized();
|
||||||
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SosciPluginEditor::parameterValueChanged(int parameterIndex, float newValue) {
|
||||||
|
juce::MessageManager::callAsync([this] {
|
||||||
|
visualiserFullScreenChanged();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void SosciPluginEditor::parameterGestureChanged(int parameterIndex, bool gestureIsStarting) {}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "components/SosciMainMenuBarModel.h"
|
#include "components/SosciMainMenuBarModel.h"
|
||||||
#include "components/SvgButton.h"
|
#include "components/SvgButton.h"
|
||||||
|
|
||||||
class SosciPluginEditor : public CommonPluginEditor, public juce::FileDragAndDropTarget {
|
class SosciPluginEditor : public CommonPluginEditor, public juce::FileDragAndDropTarget, public juce::AudioProcessorParameter::Listener {
|
||||||
public:
|
public:
|
||||||
SosciPluginEditor(SosciAudioProcessor&);
|
SosciPluginEditor(SosciAudioProcessor&);
|
||||||
~SosciPluginEditor() override;
|
~SosciPluginEditor() override;
|
||||||
|
@ -19,6 +19,8 @@ public:
|
||||||
bool isInterestedInFileDrag(const juce::StringArray& files) override;
|
bool isInterestedInFileDrag(const juce::StringArray& files) override;
|
||||||
void filesDropped(const juce::StringArray& files, int x, int y) override;
|
void filesDropped(const juce::StringArray& files, int x, int y) override;
|
||||||
void visualiserFullScreenChanged();
|
void visualiserFullScreenChanged();
|
||||||
|
void parameterValueChanged(int parameterIndex, float newValue) override;
|
||||||
|
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SosciAudioProcessor& audioProcessor;
|
SosciAudioProcessor& audioProcessor;
|
||||||
|
|
Ładowanie…
Reference in New Issue