osci-render/Source/PluginEditor.h

86 wiersze
2.9 KiB
C
Czysty Zwykły widok Historia

2023-01-09 21:58:49 +00:00
#pragma once
#include <JuceHeader.h>
#include "PluginProcessor.h"
#include "SettingsComponent.h"
#include "MidiComponent.h"
#include "components/VolumeComponent.h"
#include "components/MainMenuBarModel.h"
#include "LookAndFeel.h"
2023-12-20 17:13:38 +00:00
#include "components/ErrorCodeEditorComponent.h"
2023-01-09 21:58:49 +00:00
class OscirenderAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::CodeDocument::Listener, public juce::AsyncUpdater, public juce::ChangeListener {
2023-01-09 21:58:49 +00:00
public:
OscirenderAudioProcessorEditor(OscirenderAudioProcessor&);
2023-01-09 21:58:49 +00:00
~OscirenderAudioProcessorEditor() override;
void paint(juce::Graphics&) override;
2023-01-09 21:58:49 +00:00
void resized() override;
void initialiseCodeEditors();
void addCodeEditor(int index);
void removeCodeEditor(int index);
void fileUpdated(juce::String fileName);
void handleAsyncUpdate() override;
void changeListenerCallback(juce::ChangeBroadcaster* source) override;
void editPerspectiveFunction(bool enabled);
void newProject();
void openProject();
void saveProject();
void saveProjectAs();
void updateTitle();
2023-12-20 20:58:08 +00:00
void openAudioSettings();
void resetToDefault();
2023-01-09 21:58:49 +00:00
private:
OscirenderAudioProcessor& audioProcessor;
public:
OscirenderLookAndFeel lookAndFeel;
std::atomic<bool> editingPerspective = false;
VisualiserComponent visualiser{2, audioProcessor};
std::atomic<bool> visualiserFullScreen = false;
SettingsComponent settings{audioProcessor, *this};
VolumeComponent volume{audioProcessor};
std::vector<std::shared_ptr<juce::CodeDocument>> codeDocuments;
2023-12-20 17:13:38 +00:00
std::vector<std::shared_ptr<ErrorCodeEditorComponent>> codeEditors;
2023-08-27 16:47:30 +00:00
juce::CodeEditorComponent::ColourScheme colourScheme;
2023-03-29 11:51:22 +00:00
juce::LuaTokeniser luaTokeniser;
juce::XmlTokeniser xmlTokeniser;
2023-03-29 14:02:29 +00:00
juce::ShapeButton collapseButton;
std::shared_ptr<juce::CodeDocument> perspectiveCodeDocument = std::make_shared<juce::CodeDocument>();
std::shared_ptr<ErrorCodeEditorComponent> perspectiveCodeEditor = std::make_shared<ErrorCodeEditorComponent>(*perspectiveCodeDocument, &luaTokeniser, audioProcessor, PerspectiveEffect::FILE_NAME);
2023-01-09 21:58:49 +00:00
std::unique_ptr<juce::FileChooser> chooser;
MainMenuBarModel menuBarModel{*this};
juce::MenuBarComponent menuBar;
2023-11-25 22:10:36 +00:00
juce::StretchableLayoutManager layout;
juce::StretchableLayoutResizerBar resizerBar{&layout, 1, true};
2023-12-17 21:32:56 +00:00
juce::TooltipWindow tooltipWindow{this, 0};
2023-12-12 22:54:36 +00:00
std::atomic<bool> updatingDocumentsWithParserLock = false;
2023-12-20 20:58:08 +00:00
bool usingNativeMenuBar = false;
#if !JUCE_MAC
juce::OpenGLContext openGlContext;
#endif
void codeDocumentTextInserted(const juce::String& newText, int insertIndex) override;
void codeDocumentTextDeleted(int startIndex, int endIndex) override;
void updateCodeDocument();
void updateCodeEditor();
bool keyPressed(const juce::KeyPress& key) override;
2023-01-09 21:58:49 +00:00
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OscirenderAudioProcessorEditor)
};