Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

juce_ApplicationCommandInfo.cpp 1.9KB

9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. ApplicationCommandInfo::ApplicationCommandInfo (const CommandID cid) noexcept
  18. : commandID (cid), flags (0)
  19. {
  20. }
  21. void ApplicationCommandInfo::setInfo (const String& shortName_,
  22. const String& description_,
  23. const String& categoryName_,
  24. const int flags_) noexcept
  25. {
  26. shortName = shortName_;
  27. description = description_;
  28. categoryName = categoryName_;
  29. flags = flags_;
  30. }
  31. void ApplicationCommandInfo::setActive (const bool b) noexcept
  32. {
  33. if (b)
  34. flags &= ~isDisabled;
  35. else
  36. flags |= isDisabled;
  37. }
  38. void ApplicationCommandInfo::setTicked (const bool b) noexcept
  39. {
  40. if (b)
  41. flags |= isTicked;
  42. else
  43. flags &= ~isTicked;
  44. }
  45. void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, ModifierKeys modifiers) noexcept
  46. {
  47. defaultKeypresses.add (KeyPress (keyCode, modifiers, 0));
  48. }