#ifndef	V_WAVIN_H
#define V_WAVIN_H

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/*
	 * Opens audio, prepares for recording of audio data in given format.
	 * 'on_progress' can be NULL.
	 */
	vboolean	V_GLOBAL	waveCaptureInit(u32_t num_channels,
		u32_t sampling_frequency,u32_t bits_per_sample,
		void (V_CALL *on_progress)(void *),void *on_progress_arg);
	/* Starts/resumes recording */
	vboolean	V_GLOBAL	waveCaptureResume(void);
	/* Pauses recording */
	void		V_GLOBAL	waveCapturePause(void);
	/* Stops recording, closes audio device */
	void		V_GLOBAL	waveCaptureShutdown();
	/*
	 * waveCaptureBlockMode()
	 * Controls behaviour of waveCaptureGet(). If 'blocking'==true, than
	 * waveCaptureGet() will not return until at least 'requested_bytes'
	 * available (or until error occured while reading audio data; in
	 * latter case return value will differ from 'requested_bytes').
	 * If 'blocking'==false, than waveCaptureGet() returns only available
	 * data; in common case return value will be different then
	 * 'requested_bytes'.
	 * NOTE. Can be called only:
	 *  a) between waveCaptureInit() and waveCaptureResume();
	 *  b) between waveCaptureStop() and waveCaptureResume();
	 *  b) between waveCaptureStop() and waveCaptureShutdown(), although
	 *	   such call not very useful :).
	 */
	vboolean	V_GLOBAL	waveCaptureBlockMode(vboolean blocking);
	/*
	 * Returns length (in BYTES, not samples) of data available at the
	 * moment of call.
	 */
	u32_t		V_GLOBAL	waveCaptureLength(void);
	/*
	 * Copies not more than 'requested_bytes' (see comment above) of
	 * audio data into 'dst_buf'. Returns number of copied bytes.
	 */
	u32_t		V_GLOBAL	waveCaptureGet(void *dest_buf,
		u32_t requested_bytes);
#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_WAVIN_H */
