Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ofxiOSSoundPlayer getAVSoundPlayer() method. #2953

Merged

Conversation

julapy
Copy link
Member

@julapy julapy commented Apr 27, 2014

ofxiOSSoundPlayer getAVSoundPlayer() returns a pointer reference to the native AVSoundPlayer object.
this is important to have for the user to have access to the obj-C code.
this is the same as in the ofxiOSVideoPlayer.

ofxiOSSoundPlayer getAVSoundPlayer() returns a pointer reference to the
native AVSoundPlayer object. this is the same as in the
ofxiOSVideoPlayer.
@julapy
Copy link
Member Author

julapy commented Apr 27, 2014

@ofTheo @admsyn you guys ok this?

@admsyn
Copy link
Member

admsyn commented Apr 27, 2014

Makes sense to me 👍 It's been a bit since I've Obj-C'd, but shouldn't this have some sort of ARC __bridge cast though?

@ofTheo
Copy link
Member

ofTheo commented Apr 27, 2014

Looks good to me!

@Ahbee
Copy link

Ahbee commented Apr 28, 2014

if you are using ARC it should be

return (__bridge void*) soundPlayer;

which tells the compiler that no transfer of ownership is being done.

@julapy
Copy link
Member Author

julapy commented May 4, 2014

hmmm im not sure the __bridge is necessary here.
both ofxiOSSoundPlayer and AVSoundPlayer are non-ARC as they manage they manage the memory of their objects using retain/release. even in a ARC project, these two files would still be flagged as non-ARC.

also, as far as i can tell, the __bridge syntax is only used when transferring Core Foundation objects to obj-C objects. not sure it applies to other cases, as far as i can see...
https://developer.apple.com/library/mac/documentation/corefoundation/Conceptual/CFDesignConcepts/Articles/tollFreeBridgedTypes.html

@admsyn
Copy link
Member

admsyn commented May 4, 2014

Yepp, it isn't. I spaced and forgot OF wasn't using ARC :)

@julapy
Copy link
Member Author

julapy commented May 4, 2014

cool thx for confirming @admsyn
i'll merge this now.

julapy added a commit that referenced this pull request May 4, 2014
added ofxiOSSoundPlayer getAVSoundPlayer() method.
@julapy julapy merged commit 8fcd849 into openframeworks:master May 4, 2014
@julapy julapy deleted the ofxiOSSoundPlayer_getAVSoundPlayer branch May 8, 2014 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants