#ifndef DELFINA_H
#define DELFINA_H
/*
**  $VER: delfina.h 3.0 (02.06.96)
**
** Definitions for delfina.library
**
*/

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

/* prototypes for library functions */

void  Delf_Init(void);
ULONG Delf_Peek(ULONG,ULONG);
void Delf_Poke(ULONG,ULONG,ULONG);
void Delf_CopyMem(ULONG,ULONG,ULONG,ULONG);
ULONG Delf_AllocMem(ULONG,ULONG);
void Delf_FreeMem(ULONG,ULONG);
ULONG Delf_AvailMem(ULONG);
struct DelfPrg *Delf_AddPrg(void *);
void Delf_RemPrg(struct DelfPrg *);
ULONG Delf_Run(ULONG,LONG,ULONG,ULONG,ULONG,ULONG,ULONG);
void Delf_Cause(ULONG);
ULONG Delf_AddIntServer(ULONG,struct Interrupt *);
struct Interrupt *Delf_RemIntServer(ULONG);
ULONG Delf_AllocAudio(ULONG,ULONG,ULONG,ULONG);
void Delf_FreeAudio(void);
ULONG Delf_GetAttr(ULONG, ULONG);
void Delf_SetAttrsA(struct TagItem *);
void Delf_SetAttrs(ULONG, ULONG, ... );



#include <pragmas/delfina_pragmas.h>

/* Memory spaces for Delf_AllocMem */
#define DMEMF_PROG   1L
#define DMEMF_XDATA  2L
#define DMEMF_YDATA  4L
#define DMEMF_LDATA  8L

/* options for Delf_AllocMem and Delf_AvailMem */
#define DMEMF_CLEAR  (1L<<16)    /* clear memory after allocation */
#define DMEMF_LARGEST (1L<<17)   /* Largest chunk (Delf_AvailMem) */
#define DMEMF_DISKMEM (1L<<18)   /* align memory for hard disk DMA */
#define DMEMF_TOTAL  (1L<<19)	 /* Total memory (Delf_AvailMem) */

/* Memory alignment flags */
#define DMEMF_ALIGN_MASK    (15<<24)    /* four bit mask */
#define DMEMF_ALIGN_32K     (15<<24)
#define DMEMF_ALIGN_16K     (14<<24)
#define DMEMF_ALIGN_8K      (13<<24)
#define DMEMF_ALIGN_4K      (12<<24)
#define DMEMF_ALIGN_2K      (11<<24)
#define DMEMF_ALIGN_1K      (10<<24)
#define DMEMF_ALIGN_512     (9<<24)
#define DMEMF_ALIGN_256     (8<<24)
#define DMEMF_ALIGN_128     (7<<24)
#define DMEMF_ALIGN_64      (6<<24)
#define DMEMF_ALIGN_32      (5<<24)
#define DMEMF_ALIGN_16      (4<<24)
#define DMEMF_ALIGN_8       (3<<24)
#define DMEMF_ALIGN_4       (2<<24)
#define DMEMF_ALIGN_2       (1<<24)
#define DMEMF_ALIGN_1       (0<<24)     /* no alignment */

/* Definitions for Delf_CopyMem() */
/* Where to copy: */
#define DCPF_FROM_AMY      	0L        /* source is Amiga */
#define DCPF_TO_AMY        	0x100L    /* destination is Amiga */
#define DCPF_FROM_DELFINA  	0x100L    /* just for completeness */
#define DCPF_TO_DELFINA    	0L
#define DCPF_FROMTO_MASK   	0x100L

/* Memory spaces: (the same as DMEMF_ definitions) */ 
#define DCPF_PROG 		DMEMF_PROG
#define DCPF_XDATA 		DMEMF_XDATA
#define DCPF_YDATA 		DMEMF_YDATA
#define DCPF_LDATA 		DMEMF_LDATA
#define DCPF_MEMTYPE_MASK	0xF

/* transfer methods: */
#define DCPF_24BIT 		0L
#define DCPF_16BIT 		0x1000L
#define DCPF_8BIT  		0X2000L
#define DCPF_32BIT  		0x3000L
#define DCPF_METHOD_MASK 	0x3000L


/* mode flags for Delf_Run */
#define DRUNF_ASYNCH 1L 


/* DelfPrg structure, this is generated by AddPrg.
   Any of the pointers can be NULL, if the program doesn't use
   memory in that space. */
struct DelfPrg {
   ULONG prog;    /* pointer to the start of program memory. */
   ULONG xdata;
   ULONG ydata;
   ULONG ldata;
};


/************************************************/
/* Tags for Delf_GetAttr() and Delf_SetAttrs(). */
#define DA_InputGainL	TAG_USER+0x100	
#define DA_InputGainR	TAG_USER+0x101	
#define DA_InputGain	TAG_USER+0x102 /* V3 */

#define DA_OutputVolL	TAG_USER+0x200	
#define DA_OutputVolR	TAG_USER+0x201	
#define DA_OutputVol	TAG_USER+0x202 /* V3 */

#define DA_MonitorVol	TAG_USER+0x280 /* V3 */

#define DA_LineOut	TAG_USER+0x300	
#define DA_HeadphoneOut	TAG_USER+0x301	
#define DA_MicIn	TAG_USER+0x402	
#define DA_LineIn	TAG_USER+0x403	

#define DA_HighLevel	TAG_USER+0x500	
#define DA_MicIsLine	TAG_USER+0x501	
#define DA_HighPass	TAG_USER+0x502	

#define DA_Frequencies	TAG_USER+0x600	
#define DA_Index	TAG_USER+0x601	

#define DA_Mono		TAG_USER+0x1000	
#define DA_uLaw		TAG_USER+0x1001	
#define DA_ALaw		TAG_USER+0x1002	
#define DA_8bit		TAG_USER+0x1003	
#define DA_16bit	TAG_USER+0x1004	

#define DA_Freq		TAG_USER+0x1100	

#define DA_Overrange	TAG_USER+0x1200	

#define DA_Save		TAG_USER+0x2000	
#define DA_Load		TAG_USER+0x2001	
#define DA_Defaults	TAG_USER+0x2002	


#endif /* DELFINA_H */