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.

72 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2016 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of the ISC license
  6. http://www.isc.org/downloads/software-support-policy/isc-license/
  7. Permission to use, copy, modify, and/or distribute this software for any
  8. purpose with or without fee is hereby granted, provided that the above
  9. copyright notice and this permission notice appear in all copies.
  10. THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
  11. TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  13. OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  14. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  16. OF THIS SOFTWARE.
  17. -----------------------------------------------------------------------------
  18. To release a closed-source product which uses other parts of JUCE not
  19. licensed under the ISC terms, commercial licenses are available: visit
  20. www.juce.com for more information.
  21. ==============================================================================
  22. */
  23. #ifndef JUCE_MESSAGE_H_INCLUDED
  24. #define JUCE_MESSAGE_H_INCLUDED
  25. class MessageListener;
  26. //==============================================================================
  27. /** The base class for objects that can be sent to a MessageListener.
  28. If you want to send a message that carries some kind of custom data, just
  29. create a subclass of Message with some appropriate member variables to hold
  30. your data.
  31. Always create a new instance of a Message object on the heap, as it will be
  32. deleted automatically after the message has been delivered.
  33. @see MessageListener, MessageManager, ActionListener, ChangeListener
  34. */
  35. class JUCE_API Message : public MessageManager::MessageBase
  36. {
  37. public:
  38. //==============================================================================
  39. /** Creates an uninitialised message. */
  40. Message() noexcept;
  41. ~Message();
  42. typedef ReferenceCountedObjectPtr<Message> Ptr;
  43. //==============================================================================
  44. private:
  45. friend class MessageListener;
  46. WeakReference<MessageListener> recipient;
  47. void messageCallback() override;
  48. // Avoid the leak-detector because for plugins, the host can unload our DLL with undelivered
  49. // messages still in the system event queue. These aren't harmful, but can cause annoying assertions.
  50. JUCE_DECLARE_NON_COPYABLE (Message)
  51. };
  52. #endif // JUCE_MESSAGE_H_INCLUDED