ios - What is `inputProcRefCon` in the `AURenderCallbackStruct`? -
in playing tone (e.g., here), have tell machine function fill io buffer:
// set our tone rendering function on unit aurendercallbackstruct input; input.inputproc = rendertone; input.inputprocrefcon = self; err = audiounitsetproperty(toneunit, kaudiounitproperty_setrendercallback, kaudiounitscope_input, 0, &input, sizeof(input));
it's clear inputproc
procedure take input audiounit. inputprocrefcon
exactly? there ever case cannot set self
?
the refcon void (untyped) pointer arbitrary data, in example c struct backing calling object. if inputproc callback function doesn't need parameters (instance variables) calling object passed, don't need pass self, or can point refcon @ other data (a different c struct or object). callbacks need parameters.
it's c void pointer because api real-time code predates newer objective c idioms.
Comments
Post a Comment