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) {
// 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') {
saveProjectAs();

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -255,7 +255,7 @@ void VisualiserComponent::mouseDown(const juce::MouseEvent &event) {
bool VisualiserComponent::keyPressed(const juce::KeyPress &key) {
// 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 (fullScreenCallback) {