/*
 * hifi.h:
 *
 * Copyright (c) 2000 James McKenzie <james@fishsoup.dhs.org>.
 *
 * $Id: hifi.h,v 1.8 2002/04/02 10:07:18 root Exp root $
 *
 * $Log: hifi.h,v $
 * Revision 1.8  2002/04/02 10:07:18  root
 * *** empty log message ***
 *
 * Revision 1.7  2000/11/23 23:44:47  root
 * #
 *
 * Revision 1.6  2000/10/07 18:30:09  root
 * #
 *
 * Revision 1.5  2000/09/29 13:18:24  root
 * #
 *
 * Revision 1.4  2000/09/24 01:12:53  root
 * #
 *
 * Revision 1.3  2000/02/20 03:10:18  root
 * #
 *
 * Revision 1.2  2000/02/20 03:09:30  root
 * #
 *
 *
 */

#ifndef __HIFI_H_
#define __HIFI_H_


#define HIFI_MAX_LEN		384
#define HIFI_PACKED __attribute__ ((packed))

#define HIFI_MAGIC		0x4869

#define HIFI_CMD_EOF		0xffff

#define HIFI_UNIT_ME		0x0
#define HIFI_CLASS_ALL		0xff
#define HIFI_UNIT_DEFAULT 253
#define HIFI_UNIT_ALL		0xff

#define HIFI_CLASS_MINE		0x0
#define HIFI_CLASS_GENERIC	0x1
#define HIFI_CLASS_TUNER	0x2
#define HIFI_CLASS_CD		0x3
#define HIFI_CLASS_MPEG 	0x4
#define HIFI_CLASS_MIXER 	0x5
#define HIFI_CLASS_SYSTEM	0x6
#define HIFI_CLASS_WAVE		0x7
#define HIFI_CLASS_CLOCK	0x8
#define HIFI_CLASS_OGG		0x9
#define HIFI_CLASS_DISPLAY	0x80
#define HIFI_CLASS_CMD		0x81

#define HIFI_CMD(c,n)		(((c) << 7)+(n))
#define HIFI_ST(c,n)		(((c) << 7)+(n)+0x8000)

#define HIFI_STCMD_CLASS(c)	(((c) & 0x7f80) >> 7)

#define HIFI_IS_ST(c)		((c) & 0x8000)
#define HIFI_IS_CMD(c)		(!((c) & 0x8000))

#ifdef PALM

#else
#include <sys/types.h>
#include <linux/types.h>
#include <math.h>

typedef u_int8_t Byte;
typedef u_int16_t Word;
typedef u_int32_t DWord;
typedef int32_t SDWord;

#endif

#include "hifi_protocol.h"
#include "hifi_generic.h"
#include "hifi_cd.h"
#include "hifi_mpeg.h"
#include "hifi_tuner.h"
#include "hifi_system.h"
#include "hifi_wave.h"
#include "hifi_clock.h"
#include "hifi_ogg.h"
#include "hifi_prototypes.h"

#define HIFI_PTR_DIFF(a,b) ((Word) (((Byte *) (a)) - (Byte *) (b)))
#endif
