|
|||
I'm not sure if this is a straightforward problem or not, but...
I am building a VST where the plugin is dependant on a few .raw files containing audio samples. When I build this plugin, it works fine as these files are on my computer, however if I take this to another computer the plugin doesn't function properly as these files aren't there. I know the resources folder in Xcode if used for GUI bitmaps. Can this be done with with .raw files? Is it just a simple case of dragging them into my resources folder? Basically, I need the files to be part of the VST so that when I take it to another computer only the .vst is required. Not sure how to go about doing this? Thanks, Matthew |
|||
| ^ | Joined: 14 Aug 2011 Member: #262660 | ||
|
|||
yes, that should work, but it might be easier to write a little program to serialize the raw file and stick the data in an array a text file [edit] that you compile with your plugin
oli |
|||
| ^ | Joined: 23 Jun 2002 Member: #3139 Location: York, UK | ||
|
|||
Thanks Hibrasil,
I've got a file testFile.raw in resources but when I open it using fopen, it says it couldn't be found I've used this to get the CWD, but not sure where to go from here. #ifdef __APPLE__ CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); char path[PATH_MAX]; if(!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8*)path, PATH_MAX)) { printf("CWD Error"); } CFRelease(resourcesURL); chdir(path); printf("\nCWD = %s\n", path); #endif Any ideas? Thanks, Matthew |
|||
| ^ | Joined: 14 Aug 2011 Member: #262660 | ||
|
|||
looks to me like you are looking inside the main bundle, which would be the host's app bundle not the plugin's.
in objective-c you can do something like NSBundle* pBundle = [NSBundle bundleWithIdentifier:ToNSString("com.me.myplugin")]; there is probably an alternative CF* function you can use oli |
|||
| ^ | Joined: 23 Jun 2002 Member: #3139 Location: York, UK | ||
|
|||
I've managed to locate my resource file and get the path to it
FSRef file2Read; CFBundleRef requestedBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.__MyCompanyName__ .myPlugIn")); CFURLRef testPath = CFBundleCopyResourceURL(requestedBundle, CFSTR("audioSamples.raw"), NULL, NULL); Boolean openedSuccessfully = CFURLGetFSRef(testPath, &file2Read); if(testPath !=NULL && openedSuccessfully) printf("Yes!"); if(testPath == NULL && !openedSuccessfully) printf("No!"); I get a "Yes!" printed to my console window. I have now decided to approach a different route, this was too over the top for what I'm doing. |
|||
| ^ | Joined: 14 Aug 2011 Member: #262660 |
| KVR Forum Index » DSP and Plug-in Development | All times are GMT - 8 Hours |
|
Printable version |
Disclaimer: All communications made available as part of this forum and any opinions, advice, statements, views or other information expressed in this forum are solely provided by, and the responsibility of, the person posting such communication and not of kvraudio.com (unless kvraudio.com is specifically identified as the author of the communication).
Powered by phpBB © phpBB Group






