kopia lustrzana https://github.com/jameshball/osci-render
Switch acceptsKeys to getter method for osci-render
rodzic
f0abefe611
commit
731466c8ab
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue