kopia lustrzana https://github.com/jameshball/osci-render
Switch to setGlobalValue for osci-render
rodzic
696dde09e3
commit
b83e855315
|
@ -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();
|
||||
|
|
|
@ -16,7 +16,6 @@ CommonAudioProcessor::CommonAudioProcessor(const BusesProperties& busesPropertie
|
|||
: AudioProcessor(busesProperties)
|
||||
#endif
|
||||
{
|
||||
acceptsAllKeys = juce::JUCEApplicationBase::isStandaloneApp();
|
||||
|
||||
if (!applicationFolder.exists()) {
|
||||
applicationFolder.createDirectory();
|
||||
|
|
|
@ -153,9 +153,8 @@ public:
|
|||
#else
|
||||
"ffmpeg";
|
||||
#endif
|
||||
bool acceptsAllKeys;
|
||||
void setAcceptKeys(bool shouldAcceptKeys) {
|
||||
acceptsAllKeys = shouldAcceptKeys;
|
||||
setGlobalValue("acceptsAllKeys", shouldAcceptKeys);
|
||||
}
|
||||
|
||||
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.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();
|
||||
});
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Ładowanie…
Reference in New Issue