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.

37 lines
987B

  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 Rack plugins */
  8. namespace plugin {
  9. PRIVATE void init();
  10. PRIVATE void destroy();
  11. /** Finds a loaded Plugin by slug. */
  12. Plugin* getPlugin(const std::string& pluginSlug);
  13. /** Finds a loaded Model by plugin and model slug. */
  14. Model* getModel(const std::string& pluginSlug, const std::string& modelSlug);
  15. /** Creates a Model from a JSON module object.
  16. Throws an Exception if the model is not found.
  17. */
  18. Model* modelFromJson(json_t* moduleJ);
  19. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  20. bool isSlugValid(const std::string& slug);
  21. /** Returns a string containing only the valid slug characters. */
  22. std::string normalizeSlug(const std::string& slug);
  23. /** Path to plugins installation dir */
  24. extern std::string pluginsPath;
  25. extern std::vector<Plugin*> plugins;
  26. } // namespace plugin
  27. } // namespace rack