/* 
 * Public include file for Noise Extension
 */

#ifndef _NOISE_H_
#define _NOISE_H_

#ifndef _NOISE_SERVER_
#ifndef _XLIB_H_
#include "../Xlib.h"
#endif
#endif

#define NoiseOff			0
#define NoiseBell			1
#define NoiseOn				2

#define InternalBell			0
#define InternalKeyclick		1

#define NoiseNearest			0
#define NoiseInterpolate		1

#define NoiseBlock			0
#define NoiseDiscard			1
#define NoiseSequence			2
#define NoiseMerge			3

/* Errors.  The error_base returned by XNoiseQueryExtension() on the
 * current display MUST be added by the client.  The value for the
 * error base may differ on two different displays.
 */

#define BadNoise			0

#define X_NoiseQueryVersion		1
#define X_NoiseEnable			2
#define X_NoiseCreate			3
#define X_NoiseReset			4
#define X_NoiseDestroy			5
#define X_NoiseAppend			6
#define X_NoisePlay			7
#define X_NoiseInfo			8
#define X_NoiseBestSample		9

#define NoiseNumberEvents		0

#define NoiseNumberErrors		(BadNoise + 1)

typedef unsigned long Noise;

typedef struct {
    unsigned int min_rate;
    unsigned int max_rate;
    unsigned int best_rate;
    unsigned char best_format;
    unsigned char rate_mismatch;
    unsigned char overlap;
    unsigned char status;
} NoiseInfoRec, *NoiseInfoPtr;

#ifndef _NOISE_SERVER_

Bool XNoiseQueryExtension(
	Display *dpy,
	int *error_base
);
Bool XNoiseQueryVersion(
	Display *dpy,
	int *major_version,
	int *minor_version
);
void XNoiseEnable(
	Display *dpy,
	int mode
);
Noise XNoiseCreate(
	Display *dpy,
	int sample_rate
);
void XNoiseReset(
	Display *dpy,
	Noise noise_id,
	int sample_rate
);
void XNoiseDestroy(
	Display *dpy,
	Noise noise_id
);
void XNoiseAppend(
	Display *dpy,
	Noise noise_id,
	void *sample,
	int sample_size,
	int length
);
void XNoisePlay(
	Display *dpy,
	Noise noise_id,
	int volume
);
void XNoiseInfo(
	Display *dpy,
	NoiseInfoPtr noise_info
);
unsigned int XNoiseBestSample(
	Display *dpy,
	unsigned int sample_rate
);

#endif				/* _NOISE_SERVER_ */
#endif				/* _NOISE_H_ */
