One more question, and I believe, I can finish my first IPhone app. This one is about functions in Objective C. What???? functions???? in OOPs?
I understand some native system functions slipping through from C++ for convenience, but anyway....
In System Sound Services Reference, AudioToolbox/AudioToolbox.h, declared in AudioServices.h, defines among other functions these four that follow.
My question is how do I generate the ( AudioServicesSystemSoundCompletionProc ) inCompletionRoutine? What type is it? Is it a pointer? Does it matter, if there is a method which returns it? If so, what is this method? or where would I look to find it? I couldn't find anything in the docs about it.
I am pretty darn sure this function doesn't return the function reference needed for the call back.
And where in my code, do I place such a function declaration when I figure out what it is?
I guess I just place my code responding to the call back inside the function and then throw away what ever my function returns when Audio Services calls it? Or perhaps the function could return nothing... (void)?
Thanks for any help.
Jerry
I understand some native system functions slipping through from C++ for convenience, but anyway....
In System Sound Services Reference, AudioToolbox/AudioToolbox.h, declared in AudioServices.h, defines among other functions these four that follow.
Code:
/* Creates the system sound object pointed to by outSystemSoundID.
*/
OSStatus AudioServicesCreateSystemSoundID (
CFURLRef inFileURL,
SystemSoundID *outSystemSoundID
);
/* Plays the sound inSystemSoundID
* of course we would want to cause (SystemSoundID) inSystemSoundID = outSystemSoundID
*/
void AudioServicesPlaySystemSound (
SystemSoundID inSystemSoundID
);
/* Registers (AudioServicesSystemSoundCompletionProc) inCompletionRoutine
* as a callback function that is invoked when the specified system sound
* finishes playing.
*/
OSStatus AudioServicesAddSystemSoundCompletion (
SystemSoundID inSystemSoundID,
CFRunLoopRef inRunLoop,
CFStringRef inRunLoopMode,
AudioServicesSystemSoundCompletionProc inCompletionRoutine,
void *inClientData
);
/* If you named your function MyAudioServicesSystemSoundCompletionProc, you would declare it like this:
* This "function" is invoked when the sound is finished playing.
*/
void MyAudioServicesSystemSoundCompletionProc (
SystemSoundID ssID,
void *clientData
);
My question is how do I generate the ( AudioServicesSystemSoundCompletionProc ) inCompletionRoutine? What type is it? Is it a pointer? Does it matter, if there is a method which returns it? If so, what is this method? or where would I look to find it? I couldn't find anything in the docs about it.
I am pretty darn sure this function doesn't return the function reference needed for the call back.
And where in my code, do I place such a function declaration when I figure out what it is?
I guess I just place my code responding to the call back inside the function and then throw away what ever my function returns when Audio Services calls it? Or perhaps the function could return nothing... (void)?
Thanks for any help.
Jerry