Add remaining files
[juce-lv2.git] / juce / source / src / application / juce_ApplicationCommandInfo.cpp
blobac996df4143c345d681ecfd0354c04076d33c1f6
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "../core/juce_StandardHeader.h"
28 BEGIN_JUCE_NAMESPACE
30 #include "juce_ApplicationCommandInfo.h"
33 //==============================================================================
34 ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) noexcept
35 : commandID (commandID_),
36 flags (0)
40 void ApplicationCommandInfo::setInfo (const String& shortName_,
41 const String& description_,
42 const String& categoryName_,
43 const int flags_) noexcept
45 shortName = shortName_;
46 description = description_;
47 categoryName = categoryName_;
48 flags = flags_;
51 void ApplicationCommandInfo::setActive (const bool b) noexcept
53 if (b)
54 flags &= ~isDisabled;
55 else
56 flags |= isDisabled;
59 void ApplicationCommandInfo::setTicked (const bool b) noexcept
61 if (b)
62 flags |= isTicked;
63 else
64 flags &= ~isTicked;
67 void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, const ModifierKeys& modifiers) noexcept
69 defaultKeypresses.add (KeyPress (keyCode, modifiers, 0));
73 END_JUCE_NAMESPACE