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.

asset.hpp 984B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <common.hpp>
  3. namespace rack {
  4. namespace plugin {
  5. struct Plugin;
  6. } // namespace plugin
  7. namespace engine {
  8. struct Module;
  9. } // namespace engine
  10. namespace asset {
  11. void init();
  12. /** Returns the path of a system asset. Should only read files from this location. */
  13. std::string system(std::string filename = "");
  14. /** Returns the path of a user asset. Can read and write files to this location. */
  15. std::string user(std::string filename = "");
  16. /** Returns the path of a asset in the plugin's dir.
  17. Plugin assets should be read-only by plugins.
  18. Examples:
  19. asset::plugin(pluginInstance, "samples/00.wav") // "/path/to/Rack/user/dir/plugins/MyPlugin/samples/00.wav"
  20. */
  21. std::string plugin(plugin::Plugin* plugin, std::string filename = "");
  22. // Set these before calling init() to override the default paths
  23. extern std::string systemDir;
  24. extern std::string userDir;
  25. // Only defined on Mac
  26. extern std::string bundlePath;
  27. } // namespace asset
  28. } // namespace rack