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 945B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. 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. // Only defined on Mac
  26. extern std::string bundlePath;
  27. } // namespace asset
  28. } // namespace rack