
;	*******************************************************
;	* The modinfo structure				      *
;	*******************************************************

	STRUCTURE	modinfo,0

		BYTE	mi_moduletype	; see definitions below.
		BYTE	mi_playflag	; 0 if stopped, 1 if playing.

		APTR	mi_bufferptr		; pointer to module buffer
		APTR	mi_samplebufferptr	; pointer to sample buffer
		LONG	mi_bufferlen
		LONG	mi_samplebufferlen
		WORD	mi_positions		; number of positions
		WORD	mi_songs		; number of songs
		WORD	mi_currentposition	; current position number
		WORD	mi_currentsong		; current song number

;	** Text fields. May be read and used as will.

		APTR	mi_moduletypename	; Name of the current format
		APTR	mi_modulename		; Name of the module or NULL
		LONG	mi_modulenamelen	; maxlength of modulename in chars
		APTR	mi_samplenamebuffer	; ptr to struct samplename
		LONG	mi_samplenamebufferlen

;	** Private fields: Do NOT even think about touching.

		BYTE	mi_paused
		BYTE	mi_align01
		APTR	mi_tempbufferptr
		LONG	mi_tempbufferlen
		LONG	mi_interrupthandler

;	** For possible future use. Shouldn't be used for anything.

		STRUCT	mi_reserved,5*4

		LABEL	MI_SIZEOF

;	***************************************************
;	* Modtype flags:
;	***************************************************

MODTYPE_NOMODULE	equ	-1
MODTYPE_THEPLAYER61A	equ	1	; The Player 6.0a
MODTYPE_THEPLAYER60A	equ	2	; The Player 6.1a
MODTYPE_PROTRACKER	equ	3	; ProTracker
MODTYPE_MED		equ	4	; also OctaMED
MODTYPE_QUADRACOMPOSER	equ	5	; QuadraComposer
MODTYPE_DIGIBOOSTER	equ	6	; DigiBooster 1.0-1.5
MODTYPE_GMOD		equ	7	; GMOD
MODTYPE_WHITTAKER	equ	8	; Whittaker
MODTYPE_PSID		equ	9	; PSID
MODTYPE_OKTALYZER	equ	10	; Oktalyzer
MODTYPE_THX		equ	11	; THX sound system
MODTYPE_HIPPELCOSO	equ	12	; Hippel-Coso
MODTYPE_BMOD		equ	13	; BMOD
MODTYPE_TRACKERPACKER3	equ	14	; Tracker Packer III
MODTYPE_SOUNDTRACKER4	equ	15	; Soundtracker IV
MODTYPE_PRORUNNER2	equ	16	; ProRunner 2.0
MODTYPE_STARTREKKER	equ	17	; StarTrekker
MODTYPE_NOISEPACKER3	equ	18	; Noise Packer III
MODTYPE_XPKPACKED	equ	99

;	***************************************************
;	* ERROR CODES THAT MAY BE RETURNED		  *
;	***************************************************

BFBERR_NOERROR		equ	0	; No error.
BFBERR_NOMODULE		equ	-1	; Moduletype not recognized
BFBERR_NOSUBLIB		equ	-2	; No correct sublib found.
BFBERR_XPKERR		equ	-3	; XPK packed modules not supported!
BFBERR_NOMEDLIB		equ	-4	; Unable to open medplayer.library V2+
BFBERR_NOPSIDLIB	equ	-5	; Unable to open playsid.library V1+
BFBERR_NOFILE		equ	-6	; Unable to open file
BFBERR_FILEERROR	equ	-7	; File error
BFBERR_NOMEMORY		equ	-8	; Not enough needed memory.
BFBERR_NOEMULRES	equ	-9	; Unable to allocate emulation resource (PSID)
BFBERR_P60AINITERR	equ	-10	; The Player 6.0a initialization error.
BFBERR_P61AINITERR	equ	-11	; The Player 6.1a initialization error.
BFBERR_NOAUDIO		equ	-12	; Unable to allocate audio channels.
BFBERR_NOCIA		equ	-13	; Unable to allocate CIA interrupt.
BFBERR_020ERR		equ	-14	; This sublibrary requies mc68020+ CPU.
BFBERR_THXERR		equ	-15	; THX system initialization failure.
BFBERR_LOWKICK		equ	-16	; This sublibrary requires KS2.04+
BFBERR_TAGERR		equ	-17	; Invalid taglist!
BFBERR_LIBINUSE		equ	-18	; Master library in use. Unable to override.
BFBERR_BMODERR		equ	-19	; BMOD initialization failure.

;********************************************************
;* Tag items:	See Developer.guide for more info!	*
;********************************************************

BFBTAG_SongName		equ	TAG_USER+1	; Ptr to Song file name.
BFBTAG_SongFH		equ	TAG_USER+2	; Ptr to Song file handle.
BFBTAG_SongBuf		equ	TAG_USER+3	; Ptr to Song buffer.
BFBTAG_SampleName	equ	TAG_USER+4	; Ptr to Sample file name.
BFBTAG_SampleFH		equ	TAG_USER+5	; Ptr to Sample file handle.
BFBTAG_SampleBuf	equ	TAG_USER+6	; Ptr to Sample buffer.

BFBTAG_ModInfo		equ	TAG_USER+7	; Ptr to struct ModInfo
BFBTAG_SongBufLen	equ	TAG_USER+8	; Module buffer length
BFBTAG_SampleBufLen	equ	TAG_USER+9	; Sample buffer length
BFBTAG_ModType		equ	TAG_USER+10	; Moduletype number. (see above)

