The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

174 lines
5.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 7 technical preview.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For the technical preview this file cannot be licensed commercially.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. A small class to represent some facts about a particular type of plug-in.
  18. This class is for storing and managing the details about a plug-in without
  19. actually having to load an instance of it.
  20. A KnownPluginList contains a list of PluginDescription objects.
  21. @see KnownPluginList
  22. @tags{Audio}
  23. */
  24. class JUCE_API PluginDescription
  25. {
  26. public:
  27. //==============================================================================
  28. PluginDescription() = default;
  29. PluginDescription (const PluginDescription&) = default;
  30. PluginDescription (PluginDescription&&) = default;
  31. PluginDescription& operator= (const PluginDescription&) = default;
  32. PluginDescription& operator= (PluginDescription&&) = default;
  33. //==============================================================================
  34. /** The name of the plug-in. */
  35. String name;
  36. /** A more descriptive name for the plug-in.
  37. This may be the same as the 'name' field, but some plug-ins may provide an
  38. alternative name.
  39. */
  40. String descriptiveName;
  41. /** The plug-in format, e.g. "VST", "AudioUnit", etc. */
  42. String pluginFormatName;
  43. /** A category, such as "Dynamics", "Reverbs", etc. */
  44. String category;
  45. /** The manufacturer. */
  46. String manufacturerName;
  47. /** The version. This string doesn't have any particular format. */
  48. String version;
  49. /** Either the file containing the plug-in module, or some other unique way
  50. of identifying it.
  51. E.g. for an AU, this would be an ID string that the component manager
  52. could use to retrieve the plug-in. For a VST, it's the file path.
  53. */
  54. String fileOrIdentifier;
  55. /** The last time the plug-in file was changed.
  56. This is handy when scanning for new or changed plug-ins.
  57. */
  58. Time lastFileModTime;
  59. /** The last time that this information was updated. This would typically have
  60. been during a scan when this plugin was first tested or found to have changed.
  61. */
  62. Time lastInfoUpdateTime;
  63. /** Deprecated: New projects should use uniqueId instead.
  64. A unique ID for the plug-in.
  65. Note that this might not be unique between formats, e.g. a VST and some
  66. other format might actually have the same id.
  67. @see createIdentifierString
  68. */
  69. int deprecatedUid = 0;
  70. /** A unique ID for the plug-in.
  71. Note that this might not be unique between formats, e.g. a VST and some
  72. other format might actually have the same id.
  73. The uniqueId field replaces the deprecatedUid field, and fixes an issue
  74. where VST3 plugins with matching FUIDs would generate different uid
  75. values depending on the platform. The deprecatedUid field is kept for
  76. backwards compatibility, allowing existing hosts to migrate from the
  77. old uid to the new uniqueId.
  78. @see createIdentifierString
  79. */
  80. int uniqueId = 0;
  81. /** True if the plug-in identifies itself as a synthesiser. */
  82. bool isInstrument = false;
  83. /** The number of inputs. */
  84. int numInputChannels = 0;
  85. /** The number of outputs. */
  86. int numOutputChannels = 0;
  87. /** True if the plug-in is part of a multi-type container, e.g. a VST Shell. */
  88. bool hasSharedContainer = false;
  89. /** True if the plug-in is ARA enabled and can supply a valid ARAFactoryWrapper. */
  90. bool hasARAExtension = false;
  91. /** Returns true if the two descriptions refer to the same plug-in.
  92. This isn't quite as simple as them just having the same file (because of
  93. shell plug-ins).
  94. */
  95. bool isDuplicateOf (const PluginDescription& other) const noexcept;
  96. /** Return true if this description is equivalent to another one which created the
  97. given identifier string.
  98. Note that this isn't quite as simple as them just calling createIdentifierString()
  99. and comparing the strings, because the identifiers can differ (thanks to shell plug-ins).
  100. */
  101. bool matchesIdentifierString (const String& identifierString) const;
  102. //==============================================================================
  103. /** Returns a string that can be saved and used to uniquely identify the
  104. plugin again.
  105. This contains less info than the XML encoding, and is independent of the
  106. plug-in's file location, so can be used to store a plug-in ID for use
  107. across different machines.
  108. */
  109. String createIdentifierString() const;
  110. //==============================================================================
  111. /** Creates an XML object containing these details.
  112. @see loadFromXml
  113. */
  114. std::unique_ptr<XmlElement> createXml() const;
  115. /** Reloads the info in this structure from an XML record that was previously
  116. saved with createXML().
  117. Returns true if the XML was a valid plug-in description.
  118. */
  119. bool loadFromXml (const XmlElement& xml);
  120. private:
  121. //==============================================================================
  122. JUCE_LEAK_DETECTOR (PluginDescription)
  123. };
  124. } // namespace juce