2024-12-14 18:15:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "CommonPluginProcessor.h"
|
|
|
|
#include "visualiser/VisualiserComponent.h"
|
|
|
|
#include "LookAndFeel.h"
|
|
|
|
#include "visualiser/VisualiserSettings.h"
|
|
|
|
#include "components/SosciMainMenuBarModel.h"
|
|
|
|
#include "components/SvgButton.h"
|
2025-01-06 09:14:34 +00:00
|
|
|
#include "components/VolumeComponent.h"
|
2024-12-14 18:15:22 +00:00
|
|
|
|
|
|
|
class CommonPluginEditor : public juce::AudioProcessorEditor {
|
|
|
|
public:
|
2024-12-14 20:42:35 +00:00
|
|
|
CommonPluginEditor(CommonAudioProcessor&, juce::String appName, juce::String projectFileType, int width, int height);
|
2024-12-14 18:15:22 +00:00
|
|
|
~CommonPluginEditor() override;
|
|
|
|
|
|
|
|
void initialiseMenuBar(juce::MenuBarModel& menuBarModel);
|
|
|
|
void openProject();
|
|
|
|
void saveProject();
|
|
|
|
void saveProjectAs();
|
|
|
|
void updateTitle();
|
|
|
|
void openAudioSettings();
|
2024-12-15 19:23:31 +00:00
|
|
|
void openRecordingSettings();
|
2024-12-14 18:15:22 +00:00
|
|
|
void resetToDefault();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CommonAudioProcessor& audioProcessor;
|
|
|
|
|
|
|
|
juce::File applicationFolder = juce::File::getSpecialLocation(juce::File::SpecialLocationType::userApplicationDataDirectory)
|
|
|
|
#if JUCE_MAC
|
|
|
|
.getChildFile("Application Support")
|
|
|
|
#endif
|
|
|
|
.getChildFile("osci-render");
|
|
|
|
|
|
|
|
juce::String ffmpegFileName =
|
|
|
|
#if JUCE_WINDOWS
|
|
|
|
"ffmpeg.exe";
|
|
|
|
#else
|
|
|
|
"ffmpeg";
|
|
|
|
#endif
|
|
|
|
public:
|
|
|
|
OscirenderLookAndFeel lookAndFeel;
|
|
|
|
|
|
|
|
juce::String appName;
|
|
|
|
juce::String projectFileType;
|
2025-01-05 09:44:55 +00:00
|
|
|
|
|
|
|
#if SOSCI_FEATURES
|
|
|
|
SharedTextureManager sharedTextureManager;
|
|
|
|
#endif
|
2024-12-14 18:15:22 +00:00
|
|
|
|
|
|
|
VisualiserSettings visualiserSettings = VisualiserSettings(audioProcessor.visualiserParameters, 3);
|
2024-12-15 19:23:31 +00:00
|
|
|
RecordingSettings recordingSettings = RecordingSettings(audioProcessor.recordingParameters);
|
2025-01-01 16:38:58 +00:00
|
|
|
SettingsWindow recordingSettingsWindow = SettingsWindow("Recording Settings", recordingSettings);
|
2025-01-05 09:44:55 +00:00
|
|
|
VisualiserComponent visualiser{
|
|
|
|
audioProcessor.lastOpenedDirectory,
|
|
|
|
#if SOSCI_FEATURES
|
|
|
|
sharedTextureManager,
|
|
|
|
#endif
|
|
|
|
applicationFolder.getChildFile(ffmpegFileName),
|
|
|
|
audioProcessor.haltRecording,
|
|
|
|
audioProcessor.threadManager,
|
|
|
|
visualiserSettings,
|
|
|
|
audioProcessor.recordingParameters,
|
|
|
|
nullptr,
|
|
|
|
appName == "sosci"
|
|
|
|
};
|
2024-12-14 18:15:22 +00:00
|
|
|
|
2025-01-06 09:14:34 +00:00
|
|
|
VolumeComponent volume{audioProcessor};
|
|
|
|
|
2024-12-14 18:15:22 +00:00
|
|
|
std::unique_ptr<juce::FileChooser> chooser;
|
|
|
|
juce::MenuBarComponent menuBar;
|
|
|
|
|
|
|
|
juce::TooltipWindow tooltipWindow{nullptr, 0};
|
|
|
|
juce::DropShadower tooltipDropShadow{juce::DropShadow(juce::Colours::black.withAlpha(0.5f), 6, {0,0})};
|
|
|
|
|
|
|
|
bool usingNativeMenuBar = false;
|
|
|
|
|
|
|
|
#if JUCE_LINUX
|
|
|
|
juce::OpenGLContext openGlContext;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
bool keyPressed(const juce::KeyPress& key) override;
|
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CommonPluginEditor)
|
|
|
|
};
|