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.

iupdatehandler.h 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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] \n
  23. [get this interface from IHostClasses] \n
  24. [released N3.1] \n
  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. //------------------------------------------------------------------------
  33. class IUpdateHandler: public FUnknown
  34. {
  35. public:
  36. //------------------------------------------------------------------------
  37. /** Install update notification for given object. It is essential to
  38. remove all dependencies again using 'removeDependent'! Dependencies
  39. are not removed automatically when the 'object' is released!
  40. \param object : interface to object that sends change notifications
  41. \param dependent : interface through which the update is passed */
  42. virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) = 0;
  43. /** Remove a previously installed dependency.*/
  44. virtual tresult PLUGIN_API removeDependent (FUnknown* object, IDependent* dependent) = 0;
  45. /** Inform all dependents, that object has changed.
  46. \param object is the object that has changed
  47. \param message is a value of enum IDependent::ChangeMessage, usually IDependent::kChanged - can be
  48. a private message as well (only known to sender and dependent)*/
  49. virtual tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) = 0;
  50. /** Same as triggerUpdates, but delivered in idle (usefull to collect updates).*/
  51. virtual tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) = 0;
  52. static const FUID iid;
  53. };
  54. DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B37)
  55. //------------------------------------------------------------------------
  56. /** A dependent will get notified about changes of a model.
  57. [plug imp]
  58. - notify changes of a model
  59. \see IUpdateHandler
  60. \ingroup frameworkHostClasses
  61. */
  62. //------------------------------------------------------------------------
  63. class IDependent: public FUnknown
  64. {
  65. public:
  66. //------------------------------------------------------------------------
  67. /** Inform the dependent, that the passed FUnknown has changed. */
  68. virtual void PLUGIN_API update (FUnknown* changedUnknown, int32 message) = 0;
  69. enum ChangeMessage
  70. {
  71. kWillChange,
  72. kChanged,
  73. kDestroyed,
  74. kWillDestroy,
  75. kStdChangeMessageLast = kWillDestroy
  76. };
  77. //------------------------------------------------------------------------
  78. static const FUID iid;
  79. };
  80. DECLARE_CLASS_IID (IDependent, 0xF52B7AAE, 0xDE72416d, 0x8AF18ACE, 0x9DD7BD5E)
  81. //------------------------------------------------------------------------
  82. } // namespace Steinberg