/*
 * portaudio_lite.h -- minimal interface to the portaudio library
 *
 * Made for use with Visualworks Smalltalk DLLCC
 * Stephen Pope -- stp@create.ucsb.edu -- 2003.07.16
 *
 * I currently use the default device for the stream, ignoring the first arg to the open call.
 */

/******* Function Prototypes ********/

/* Initialize/terminate portaudio */

int pa_initialize(void);
int pa_terminate(void);

/* Open the stream, passing in the stream options (channels, rate, sample format, etc.)
 * as well as the (Smalltalk-allocated) I/O buffer pointers and syncronization semaphores */

int pa_open_s(int device, unsigned in_ch, unsigned out_ch, 
		unsigned long format, unsigned rate, unsigned blockSize,
		_oop io_sem, unsigned short * in_buffer, unsigned short * out_buffer);

/* Simpler version (does not use call-backs to Smalltalk, output only) */

int pa_open_p(int device, unsigned out_ch, 
		unsigned long format, unsigned rate, unsigned blockSize);

/* Play a sound buffer */

int pa_play(unsigned short * out_buffer, unsigned numFrames);

/* Start/stop/close the default PA stream */

int pa_start(void);
int pa_stop(void);
int pa_close(void);
