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.

42 lines
1.1KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include "plugin/Plugin.hpp"
  4. #include <jansson.h>
  5. #include <list>
  6. namespace rack {
  7. struct ModuleWidget;
  8. struct Module;
  9. struct Model {
  10. Plugin *plugin = NULL;
  11. /** An identifier for the model, e.g. "VCO". Used for saving patches.
  12. The model slug must be unique in your plugin, but it doesn't need to be unique among different plugins.
  13. */
  14. std::string slug;
  15. /** Human readable name for your model, e.g. "Voltage Controlled Oscillator" */
  16. std::string name;
  17. /** A one-line summary of the module's purpose */
  18. std::string description;
  19. /** List of tags representing the function(s) of the module */
  20. std::list<std::string> tags;
  21. virtual ~Model() {}
  22. /** Creates a headless Module */
  23. virtual Module *createModule() { return NULL; }
  24. /** Creates a ModuleWidget with a Module attached */
  25. virtual ModuleWidget *createModuleWidget() { return NULL; }
  26. /** Creates a ModuleWidget with no Module, useful for previews */
  27. virtual ModuleWidget *createModuleWidgetNull() { return NULL; }
  28. void fromJson(json_t *rootJ);
  29. };
  30. } // namespace rack