Accessing PropertiesFile from Plugin

I try to open my properties from a AU plugin in Garageband, and it should open this file

/Users/christian/Library/Preferences/com.mycompany.myplugin/myplugin.settings

instead it opens 

/Users/christian/Library/Containers/com.apple.garageband10/Data/Library/Preferences/com.mycompany.myplugin/myplugin.settings

This is annoying, cause the installer stores the location of the sample-library in this file

Is there any chance to open the file, outside the the Garageband Container, maybe through using the "Application Support" or do i have to add other settings, somewhere?

 

 

Looks like you're getting sandboxed, so it's not very likely that there'll be an easy workaround for that..

well, exactly the same with "Applicatin Support" :-(

any idea, how i can transfer this information to my plugin

EDIT, i read you answer after my relpy

Whe i do File::getSpecialLocation(File::userDocumentsDirectory);

i get

fullPath    juce::String    "/Users/christian/Library/Containers/com.apple.garageband10/Data/Documents"    

i don't think this is way its should work?

( I need this for the fallback procedure )

I think its allowed to browse through the user documents directory, because i can browe with my self implemented file browser o_0 through it

i need just "/Users/Christian/Documents", how do i get this inside a plugin? Any idea?

 

 

Have you checked out this KVR thread: http://www.kvraudio.com/forum/viewtopic.php?f=33&t=364851

Rail

 

JULES: Could you change the PropertiesFile Class, that is possible to save its content in

~/Music/Audio Music Apps

 

I think this is the most relevant post, from this thread

 

Hello, 

Just got a reply from Apple in dev portal. 


Here are the current recommendations: 

(a) Safest assumption 
An AudioUnit has full write access to ~/Music (each AudioUnit host needs this directory anyway, Logic Pro X/GarageBand X and MainStage store their settings, etc in ~/Music/Audio Music Apps). Each plugin will therefore have access to all files in this directory. You could create a hidden directory by prefixing "." in front of the name. I would use the AU-BUNDLE-ID as a directory name to avoid conflicts. This is compatible with or without a sandbox on all OS X versions. 

(b) Work-around for all other directories relative to $HOME 
All access to the file system relative to $HOME will end up inside the container of the sandboxed host. To avoid that, you need to find the real home directory (see the sample code below), which will work just fine, because GBX provides full filesystem access. Right now this access is necessary anyway to maintain compatibility with e.g. sample libraries and files somewhere on the system or external hard drives. We plan to move to secure bookmarks in the future. 

+-(NSString *)realHomeDirectory 
+{ 
+ struct passwd *pw = getpwuid(getuid()); 
+ if (pw == nil) 
+ return nil; 
+ return [NSString stringWithUTF8String:pw->pw_dir]; 
+} 

(c) Additional recommendations 
The following directories seem reasonable for an AudioUnit, if ~/Music is not an option. This way at least the data is in clearly defined directories. 

- ~/Library/Application Support/<AU-BUNDLE-ID> 
- ~/Library/Caches/<AU-BUNDLE-ID> 
- ~/Library/Preferences/<AU-BUNDLE-ID>

 

 

1 Like

thanks!

The PropertiesFile class already allows you to use any file you want.

EDIT: post deleted

 

 

yes, i see :) i will try it, and will give a feedback

Wow, seems to work :)

return new PropertiesFile(File("~/Music/Audio Music Apps/MyCompany/MyPlugin.settings"),options);

 


Thanks for that thread! has something changed about those apple recommendations?


meanwhile I think it's better if we all put our files in the same place..
Did you all decided to go with "~/Music/Audio Music Apps/YourCompany/" for the settings and users'presets file?
 

Why not store data in ~/Music/YourApp/ ?

Apple use the Music folder e.g. with Logic directly (~/Music/Logic/  ). Can we do the same? (Ok, logic is in the AppStore and not sandboxed... :-) )