julapy/openFrameworks — pull request #13 by admsyn (2013-07-02 02:49:54+00:00)
Title: Some tweaks to iOSSoundStream

Here's a couple tweaks to the iOSSoundStream refactor. The gist is I:

- Set the input / output stream format of the remoteIO to float. This keeps the code a little leaner, and lets us avoid the for loop + cast in the render callback by deferring to the remoteIO's internal converter which is (presumably) more efficient.

- Added a C-struct context in the input render callback, which lets us cut down on a few of the Objective-C calls. Mostly just the simple stuff like the property accessors.

I tried to keep this reasonably minimal and without changing much about how you've designed the new stream. IMO, this could be a lot tighter if we stuck with entirely C / C++ in the stream internals, with maybe an optional Obj-C interface for people who want to access the stream that way. If that doesn't jive with your intentions, though, I'm perfectly fine accepting this as-is, since it's still a great improvement on what we had previously :)

This code tested in the simulator + a 2012 iPad running iOS 6.