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();
|
||||
repaint();
|
||||
});
|
||||
|
||||
visualiserFullScreen->addListener(this);
|
||||
}
|
||||
|
||||
MainComponent::~MainComponent() {}
|
||||
MainComponent::~MainComponent() {
|
||||
audioProcessor.visualiserParameters.visualiserFullScreen->removeListener(this);
|
||||
}
|
||||
|
||||
void MainComponent::updateFileLabel() {
|
||||
showLeftArrow = audioProcessor.getCurrentFileIndex() > 0;
|
||||
|
@ -160,6 +164,17 @@ void MainComponent::updateFileLabel() {
|
|||
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() {
|
||||
juce::Rectangle<int> bounds = getLocalBounds().withTrimmedTop(20).reduced(20);
|
||||
auto buttonWidth = 120;
|
||||
|
|
|
@ -10,13 +10,16 @@
|
|||
#include "components/SvgButton.h"
|
||||
|
||||
class OscirenderAudioProcessorEditor;
|
||||
class MainComponent : public juce::GroupComponent {
|
||||
class MainComponent : public juce::GroupComponent, public juce::AudioProcessorParameter::Listener {
|
||||
public:
|
||||
MainComponent(OscirenderAudioProcessor&, OscirenderAudioProcessorEditor&);
|
||||
~MainComponent() override;
|
||||
|
||||
void resized() override;
|
||||
void updateFileLabel();
|
||||
void parameterValueChanged(int parameterIndex, float newValue) override;
|
||||
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
||||
|
||||
private:
|
||||
OscirenderAudioProcessor& audioProcessor;
|
||||
OscirenderAudioProcessorEditor& pluginEditor;
|
||||
|
|
|
@ -20,15 +20,14 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p) : CommonPluginEdito
|
|||
}
|
||||
|
||||
visualiserFullScreenChanged();
|
||||
|
||||
resized();
|
||||
repaint();
|
||||
});
|
||||
|
||||
resized();
|
||||
visualiserFullScreen->addListener(this);
|
||||
}
|
||||
|
||||
SosciPluginEditor::~SosciPluginEditor() {
|
||||
audioProcessor.visualiserParameters.visualiserFullScreen->removeListener(this);
|
||||
menuBar.setModel(nullptr);
|
||||
}
|
||||
|
||||
|
@ -85,4 +84,14 @@ void SosciPluginEditor::visualiserFullScreenChanged() {
|
|||
volume.setVisible(!fullScreen);
|
||||
visualiserSettingsWrapper.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/SvgButton.h"
|
||||
|
||||
class SosciPluginEditor : public CommonPluginEditor, public juce::FileDragAndDropTarget {
|
||||
class SosciPluginEditor : public CommonPluginEditor, public juce::FileDragAndDropTarget, public juce::AudioProcessorParameter::Listener {
|
||||
public:
|
||||
SosciPluginEditor(SosciAudioProcessor&);
|
||||
~SosciPluginEditor() override;
|
||||
|
@ -19,6 +19,8 @@ public:
|
|||
bool isInterestedInFileDrag(const juce::StringArray& files) override;
|
||||
void filesDropped(const juce::StringArray& files, int x, int y) override;
|
||||
void visualiserFullScreenChanged();
|
||||
void parameterValueChanged(int parameterIndex, float newValue) override;
|
||||
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
||||
|
||||
private:
|
||||
SosciAudioProcessor& audioProcessor;
|
||||
|
|
Ładowanie…
Reference in New Issue