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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. namespace juce
  18. {
  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. } // namespace juce