Hey everyone.

I’m writing a document-based audio-editor for macOS and have a problem with 
managing the user's audio files.

The app uses CoreAudio exclusively for everything audio related including 
reading and writing audio files to/from disk. When the user imports an audio 
file into the application (via drag and drop for example), it gets converted 
and written into the document’s filepackage by CoreAudio. The document doesn’t 
complain because I create file wrappers for each audio file when the my 
document’s fileWrapper(ofType:) function get’s called.

The audio files don’t get altered once they’re in the document-package. They're 
just there for CoreAudio to read. Also, combined they could get quite big. 500 
GB of audio files for the biggest projects users might create is not 
unreasonable. 

So these audio files are not managed by my NSDocument subclass (it only saves 
their url for CoreAudio). When duplicating the document or saving it to another 
location the audio files have to move, too. So I currently catch the related 
functions in my NSDocumentController subclass and move them manually. More wild 
problems and sketchy solutions occur and then there is the revert option and 
iCloud. I feel like I’m completely off-track here.

Is it possible for the NSDocument to know about the audio files in it’s package 
folder and handle them like they belong to it without wholly representing them 
in the model? Or can CoreData solve this? I think, however, that storing the 
audio data in anything other than actual audio files will massively complicate 
things with CoreAudio.

Can someone please point me in the right direction?

Thanks!
Max



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to