MacOS 10.11.6
So I’m seeing an odd thing…
In my plug-in if I use a native FileChooser to select a file, in Pro Tools 12.8 the path is:
/Users/{USERNAME}/....
but if I use Pro Tools 12.5 the path is prepended by /localhost:
/localhost/Users/{USERNAME}/....
and if I use File::existsAsFile() on the latter it fails to find the file.
Any ideas?
Thanks,
Rail
As a quick (and dirty) fix I just added:
File URL::fileFromFileSchemeURL (const URL& fileURL)
{
if (! fileURL.isLocalFile())
{
jassertfalse;
return {};
}
auto path = removeEscapeChars (fileURL.getDomain()).replace ("+", "%2B");
#ifndef JUCE_WINDOWS
path = File::getSeparatorString() + path;
#endif
auto urlElements = StringArray::fromTokens (fileURL.getSubPath(), "/", "");
for (auto urlElement : urlElements)
path += File::getSeparatorString() + removeEscapeChars (urlElement.replace ("+", "%2B"));
if (path.startsWithIgnoreCase ("/localhost")) // <<<---- Added
path = path.substring (10); // <<<---- Added
return path;
}
Rail
I am getting this same issue in Mac Os 10.13.2 and a VST plugin build. Curiously this thing indeed seems to be related to a plugin format build as the Juce standalone “plugin” build does not suffer from the issue! (So far I saw the bug happening when running the plugin in Reaper, Ableton Live and Plogue Bidule.)
It’s host related though… the same binary acts differently depending on if it’s Pro Tools 12.5 vs 12.8
Rail
Happens here as well with ProTools 12.5.x.
Wolfram
Yeah,
I’ve not seen it happen with any other hosts I use for testing… Logic, Cubase, Nuendo, Studio One, Reaper, Live 9, Digital Performer, Sonar, Tracktion… and I don’t believe it was happening in any other version of Pro Tools except 12.5
Rail
t0m
December 19, 2017, 3:32pm
7
Running in Live 9 (very old install) and REAPER (latest) I get a /localhost
, prefix.
Running in Logic Pro X (latest) and the JUCE Demo host there’s no prefix.
Does anyone know what’s going on?
hyakken
December 19, 2017, 5:27pm
8
Related to this one?
Thanks - I shall check out the markup language for next time - meantime I think the post showed the problem with FileChooser on Xcode 9.2 okay. Temp workaround is to build for OSX 10.5 and to live with the deprecations…
I have a problem to load a text file via FileChooser.
Standalone version of my plugin can load a file correctly,
but VST version can’t.
I use Xcode 9.2 on macOS 10.13.2.
t0m
December 19, 2017, 6:05pm
9
You can’t load a text file correctly because of a leading /localhost
or some other reason?
t0m
December 19, 2017, 6:43pm
10
I don’t think this issue is related to the other one.
Let me ask Avid if they can shed some light on how they compiled 12.5 which is different to 12.4 and 12.7 which could cause this.
Rail
hyakken
December 20, 2017, 2:08pm
12
Yes, it’s because /localhost thing.
Standalone version doesn’t have this thing,
but with VST version on Ableton Live, “/localhost” is prepended to full path of a file.
I don’t remember well but since update to Xcode9.2, I think I have this thing.
More likely introduced with this commit:
where they changed to using NSURL for the paths. My fix in the second post in this thread works well.
Rail
hmmm, the only difference I can see is how we get the underlying path from the OS. Instead of:
results.add (File (nsStringToJuce ([[panel URL] path])));
we now have:
chooserResults.add (URL (nsStringToJuce ([[panel URL] absoluteString])));
Are you saying that if you replace the above line with something like:
auto scheme = nsStringToJuce ([[panel URL] scheme);
auto path = nsStringToJuce ([[panel URL] path]);
chooserResults.add (URL (scheme + "://" + path));
then it works for you?
1 Like
Yes, in 12.5 changing to:
if (isSave)
{
// chooserResults.add (URL (nsStringToJuce ([[panel URL] absoluteString])));
auto scheme = nsStringToJuce ([[panel URL] scheme]);
auto path = nsStringToJuce ([[panel URL] path]);
chooserResults.add (URL (scheme + "://" + path));
}
loses the prefix.
Rail