kopia lustrzana https://github.com/jameshball/osci-render
Show proper error if a GIF fails to open
rodzic
67fb2961a5
commit
0d96f7d752
|
@ -84,6 +84,12 @@ bool CommonPluginEditor::keyPressed(const juce::KeyPress& key) {
|
||||||
saveProject();
|
saveProject();
|
||||||
} else if (key.getModifiers().isCommandDown() && key.getKeyCode() == 'O') {
|
} else if (key.getModifiers().isCommandDown() && key.getKeyCode() == 'O') {
|
||||||
openProject();
|
openProject();
|
||||||
|
} else if (key.isKeyCode(juce::KeyPress::F11Key) && juce::JUCEApplicationBase::isStandaloneApp()) {
|
||||||
|
// set fullscreen
|
||||||
|
juce::StandaloneFilterWindow* window = findParentComponentOfClass<juce::StandaloneFilterWindow>();
|
||||||
|
if (window != nullptr) {
|
||||||
|
window->setFullScreen(!fullScreen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CommonAudioProcessor& audioProcessor;
|
CommonAudioProcessor& audioProcessor;
|
||||||
|
bool fullScreen = false;
|
||||||
|
|
||||||
juce::File applicationFolder = juce::File::getSpecialLocation(juce::File::SpecialLocationType::userApplicationDataDirectory)
|
juce::File applicationFolder = juce::File::getSpecialLocation(juce::File::SpecialLocationType::userApplicationDataDirectory)
|
||||||
#if JUCE_MAC
|
#if JUCE_MAC
|
||||||
|
|
|
@ -66,6 +66,16 @@ ImageParser::ImageParser(OscirenderAudioProcessor& p, juce::String extension, ju
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (frames.size() == 0) {
|
||||||
|
juce::MessageManager::callAsync([this] {
|
||||||
|
juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::AlertIconType::WarningIcon, "Invalid GIF", "The image could not be loaded. Please try optimising the GIF with https://ezgif.com/optimize.");
|
||||||
|
});
|
||||||
|
|
||||||
|
width = 1;
|
||||||
|
height = 1;
|
||||||
|
frames.emplace_back(std::vector<uint8_t>(1));
|
||||||
|
}
|
||||||
|
|
||||||
setFrame(0);
|
setFrame(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,11 +361,6 @@ bool VisualiserComponent::keyPressed(const juce::KeyPress& key) {
|
||||||
} else if (key.isKeyCode(juce::KeyPress::spaceKey)) {
|
} else if (key.isKeyCode(juce::KeyPress::spaceKey)) {
|
||||||
setPaused(active);
|
setPaused(active);
|
||||||
return true;
|
return true;
|
||||||
} else if (key.isKeyCode(juce::KeyPress::F11Key)) {
|
|
||||||
// set fullscreen
|
|
||||||
juce::Component* component = juce::TopLevelWindow::getTopLevelWindow(0);
|
|
||||||
juce::Desktop::getInstance().setKioskModeComponent(component, true);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Ładowanie…
Reference in New Issue