#ifndef LIBRARIES_MAESTIX_H
#define LIBRARIES_MAESTIX_H TRUE

/*
**      Maestix Library References  -  V37
**
**      © 1995 Richard Körber
*/

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

#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif

#define MTAG_Dummy 0xCD414553            /* Maestix tag base */

/* === SetMaestro() Tags ===================================*/
#define MTAG_Input      (MTAG_Dummy + 0x00)     /* Input? Def. INPUT_STD */
#define MTAG_Output     (MTAG_Dummy + 0x01)     /* Output? Def. OUTPUT_BYPASS */
#define MTAG_SetCSB     (MTAG_Dummy + 0x02)     /* Direct CSB access */
#define MTAG_SetUDB     (MTAG_Dummy + 0x03)     /* Direct UDB access */
#define MTAG_Studio     (MTAG_Dummy + 0x04)     /* Studio mode? (TRUE/FALSE) */
#define MTAG_CopyProh   (MTAG_Dummy + 0x05)     /* Copy protection? */
#define MTAG_Emphasis   (MTAG_Dummy + 0x06)     /* Emphasis */
#define MTAG_Source     (MTAG_Dummy + 0x07)     /* Source category code */
#define MTAG_Rate       (MTAG_Dummy + 0x08)     /* Output rate */
#define MTAG_Validity   (MTAG_Dummy + 0x09)     /* Validity flag (TRUE/FALSE) */
#define MTAG_ResetUDB   (MTAG_Dummy + 0x0A)     /* Reset UDB */
#define MTAG_ResetLSA   (MTAG_Dummy + 0x0C)	/* Reset Local Sample Address */

/* === TAG values: MTAG_Input ==============================*/
#define INPUT_STD       0                       /* User selected input */
#define INPUT_OPTICAL   1                       /* optical input */
#define INPUT_COAXIAL   2                       /* coaxial input */
#define INPUT_SRC48K    3                       /* 48kHz internal source */

/* === TAG values: MTAG_Output =============================*/
#define OUTPUT_BYPASS   0                       /* Bypass */
#define OUTPUT_INPUT    1                       /* from input */
#define OUTPUT_FIFO     2                       /* from FIFO */

/* === TAG values: MTAG_CopyProh ===========================*/
#define CPROH_OFF       0                       /* No protection requested */
#define CPROH_ON        1                       /* Copy protection requested */
#define CPROH_PROHIBIT  2                       /* Copy prohibited */
#define CPROH_INPUT     3                       /* As input */

/* === TAG values: MTAG_Emphasis ===========================*/
#define EMPH_OFF        0                       /* no emphasis */
#define EMPH_50us       1                       /* 50/15µs */
#define EMPH_CCITT      2                       /* CCITT J.17 (studio only) */
#define EMPH_MANUAL     3                       /* Manuell (studio only) */
#define EMPH_INPUT      4                       /* As input */
#define EMPH_ON         (EMPH_50us)

/* === TAG values: MTAG_Source =============================*/
#define SRC_INPUT       0x00                    /* As input */
#define SRC_CD          0x01                    /* CD */
#define SRC_DAT         0x03                    /* DAT */
#define SRC_DSR         0x0C                    /* DSR */
#define SRC_ADCONV      0x06                    /* ADC */
#define SRC_INSTR       0x05                    /* Instrument */

/* === TAG values: MTAG_Rate ===============================*/
#define RATE_32000      0                       /* Rate 32000 Hz */
#define RATE_44100      1                       /* Rate 44100 Hz */
#define RATE_48000      2                       /* Rate 48000 Hz */
#define RATE_44100SUB   3                       /* Rate 44100 Hz CD Submode */
#define RATE_INPUT      4                       /* As input */


/* === GetStatus() values ==================================*/
#define MSTAT_TFIFO     0                       /* Transmit FIFO Status    (s.b.) */
#define MSTAT_RFIFO     1                       /* Receive FIFO Status     (s.b.) */
#define MSTAT_Signal    2                       /* Signal on input?        (BOOL) */
#define MSTAT_Emphasis  3                       /* Signal uses emphasis?   (BOOL) */
#define MSTAT_DATsrc    4                       /* DAT-Source?             (BOOL) */
#define MSTAT_CopyProh  5                       /* Copy protection?        (BOOL) */
#define MSTAT_Rate      6                       /* Rate                   (ULONG) */
#define MSTAT_UDB	7			/* current UDBs		  (UBYTE) */

/* === Values for TFIFO & RFIFO ============================*/
#define FIFO_Off        0                       /* FIFO ist aus */
#define FIFO_Running    1                       /* FIFO läuft */
#define FIFO_Error      2                       /* FIFO lief über */


/* === DataMessageNode =====================================*/
struct DataMessageNode {
    struct  Message dmn_Message;        /* Message node to link */
    APTR    dmn_BufPtr;                 /* Pointer to public buffer memory */
    ULONG   dmn_BufLen;                 /* Length of buffer memory (bytes) */
};

#endif
