#ifndef _MixStream_H
#define _MixStream_H

#define mixstream_flag_forward		0x01
#define mixstream_flag_backward		0x02
#define mixstream_flag_isbackward	0x04 // status for ping-pong loop
#define mixstream_flag_16bit		0x08
#define mixstream_flag_interlaced	0x10
#define mixstream_flag_filter       0x20

typedef struct
{
	unsigned char*	smp_ptr;   // ptr to start of sample
	int		smp_lstart;// offset, start of sample loop
	int		smp_lend;  // offset, end of sample loop
	int		flags;     // flags
	int		pos;       // current pos: offset from start of sample
	int		fpos;      // current pos decimal part
	int		frequency; // frequency at which to play the sample (Hz)
	int		panning;   // [0 (left) - &100 (right)], &180 surround
	int		volume;    // sample scale in 1/65536
	int		last_smp_value; // stored sample value for use with interpolation
	unsigned char*	pbuffer;   // filled with address of fill buffer used
// Filter in the form y0 = a0 * x0 + b1 * y1 + b2 * y2
// where xi is in(-i*T), yi is out(-i*T), ai and bj are in 1.24 fixed point
	struct
	{
		int y1; // last output sample
		int y2; // before last output sample
		int a0; // to multiply with current input sample
		int b1; // to multiply with last output sample
		int b2; // to multiply with before last output sample
	} filter;
} MixStream;

#endif
