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.

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