[bug] Expansions don't load samples
-
@Christoph-Hart I might have gone crazy because I thought this worked.
When loading a full expansion, the samples aren't being loaded. This only happens in the compiled project and on Windows.
Here's the minimal test projects. You'll need to compile the player and export the expansion as a player library and place it in the player's app data expansions folder, you'll also need to create a link file to the samples.
-
I'm narrowing this down. On Windows for some reason it wants to read the sample location from a LinkFile in the Player's appData directory instead of from the expansion's Samples folder.
-
Ah and magically it's suddenly working and I have no idea why. I shall go consult chat bot 5000.
When selecting the relocate samples thingy after the expansion has loaded, HISE writes the new location to the Link file in AppData instead of the Expansion's link file. I wonder if this is where my problem originated...
-
Aha think I've solved it. If there is no LinkWindows file in the appData folder then it won't load the expansion's samples. The Link file in the appData folder can be pointing anywhere, as long as it exists HISE is happy. So I'll just generate a bogus one for my player plugin, but I still think this is a bug.
-
Funny, I ran into something similar, but only on Linux. The link file isn't created after the expansion is loaded.
On linux I'm working on HISE compiled a couple of days ago, on Win/Mac they're a couple of weeks behind.
-
@modularsamples I'm working on the latest build on both. I've just added a little function to my plugin to automatically create a bogus link file if it doesn't exist. I'll have to add my own handler for missing samples until the bug is fixed.
inline function createDefaultLinkFile() { local filename = ""; local appData = FileSystem.getFolder(FileSystem.AppData); switch (Engine.getOS()) { case "OSX": filename = "LinkOSX"; break; case "LINUX": filename = "LinkLinux"; break; case "WIN": filename = "LinkWindows"; break; } local f = appData.getChildFile(filename); if (!isDefined(f) || !f.isFile()) f.writeString(appData.toString(appData.FullPath)); }
@Christoph-Hart Why do we have different link files for each OS and not just a single link file, since you would never have LinkWindows on MacOS for example?
-
@d-healey Thanks! I'll try this out once the office warms up a bit :)
-
@d-healey Side question, why using ``ìsDefined(f)``` here?
if (!isDefined(f) || !f.isFile())
I assume that if it isn't defined then it's not a file either right?
So just extra security or you have encountered an issue before?EDIT: in fact it is necessarily defined as you do it right above
-
@ustk if
f
isn't defined then.isFile()
will return a function not found error. But I'm probably being over cautious.