Alternative way to look for resources

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-11-05 10:51:30 +00:00
parent 667cf05361
commit 0e3b41362f
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
21 changed files with 48 additions and 33 deletions

1
plugins/res/AS Symbolic link
View file

@ -0,0 +1 @@
../AS/res

View file

@ -0,0 +1 @@
../AmalgamatedHarmonics/res

View file

@ -0,0 +1 @@
../AnimatedCircuits/res

View file

@ -0,0 +1 @@
../AudibleInstruments/res

1
plugins/res/Befaco Symbolic link
View file

@ -0,0 +1 @@
../Befaco/res

1
plugins/res/Bidoo Symbolic link
View file

@ -0,0 +1 @@
../Bidoo/res

1
plugins/res/BogaudioModules Symbolic link
View file

@ -0,0 +1 @@
../BogaudioModules/res

1
plugins/res/Cardinal Symbolic link
View file

@ -0,0 +1 @@
../Cardinal/res

1
plugins/res/DrumKit Symbolic link
View file

@ -0,0 +1 @@
../DrumKit/res

1
plugins/res/ESeries Symbolic link
View file

@ -0,0 +1 @@
../ESeries/res

1
plugins/res/Fundamental Symbolic link
View file

@ -0,0 +1 @@
../Fundamental/res

1
plugins/res/GrandeModular Symbolic link
View file

@ -0,0 +1 @@
../GrandeModular/res

View file

@ -0,0 +1 @@
../ImpromptuModular/res

1
plugins/res/JW-Modules Symbolic link
View file

@ -0,0 +1 @@
../JW-Modules/res

1
plugins/res/MindMeldModular Symbolic link
View file

@ -0,0 +1 @@
../MindMeldModular/res

1
plugins/res/ValleyAudio Symbolic link
View file

@ -0,0 +1 @@
../ValleyAudio/res

View file

@ -0,0 +1 @@
../ZetaCarinaeModules/res

1
plugins/res/cf Symbolic link
View file

@ -0,0 +1 @@
../cf/res

1
plugins/res/rackwindows Symbolic link
View file

@ -0,0 +1 @@
../rackwindows/res

View file

@ -37,12 +37,8 @@ std::string bundlePath; // points to plugin manifests dir (or empty)
// get rid of "res/" prefix
static inline std::string& trim(std::string& s)
{
if (std::strncmp(s.c_str(), "res" DISTRHO_OS_SEP_STR, 4) == 0)
s = s.substr(4, s.size()-4);
#if DISTRHO_OS_SEP != '/'
if (std::strncmp(s.c_str(), "res/", 4) == 0)
s = s.substr(4, s.size()-4);
#endif
return s;
}
@ -59,7 +55,7 @@ std::string system(std::string filename) {
// get plugin resource, also trims "res/" as needed
std::string plugin(plugin::Plugin* plugin, std::string filename) {
DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {});
return system::join(plugin->path, bundlePath.empty() ? filename : trim(filename));
return system::join(plugin->path, trim(filename));
}
// path to plugin manifest
@ -79,7 +75,7 @@ std::string pluginPath(const std::string& dirname) {
{
if (dirname == "Core")
return systemDir;
return system::join(systemDir, "..", "..", "plugins", dirname);
return system::join(systemDir, "..", "..", "plugins", "res", dirname);
}
return system::join(systemDir, dirname);
}

View file

@ -93,115 +93,115 @@ static const struct {
{"path6935","path6939","path6941","path6937"}
},
{
"Fundamental/res/8vert.svg",
"Fundamental/8vert.svg",
{"path69642","path69646","path69640","path69644"}
},
{
"Fundamental/res/ADSR.svg",
"Fundamental/ADSR.svg",
{"path33693","path33697","path33699","path33695"}
},
{
"Fundamental/res/Delay.svg",
"Fundamental/Delay.svg",
{"path25369","path25373","path25375","path25371"}
},
{
"Fundamental/res/LFO-1.svg",
"Fundamental/LFO-1.svg",
{"path35889","path35893","path35895","path35891"}
},
{
"Fundamental/res/LFO-2.svg",
"Fundamental/LFO-2.svg",
{"path36131","path36135","path36137","path36133"}
},
{
"Fundamental/res/Merge.svg",
"Fundamental/Merge.svg",
{"path29991","path29995","path29989","path29993"}
},
{
"Fundamental/res/MidSide.svg",
"Fundamental/MidSide.svg",
{"path44181","path44185","path44179","path44183"}
},
{
"Fundamental/res/Mutes.svg",
"Fundamental/Mutes.svg",
{"path21613","path21617","path21611","path21615"}
},
{
"Fundamental/res/Noise.svg",
"Fundamental/Noise.svg",
{"path105594","path105598","path105592","path105596"}
},
{
"Fundamental/res/Octave.svg",
"Fundamental/Octave.svg",
{"path38471","path38475","path38469","path38473"}
},
{
"Fundamental/res/Pulses.svg",
"Fundamental/Pulses.svg",
{"path46241","path46245","path46239","path46243"}
},
{
"Fundamental/res/Quantizer.svg",
"Fundamental/Quantizer.svg",
{"path38549","path38553","path38547","path38551"}
},
{
"Fundamental/res/Random.svg",
"Fundamental/Random.svg",
{"path89732","path89736","path89730","path89734"}
},
{
"Fundamental/res/SEQ3.svg",
"Fundamental/SEQ3.svg",
{"path35687","path35691","path35693","path35689"}
},
{
"Fundamental/res/Scope.svg",
"Fundamental/Scope.svg",
{"path33887","path33891","path33893","path33889"}
},
/* These 2 do not have logos on them?
{
"Fundamental/res/SequentialSwitch1.svg",
"Fundamental/SequentialSwitch1.svg",
{"_______","_______","_______","_______"}
},
{
"Fundamental/res/SequentialSwitch2.svg",
"Fundamental/SequentialSwitch2.svg",
{"_______","_______","_______","_______"}
},
*/
{
"Fundamental/res/Split.svg",
"Fundamental/Split.svg",
{"path29999","path30003","path29997","path30001"}
},
{
"Fundamental/res/Sum.svg",
"Fundamental/Sum.svg",
{"path10913","path10917","path10911","path10915"}
},
{
"Fundamental/res/Unity.svg",
"Fundamental/Unity.svg",
{"path21219","path21223","path21217","path21221"}
},
/* These 2 do not have logos on them?
{
"Fundamental/res/VCA-1.svg",
"Fundamental/VCA-1.svg",
{"_______","_______","_______","_______"}
},
{
"Fundamental/res/VCA.svg",
"Fundamental/VCA.svg",
{"_______","_______","_______","_______"}
},
*/
{
"Fundamental/res/VCF.svg",
"Fundamental/VCF.svg",
{"path25239","path25243","path25245","path25241"}
},
{
"Fundamental/res/VCMixer.svg",
"Fundamental/VCMixer.svg",
{"path125839","path125843","path125845","path125841"}
},
{
"Fundamental/res/VCO-1.svg",
"Fundamental/VCO-1.svg",
{"path33533","path33537","path33539","path33535"}
},
{
"Fundamental/res/VCO-2.svg",
"Fundamental/VCO-2.svg",
{"path37557","path37561","path37563","path37559"}
},
{
"Fundamental/res/Viz.svg",
"Fundamental/Viz.svg",
{"path41769","path41773","path41767","path41771"}
},
};