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.

65 lines
2.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  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. @tags{Events}
  29. */
  30. class JUCE_API Message : public MessageManager::MessageBase
  31. {
  32. public:
  33. //==============================================================================
  34. /** Creates an uninitialised message. */
  35. Message() noexcept;
  36. ~Message() override;
  37. using Ptr = ReferenceCountedObjectPtr<Message>;
  38. //==============================================================================
  39. private:
  40. friend class MessageListener;
  41. WeakReference<MessageListener> recipient;
  42. void messageCallback() override;
  43. // Avoid the leak-detector because for plugins, the host can unload our DLL with undelivered
  44. // messages still in the system event queue. These aren't harmful, but can cause annoying assertions.
  45. JUCE_DECLARE_NON_COPYABLE (Message)
  46. };
  47. } // namespace juce