VST3: fetch midi mappings all at once, use it for note/sound-off
[carla.git] / source / modules / juce_gui_basics / application / juce_Application.cpp
blob5e0844ba5c835c32c4abf54e673058268ab71c9e
1 /*
2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
23 ==============================================================================
26 namespace juce
29 JUCEApplication::JUCEApplication() {}
30 JUCEApplication::~JUCEApplication() {}
32 //==============================================================================
33 JUCEApplication* JUCE_CALLTYPE JUCEApplication::getInstance() noexcept
35 return dynamic_cast<JUCEApplication*> (JUCEApplicationBase::getInstance());
38 bool JUCEApplication::moreThanOneInstanceAllowed() { return true; }
39 void JUCEApplication::anotherInstanceStarted (const String&) {}
41 void JUCEApplication::suspended() {}
42 void JUCEApplication::resumed() {}
44 void JUCEApplication::systemRequestedQuit() { quit(); }
46 void JUCEApplication::unhandledException (const std::exception*, const String&, int)
48 jassertfalse;
51 //==============================================================================
52 ApplicationCommandTarget* JUCEApplication::getNextCommandTarget()
54 return nullptr;
57 void JUCEApplication::getAllCommands (Array<CommandID>& commands)
59 commands.add (StandardApplicationCommandIDs::quit);
62 void JUCEApplication::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
64 if (commandID == StandardApplicationCommandIDs::quit)
66 result.setInfo (TRANS("Quit"),
67 TRANS("Quits the application"),
68 "Application", 0);
70 result.defaultKeypresses.add (KeyPress ('q', ModifierKeys::commandModifier, 0));
74 bool JUCEApplication::perform (const InvocationInfo& info)
76 if (info.commandID == StandardApplicationCommandIDs::quit)
78 systemRequestedQuit();
79 return true;
82 return false;
85 //==============================================================================
86 #if JUCE_MAC
87 extern void juce_initialiseMacMainMenu();
88 #endif
90 bool JUCEApplication::initialiseApp()
92 if (JUCEApplicationBase::initialiseApp())
94 #if JUCE_MAC
95 juce_initialiseMacMainMenu(); // (needs to get the app's name)
96 #endif
98 return true;
101 return false;
104 } // namespace juce