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.

99 lines
3.5KB

  1. //------------------------------------------------------------------------
  2. // Project : Steinberg Module Architecture SDK
  3. //
  4. // Category : Basic Host Service Interfaces
  5. // Filename : pluginterfaces/base/iupdatehandler.h
  6. // Created by : Steinberg, 01/2004
  7. // Description : Update handling
  8. //
  9. //-----------------------------------------------------------------------------
  10. // This file is part of a Steinberg SDK. It is subject to the license terms
  11. // in the LICENSE file found in the top-level directory of this distribution
  12. // and at www.steinberg.net/sdklicenses.
  13. // No part of the SDK, including this file, may be copied, modified, propagated,
  14. // or distributed except according to the terms contained in the LICENSE file.
  15. //-----------------------------------------------------------------------------
  16. #pragma once
  17. #include "pluginterfaces/base/funknown.h"
  18. namespace Steinberg {
  19. class IDependent;
  20. //------------------------------------------------------------------------
  21. /** Host implements dependency handling for plugins.
  22. - [host imp]
  23. - [get this interface from IHostClasses]
  24. - [released N3.1]
  25. - Install/Remove change notifications
  26. - Trigger updates when an object has changed
  27. Can be used between host-objects and the Plug-In or
  28. inside the Plug-In to handle internal updates!
  29. \see IDependent
  30. \ingroup frameworkHostClasses
  31. */
  32. class IUpdateHandler: public FUnknown
  33. {
  34. public:
  35. //------------------------------------------------------------------------
  36. /** Install update notification for given object. It is essential to
  37. remove all dependencies again using 'removeDependent'! Dependencies
  38. are not removed automatically when the 'object' is released!
  39. \param object : interface to object that sends change notifications
  40. \param dependent : interface through which the update is passed */
  41. virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) = 0;
  42. /** Remove a previously installed dependency.*/
  43. virtual tresult PLUGIN_API removeDependent (FUnknown* object, IDependent* dependent) = 0;
  44. /** Inform all dependents, that object has changed.
  45. \param object is the object that has changed
  46. \param message is a value of enum IDependent::ChangeMessage, usually IDependent::kChanged - can be
  47. a private message as well (only known to sender and dependent)*/
  48. virtual tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) = 0;
  49. /** Same as triggerUpdates, but delivered in idle (usefull to collect updates).*/
  50. virtual tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) = 0;
  51. static const FUID iid;
  52. };
  53. DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B37)
  54. //------------------------------------------------------------------------
  55. /** A dependent will get notified about changes of a model.
  56. [plug imp]
  57. - notify changes of a model
  58. \see IUpdateHandler
  59. \ingroup frameworkHostClasses
  60. */
  61. class IDependent: public FUnknown
  62. {
  63. public:
  64. //------------------------------------------------------------------------
  65. /** Inform the dependent, that the passed FUnknown has changed. */
  66. virtual void PLUGIN_API update (FUnknown* changedUnknown, int32 message) = 0;
  67. enum ChangeMessage
  68. {
  69. kWillChange,
  70. kChanged,
  71. kDestroyed,
  72. kWillDestroy,
  73. kStdChangeMessageLast = kWillDestroy
  74. };
  75. //------------------------------------------------------------------------
  76. static const FUID iid;
  77. };
  78. DECLARE_CLASS_IID (IDependent, 0xF52B7AAE, 0xDE72416d, 0x8AF18ACE, 0x9DD7BD5E)
  79. //------------------------------------------------------------------------
  80. } // namespace Steinberg