| 350 | } |
| 351 | |
| 352 | const char* getResourcePath(const char* const bundlePath) noexcept |
| 353 | { |
| 354 | DISTRHO_SAFE_ASSERT_RETURN(bundlePath != nullptr, nullptr); |
| 355 | |
| 356 | #if defined(DISTRHO_PLUGIN_TARGET_AU) || defined(DISTRHO_PLUGIN_TARGET_JACK) || defined(DISTRHO_PLUGIN_TARGET_VST2) || defined(DISTRHO_PLUGIN_TARGET_CLAP) |
| 357 | static String resourcePath; |
| 358 | |
| 359 | if (resourcePath.isEmpty()) |
| 360 | { |
| 361 | resourcePath = bundlePath; |
| 362 | #ifdef DISTRHO_OS_MAC |
| 363 | resourcePath += "/Contents/Resources"; |
| 364 | #else |
| 365 | resourcePath += DISTRHO_OS_SEP_STR "resources"; |
| 366 | #endif |
| 367 | } |
| 368 | |
| 369 | return resourcePath.buffer(); |
| 370 | #elif defined(DISTRHO_PLUGIN_TARGET_LV2) |
| 371 | static String resourcePath; |
| 372 | |
| 373 | if (resourcePath.isEmpty()) |
| 374 | { |
| 375 | resourcePath = bundlePath; |
| 376 | resourcePath += DISTRHO_OS_SEP_STR "resources"; |
| 377 | } |
| 378 | |
| 379 | return resourcePath.buffer(); |
| 380 | #elif defined(DISTRHO_PLUGIN_TARGET_VST3) |
| 381 | static String resourcePath; |
| 382 | |
| 383 | if (resourcePath.isEmpty()) |
| 384 | { |
| 385 | resourcePath = bundlePath; |
| 386 | resourcePath += "/Contents/Resources"; |
| 387 | } |
| 388 | |
| 389 | return resourcePath.buffer(); |
| 390 | #endif |
| 391 | |
| 392 | return nullptr; |
| 393 | } |
| 394 | |
| 395 | #ifndef DISTRHO_PLUGIN_TARGET_JACK |
| 396 | // all these are null for non-standalone targets |