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.

53 lines
1.3KB

  1. #pragma once
  2. #include <common.hpp>
  3. #include <plugin/Plugin.hpp>
  4. #include <jansson.h>
  5. #include <set>
  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. std::vector<std::string> presetPaths;
  17. /** Must be unique. Used for saving patches. Never change this after releasing your module.
  18. The model slug must be unique within your plugin, but it doesn't need to be unique among different plugins.
  19. */
  20. std::string slug;
  21. /** Human readable name for your model, e.g. "Voltage Controlled Oscillator" */
  22. std::string name;
  23. /** List of tags representing the function(s) of the module */
  24. std::vector<std::string> tags;
  25. /** A one-line summary of the module's purpose */
  26. std::string description;
  27. virtual ~Model() {}
  28. /** Creates a headless Module */
  29. virtual engine::Module *createModule() { return NULL; }
  30. /** Creates a ModuleWidget with a Module attached */
  31. virtual app::ModuleWidget *createModuleWidget() { return NULL; }
  32. /** Creates a ModuleWidget with no Module, useful for previews */
  33. virtual app::ModuleWidget *createModuleWidgetNull() { return NULL; }
  34. void fromJson(json_t *rootJ);
  35. };
  36. } // namespace plugin
  37. } // namespace rack