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.

152 lines
5.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_PLUGINDESCRIPTION_H_INCLUDED
  18. #define JUCE_PLUGINDESCRIPTION_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. A small class to represent some facts about a particular type of plug-in.
  22. This class is for storing and managing the details about a plug-in without
  23. actually having to load an instance of it.
  24. A KnownPluginList contains a list of PluginDescription objects.
  25. @see KnownPluginList
  26. */
  27. class JUCE_API PluginDescription
  28. {
  29. public:
  30. //==============================================================================
  31. PluginDescription();
  32. PluginDescription (const PluginDescription& other);
  33. PluginDescription& operator= (const PluginDescription& other);
  34. ~PluginDescription();
  35. //==============================================================================
  36. /** The name of the plug-in. */
  37. String name;
  38. /** A more descriptive name for the plug-in.
  39. This may be the same as the 'name' field, but some plug-ins may provide an
  40. alternative name.
  41. */
  42. String descriptiveName;
  43. /** The plug-in format, e.g. "VST", "AudioUnit", etc. */
  44. String pluginFormatName;
  45. /** A category, such as "Dynamics", "Reverbs", etc. */
  46. String category;
  47. /** The manufacturer. */
  48. String manufacturerName;
  49. /** The version. This string doesn't have any particular format. */
  50. String version;
  51. /** Either the file containing the plug-in module, or some other unique way
  52. of identifying it.
  53. E.g. for an AU, this would be an ID string that the component manager
  54. could use to retrieve the plug-in. For a VST, it's the file path.
  55. */
  56. String fileOrIdentifier;
  57. /** The last time the plug-in file was changed.
  58. This is handy when scanning for new or changed plug-ins.
  59. */
  60. Time lastFileModTime;
  61. /** A unique ID for the plug-in.
  62. Note that this might not be unique between formats, e.g. a VST and some
  63. other format might actually have the same id.
  64. @see createIdentifierString
  65. */
  66. int uid;
  67. /** True if the plug-in identifies itself as a synthesiser. */
  68. bool isInstrument;
  69. /** The number of inputs. */
  70. int numInputChannels;
  71. /** The number of outputs. */
  72. int numOutputChannels;
  73. /** True if the plug-in is part of a multi-type container, e.g. a VST Shell. */
  74. bool hasSharedContainer;
  75. /** Returns true if the two descriptions refer to the same plug-in.
  76. This isn't quite as simple as them just having the same file (because of
  77. shell plug-ins).
  78. */
  79. bool isDuplicateOf (const PluginDescription& other) const noexcept;
  80. /** Return true if this description is equivalent to another one which created the
  81. given identifier string.
  82. Note that this isn't quite as simple as them just calling createIdentifierString()
  83. and comparing the strings, because the identifers can differ (thanks to shell plug-ins).
  84. */
  85. bool matchesIdentifierString (const String& identifierString) const;
  86. //==============================================================================
  87. /** Returns a string that can be saved and used to uniquely identify the
  88. plugin again.
  89. This contains less info than the XML encoding, and is independent of the
  90. plug-in's file location, so can be used to store a plug-in ID for use
  91. across different machines.
  92. */
  93. String createIdentifierString() const;
  94. //==============================================================================
  95. /** Creates an XML object containing these details.
  96. @see loadFromXml
  97. */
  98. XmlElement* createXml() const;
  99. /** Reloads the info in this structure from an XML record that was previously
  100. saved with createXML().
  101. Returns true if the XML was a valid plug-in description.
  102. */
  103. bool loadFromXml (const XmlElement& xml);
  104. private:
  105. //==============================================================================
  106. JUCE_LEAK_DETECTOR (PluginDescription)
  107. };
  108. #endif // JUCE_PLUGINDESCRIPTION_H_INCLUDED