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.

plugin.hpp 879B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <vector>
  3. #include <common.hpp>
  4. #include <plugin/Plugin.hpp>
  5. #include <plugin/Model.hpp>
  6. namespace rack {
  7. /** Loads and manages plugins
  8. */
  9. namespace plugin {
  10. void init();
  11. void destroy();
  12. Plugin* getPlugin(const std::string& pluginSlug);
  13. Model* getModel(const std::string& pluginSlug, const std::string& modelSlug);
  14. /** Creates a Model from a JSON module object.
  15. Throws an Exception if the model is not found.
  16. */
  17. Model* modelFromJson(json_t* moduleJ);
  18. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  19. bool isSlugValid(const std::string& slug);
  20. /** Returns a string containing only the valid slug characters. */
  21. std::string normalizeSlug(const std::string& slug);
  22. /** Path to plugins installation folder */
  23. extern std::string pluginsPath;
  24. extern std::vector<Plugin*> plugins;
  25. } // namespace plugin
  26. } // namespace rack