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.

144 lines
4.8KB

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