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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -