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_Message.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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. #ifndef JUCE_MESSAGE_H_INCLUDED
  18. #define JUCE_MESSAGE_H_INCLUDED
  19. class MessageListener;
  20. //==============================================================================
  21. /** The base class for objects that can be sent to a MessageListener.
  22. If you want to send a message that carries some kind of custom data, just
  23. create a subclass of Message with some appropriate member variables to hold
  24. your data.
  25. Always create a new instance of a Message object on the heap, as it will be
  26. deleted automatically after the message has been delivered.
  27. @see MessageListener, MessageManager, ActionListener, ChangeListener
  28. */
  29. class JUCE_API Message : public MessageManager::MessageBase
  30. {
  31. public:
  32. //==============================================================================
  33. /** Creates an uninitialised message. */
  34. Message() noexcept;
  35. ~Message();
  36. typedef ReferenceCountedObjectPtr<Message> Ptr;
  37. //==============================================================================
  38. private:
  39. friend class MessageListener;
  40. WeakReference<MessageListener> recipient;
  41. void messageCallback() override;
  42. // Avoid the leak-detector because for plugins, the host can unload our DLL with undelivered
  43. // messages still in the system event queue. These aren't harmful, but can cause annoying assertions.
  44. JUCE_DECLARE_NON_COPYABLE (Message)
  45. };
  46. #endif // JUCE_MESSAGE_H_INCLUDED