iPlug2 - C++ Audio Plug-in Framework
IPlugPaths.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5 
6  See LICENSE.txt for more info.
7 
8  ==============================================================================
9 */
10 
11 #pragma once
12 
18 #include "IPlugUtilities.h"
19 
20 BEGIN_IPLUG_NAMESPACE
21 
22 #if defined OS_MAC || defined OS_IOS
23 using PluginIDType = const char *;
24 #elif defined OS_WIN
25 using PluginIDType = HMODULE;
26 #else
27 using PluginIDType = void *;
28 #endif
29 
30 #if defined OS_WIN
31 #include <windows.h>
32  // Unicode helpers
33 void UTF8ToUTF16(wchar_t* utf16Str, const char* utf8Str, int maxLen);
34 void UTF16ToUTF8(WDL_String& utf8Str, const wchar_t* utf16Str);
35 #endif
36 
39 extern void HostPath(WDL_String& path, const char* bundleID = 0);
40 
44 extern void PluginPath(WDL_String& path, PluginIDType pExtra);
45 
51 extern void BundleResourcePath(WDL_String& path, PluginIDType pExtra = 0);
52 
54 extern void DesktopPath(WDL_String& path);
55 
57 extern void UserHomePath(WDL_String& path);
58 
61 extern void AppSupportPath(WDL_String& path, bool isSystem = false);
62 
64 extern void SandboxSafeAppSupportPath(WDL_String& path, const char* appGroupID = "");
65 
70 extern void VST3PresetsPath(WDL_String& path, const char* mfrName, const char* pluginName, bool isSystem = true);
71 
75 extern void INIPath(WDL_String& path, const char* pluginName);
76 
90 extern EResourceLocation LocateResource(const char* fileNameOrResID, const char* type, WDL_String& result, const char* bundleID, void* pHInstance, const char* sharedResourcesSubPath);
91 
95 extern const void* LoadWinResource(const char* resID, const char* type, int& sizeInBytes, void* pHInstance);
96 
98 extern bool AppIsSandboxed();
99 
100 #ifdef OS_IOS
101 extern bool IsAuv3AppExtension();
102 #endif
103 
104 END_IPLUG_NAMESPACE
105 
Utility functions and macros.
bool AppIsSandboxed()
const void * LoadWinResource(const char *resID, const char *type, int &sizeInBytes, void *pHInstance)
Load a resource from the binary (windows only).
void BundleResourcePath(WDL_String &path, PluginIDType pExtra=0)
Get the path to the plug-in bundle resource path.
void SandboxSafeAppSupportPath(WDL_String &path, const char *appGroupID="")
void AppSupportPath(WDL_String &path, bool isSystem=false)
void UserHomePath(WDL_String &path)
EResourceLocation LocateResource(const char *fileNameOrResID, const char *type, WDL_String &result, const char *bundleID, void *pHInstance, const char *sharedResourcesSubPath)
Find the absolute path of a resource based on it&#39;s file name (e.g.
void INIPath(WDL_String &path, const char *pluginName)
Get the path to the folder where the App&#39;s settings.ini file is stored.
void VST3PresetsPath(WDL_String &path, const char *mfrName, const char *pluginName, bool isSystem=true)
void HostPath(WDL_String &path, const char *bundleID=0)
Get the path to the host binary.
void PluginPath(WDL_String &path, PluginIDType pExtra)
Get the path to the plug-in binary.
void DesktopPath(WDL_String &path)