/*
 * This file is a product of Sun Microsystems, Inc. and is provided for
 * unrestricted use provided that this legend is included on all tape
 * media and as a part of the software program in whole or part.  Users
 * may copy or modify this file without charge, but are not authorized to
 * license or distribute it to anyone else except as part of a product
 * or program developed by the user.
 * 
 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
 * 
 * This file is provided with no support and without any obligation on the
 * part of Sun Microsystems, Inc. to assist in its use, correction,
 * modification or enhancement.
 * 
 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE
 * OR ANY PART THEREOF.
 * 
 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
 * or profits or other special, indirect and consequential damages, even
 * if Sun has been advised of the possibility of such damages.
 * 
 * Sun Microsystems, Inc.
 * 2550 Garcia Avenue
 * Mountain View, California  94043
 */
#include "X11/Xmd.h"
#define	X_AUDIO_OPEN	1
#define	X_AUDIO_CLOSE	2
#define	X_AUDIO_SET_VOLUME	3
#define	X_AUDIO_PLAY		4
#define	X_AUDIO_PLAY_OFF	5
#define	X_AUDIO_RECORD		6
#define	X_AUDIO_RECORD_OFF	7

#define	X_Audio_Open	1
#define	X_Audio_Close	2
#define	X_Audio_Set_Volume	3
#define	X_Audio_Play		4
#define	X_Audio_Play_Off	5
#define	X_Audio_Record		6
#define	X_Audio_Record_Off	7

#define WRITE_SIZE			10000
#define ONE_SECOND_DATA_SIZE	8192
#define AUDIONAME			"audio"
#define MIN_VOLUME			(-10)
#define MAX_VOLUME			12


typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length	B16;
} xAudio_OpenReq;
#define	sz_xAudio_OpenReq	4

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length	B16;
} xAudio_CloseReq;
#define	sz_xAudio_CloseReq	4

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length	B16;
} xAudio_PlayReq;
#define	sz_xAudio_PlayReq	4

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length B16;
	CARD32	forced B32;
} xAudio_Play_OffReq;
#define	sz_xAudio_Play_OffReq	8

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length B16;
} xAudio_RecordReq;
#define	sz_xAudio_RecordReq	4

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length;
} xAudio_Record_OffReq;
#define	sz_xAudio_Record_OffReq	4

typedef struct {
	CARD8	reqType;
	BYTE	minor_opcode;
	CARD16	length;
	INT8	ger;
	INT8	gr;
	INT8	gx;
	CARD8	pad;
} xAudio_Set_VolumeReq;
#define	sz_xAudio_Set_VolumeReq	8


/*	the data is send in bytes(char) after this package.
	length = size of buffer in longs;
*/

/* 
	meant to 32 bytes long, don't tempt fate!
*/
typedef struct 	{
	CARD8	type;
	CARD8	id;
	CARD16	sequenceNumber	B16;
	CARD32	length B32;
	CARD32	pad2	B32;
	CARD32	pad3	B32;
	CARD32	pad4	B32;
	CARD32	pad5	B32;
	CARD32	pad6	B32;
	CARD32	pad7	B32;

} xAudio_RecordReply;

typedef struct 	{
	CARD8	type;
	CARD8	id;
	CARD16	sequenceNumber	B16;
	CARD32	opened B32;
	CARD32	closed	B32;
	CARD32	length	B32;
	CARD32	status	B32;
	CARD32	pad5	B32;
	CARD32	pad6	B32;
	CARD32	pad7	B32;

} xAudio_Reply;

