According to its manual ( http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html#a0a12735ac191200f696a43b87667b714 )
stream The address of a PaStream pointer which will receive a pointer to the newly opened stream. So, what you need to pass is a pointer to location where pointer will be stored. The simplest way how to do it (without explaining you how to use NBExternalValue) just do a following: PaError Pa_OpenDefaultStream(NBExternalAddress * stream ... ) then your call site will look like following: streamHandle := NBExternalAddress new. self Pa_opendefaultBlah: streamHandle ... The 'NBExternalAddress *' type treated specially, because usually for most cases if you pass an instance of NBExternalAddress to any function which expects some pointer, NB will pass the value of NBExternalAddress, however if type is NBExternalAddress * , then NB will pass a pointer where pointer value is stored (which effectively means pointer to pointer) that should do the trick. But hold on, next thing you will stuck with is callback ... hehe :) ah.. ok, according to manual, you can simply skip this one by passing NULL (nil) for that, again you can just change the function signature and instead of putting PaStreamCallback<http://portaudio.com/docs/v19-doxydocs/portaudio_8h.html#a8a60fb2a5ec9cbade3f54a9c978e2710>* *streamCallback* put nil. (yes, nil literal) On 13 November 2013 06:11, Sean P. DeNigris <[email protected]> wrote: > Sean P. DeNigris wrote > > I'll let you know how it turns out. > > Okay, I got a little further. I can initialize and terminate the library. > Yahoo!! > > To load the very basic spike: > Gofer it > smalltalkhubUser: 'SeanDeNigris' project: 'PortAudio'; > package: 'PortAudio'; > load. > > My next task is to call... > PaError Pa_OpenDefaultStream(PaStream ** stream, "PaStream > is typedef for > void" > int numInputChannels, > int numOutputChannels, > ulong sampleFormat, > double sampleRate, > ulong framesPerBuffer, > PaStreamCallback streamCallback, > void * userData) (see > http://portaudio.com/docs/v19-doxydocs/open_default_stream.html) > > The first argument is most perplexing to me. I haven't seen any NativeBoost > examples of pointers to pointers. In fact, with pointers to values, it > seems > random whether they are derefenced when described in NB. > > For example: > cairo_t* cairo_create (cairo_surface_t *target); > becomes (from the IWST paper): > self nbCall: #( > AthensCairoCanvas cairo_create ( > AthensCairoSurface cairoSurface)) > > Notice the argument is dereferenced in the NB version. > > But (also from the IWST paper): > "void cairo_matrix_multiply ( > cairo_matrix_t *result, > const cairo_matrix_t *a, > const cairo_matrix_t *b );" > becomes: > self nbCall: #(void cairo_matrix_multiply (AthensCairoMatrix * self, > AthensCairoMatrix * m , AthensCairoMatrix * self ) ) > > In this case, none of the arguments are defererenced. > > Anyway, I'd reeeeeally appreciate it if someone would load the code and see > what the problem is. > > "PortAudio example" will run the demo script I'm translating from the > library docs into Pharo. > > Thanks in advance... > > > > ----- > Cheers, > Sean > -- > View this message in context: > http://forum.world.st/NativeBoost-Documentation-Suggestion-and-Question-tp4720805p4721585.html > Sent from the Pharo Smalltalk Developers mailing list archive at > Nabble.com. > > -- Best regards, Igor Stasenko.
