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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. ApplicationCommandInfo::ApplicationCommandInfo (const CommandID cid) noexcept
  16. : commandID (cid), flags (0)
  17. {
  18. }
  19. void ApplicationCommandInfo::setInfo (const String& shortName_,
  20. const String& description_,
  21. const String& categoryName_,
  22. const int flags_) noexcept
  23. {
  24. shortName = shortName_;
  25. description = description_;
  26. categoryName = categoryName_;
  27. flags = flags_;
  28. }
  29. void ApplicationCommandInfo::setActive (const bool b) noexcept
  30. {
  31. if (b)
  32. flags &= ~isDisabled;
  33. else
  34. flags |= isDisabled;
  35. }
  36. void ApplicationCommandInfo::setTicked (const bool b) noexcept
  37. {
  38. if (b)
  39. flags |= isTicked;
  40. else
  41. flags &= ~isTicked;
  42. }
  43. void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, ModifierKeys modifiers) noexcept
  44. {
  45. defaultKeypresses.add (KeyPress (keyCode, modifiers, 0));
  46. }
  47. } // namespace juce