Re: iOS - Question on AUGraph in objective C / CPP
Re: iOS - Question on AUGraph in objective C / CPP
- Subject: Re: iOS - Question on AUGraph in objective C / CPP
- From: Jack Nutting <email@hidden>
- Date: Mon, 29 Oct 2012 13:58:03 +0100
On Mon, Oct 29, 2012 at 1:20 PM, Chris Adamson
<email@hidden> wrote:
* On that point, notice mow many other low-to-mid level media APIs in the world -- QuickTime, OpenGL, OpenAL, OpenMAX, etc. -- are also in C. Notice also how the high-level parts of AV Foundation are Obj-C, but the low-level stuff that gets into the nitty-gritty of data buffers is in C (the Core Media framework). Smart people developed that stuff, and I have little reason to presume I know better.
I agree with pretty much all of this, with maybe one exception: creating an audio graph. Setting up an audio graph requires a lot of really repetitive code. Depending on what you're doing, you may be able to abstract that into something reusable, and depending on your preferences using Objective-C to do that instead of C might be a good choice. For instance, it's not uncommon to create a C struct that contains an AudioUnit, an AUNode, etc to group together relevant details for each node. Instead of writing generic functions that work with such a struct, you could just make a class. Setting up and re-configuring graphs isn't something that's typically done so frequently in a running app, so any performance impact of calling Objective-C methods instead of C functions should be negligible.
(Caveat: I haven't actually done this myself. I've gotten as far as abstracting my repetitive graph construction into reusable C stuff, but the next time I'm working on a core project I'll probably make a simple Objective-C class to wrap up some unit/node details, and give myself a nicer high-level interface when setting things up)
--
// Jack Nutting
//
email@hidden//
http://nuthole.com//
http://learncocoa.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden