Switch to setGlobalValue for osci-render

pull/305/head
DJLevel3 2025-08-15 08:41:43 -06:00
rodzic 696dde09e3
commit b83e855315
5 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -113,7 +113,7 @@ CommonPluginEditor::~CommonPluginEditor() {
bool CommonPluginEditor::keyPressed(const juce::KeyPress& key) { bool CommonPluginEditor::keyPressed(const juce::KeyPress& key) {
// If we're not accepting special keys, end early // If we're not accepting special keys, end early
if (audioProcessor.acceptsAllKeys == false) return false; if (audioProcessor.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) == false) return false;
if (key.getModifiers().isCommandDown() && key.getModifiers().isShiftDown() && key.getKeyCode() == 'S') { if (key.getModifiers().isCommandDown() && key.getModifiers().isShiftDown() && key.getKeyCode() == 'S') {
saveProjectAs(); saveProjectAs();

Wyświetl plik

@ -16,7 +16,6 @@ CommonAudioProcessor::CommonAudioProcessor(const BusesProperties& busesPropertie
: AudioProcessor(busesProperties) : AudioProcessor(busesProperties)
#endif #endif
{ {
acceptsAllKeys = juce::JUCEApplicationBase::isStandaloneApp();
if (!applicationFolder.exists()) { if (!applicationFolder.exists()) {
applicationFolder.createDirectory(); applicationFolder.createDirectory();

Wyświetl plik

@ -153,9 +153,8 @@ public:
#else #else
"ffmpeg"; "ffmpeg";
#endif #endif
bool acceptsAllKeys;
void setAcceptKeys(bool shouldAcceptKeys) { void setAcceptKeys(bool shouldAcceptKeys) {
acceptsAllKeys = shouldAcceptKeys; setGlobalValue("acceptsAllKeys", shouldAcceptKeys);
} }
protected: protected:

Wyświetl plik

@ -61,8 +61,8 @@ void OsciMainMenuBarModel::resetMenuItems() {
addMenuItem(1, "Randomize Blender Port", [this] { addMenuItem(1, "Randomize Blender Port", [this] {
audioProcessor.setObjectServerPort(juce::Random::getSystemRandom().nextInt(juce::Range<int>(51600, 51700))); audioProcessor.setObjectServerPort(juce::Random::getSystemRandom().nextInt(juce::Range<int>(51600, 51700)));
}); });
addMenuItem(1, audioProcessor.acceptsAllKeys ? "Disable Special Keys" : "Enable Special Keys", [this] { addMenuItem(1, audioProcessor.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) ? "Disable Special Keys" : "Enable Special Keys", [this] {
audioProcessor.setAcceptKeys(!audioProcessor.acceptsAllKeys); audioProcessor.setAcceptKeys(!audioProcessor.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()));
resetMenuItems(); resetMenuItems();
}); });

Wyświetl plik

@ -255,7 +255,7 @@ void VisualiserComponent::mouseDown(const juce::MouseEvent &event) {
bool VisualiserComponent::keyPressed(const juce::KeyPress &key) { bool VisualiserComponent::keyPressed(const juce::KeyPress &key) {
// If we're not accepting special keys, end early // If we're not accepting special keys, end early
if (audioProcessor.acceptsAllKeys == false) return false; if (audioProcessor.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) == false) return false;
if (key.isKeyCode(juce::KeyPress::escapeKey)) { if (key.isKeyCode(juce::KeyPress::escapeKey)) {
if (fullScreenCallback) { if (fullScreenCallback) {