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.

67 lines
1.4KB

  1. #pragma once
  2. #include <set>
  3. #include <jansson.h>
  4. #include <common.hpp>
  5. #include <plugin/Plugin.hpp>
  6. namespace rack {
  7. namespace app {
  8. struct ModuleWidget;
  9. } // namespace app
  10. namespace engine {
  11. struct Module;
  12. } // namespace engine
  13. namespace plugin {
  14. struct Model {
  15. Plugin* plugin = NULL;
  16. /** Must be unique. Used for saving patches. Never change this after releasing your module.
  17. The model slug must be unique within your plugin, but it doesn't need to be unique among different plugins.
  18. */
  19. std::string slug;
  20. /** Human readable name for your model, e.g. "Voltage Controlled Oscillator" */
  21. std::string name;
  22. /** List of tag IDs representing the function(s) of the module.
  23. Tag IDs are not part of the ABI and may change at any time.
  24. */
  25. std::vector<int> tags;
  26. /** A one-line summary of the module's purpose */
  27. std::string description;
  28. /** The manual of the module. HTML, PDF, or GitHub readme/wiki are fine.
  29. */
  30. std::string manualUrl;
  31. virtual ~Model() {}
  32. /** Creates a Module. */
  33. virtual engine::Module* createModule() {
  34. return NULL;
  35. }
  36. /** Creates a ModuleWidget with a Module attached.
  37. Module may be NULL.
  38. */
  39. virtual app::ModuleWidget* createModuleWidget(engine::Module* m) {
  40. return NULL;
  41. }
  42. void fromJson(json_t* rootJ);
  43. /** Returns the branded name of the model, e.g. VCV VCO-1. */
  44. std::string getFullName();
  45. std::string getFactoryPresetDir();
  46. std::string getUserPresetDir();
  47. };
  48. } // namespace plugin
  49. } // namespace rack