Switch acceptsKeys to getter method for osci-render

pull/305/head
DJLevel3 2025-08-16 06:58:46 -06:00
rodzic f0abefe611
commit 731466c8ab
4 zmienionych plików z 8 dodań i 5 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.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) == false) return false;
if (!audioProcessor.getAcceptsKeys()) return false;
if (key.getModifiers().isCommandDown() && key.getModifiers().isShiftDown() && key.getKeyCode() == 'S') {
saveProjectAs();

Wyświetl plik

@ -153,9 +153,12 @@ public:
#else
"ffmpeg";
#endif
void setAcceptKeys(bool shouldAcceptKeys) {
void setAcceptsKeys(bool shouldAcceptKeys) {
setGlobalValue("acceptsAllKeys", shouldAcceptKeys);
}
bool getAcceptsKeys() {
return getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp());
}
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.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) ? "Disable Special Keys" : "Enable Special Keys", [this] {
audioProcessor.setAcceptKeys(!audioProcessor.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()));
addMenuItem(1, audioProcessor.getAcceptsKeys() ? "Disable Special Keys" : "Enable Special Keys", [this] {
audioProcessor.setAcceptsKeys(!audioProcessor.getAcceptsKeys());
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.getGlobalBoolValue("acceptsAllKeys", juce::JUCEApplicationBase::isStandaloneApp()) == false) return false;
if (!audioProcessor.getAcceptsKeys()) return false;
if (key.isKeyCode(juce::KeyPress::escapeKey)) {
if (fullScreenCallback) {