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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. /** Handles common path locations */
  11. namespace asset {
  12. PRIVATE void init();
  13. /** Returns the path of a system asset. Read-only files. */
  14. std::string system(std::string filename = "");
  15. /** Returns the path of a user asset. Readable/writable files. */
  16. std::string user(std::string filename = "");
  17. /** Returns the path of an asset in the plugin's dir. Read-only files.
  18. Examples:
  19. asset::plugin(pluginInstance, "samples/00.wav") // "/<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. extern std::string oldUserDir;
  26. // Only defined on Mac
  27. extern std::string bundlePath;
  28. } // namespace asset
  29. } // namespace rack