
	/*******************************************************/
	/* Structure that is returned when you start a module. */
	/*******************************************************/

struct ModInfo {
	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. All strings are NULL terminated.

	APTR	mi_moduletypename;		// Name of the current format
	APTR	mi_modulename;			// Name of the module or NULL
	APTR	mi_samplenamebuffer;	// ptr to struct samplename
	LONG	mi_samplenamebufferlen;

//	** Private fields: Do NOT edit.

	BYTE	mi_paused;
	BYTE	mi_align01;
	APTR	mi_tempbufferptr;
	LONG	mi_tempbufferlen;
	LONG	mi_interrupthandler;

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

	ULONG	mi_Reserved01;
	ULONG	mi_Reserved02;
	ULONG	mi_Reserved03;
	ULONG	mi_Reserved04;
	ULONG	mi_Reserved05;
};						

//	***************************************************
//	* Modtype flags:
//	***************************************************

#define MODTYPE_NOMODULE		-1
#define MODTYPE_THEPLAYER61A	1
#define MODTYPE_THEPLAYER60A	2
#define MODTYPE_PROTRACKER		3
#define MODTYPE_MED				4	// also OctaMED
#define MODTYPE_QUADRACOMPOSER	5
#define MODTYPE_DIGIBOOSTER		6
#define MODTYPE_GMOD			7
#define MODTYPE_WHITTAKER		8
#define MODTYPE_PSID			9
#define MODTYPE_OKTALYZER		10
#define MODTYPE_THX				11
#define MODTYPE_HIPPELCOSO		12
#define MODTYPE_BMOD			13
#define MODTYPE_TRACKERPACKER3	14
#define MODTYPE_SOUNDTRACKER4	15
#define MODTYPE_PRORUNNER2		16
#define MODTYPE_STARTREKKER		17
#define MODTYPE_NOISEPACKER3	18
#define MODTYPE_XPKPACKED		99

//	***************************************************
//	* ERROR CODES THAT MAY BE RETURNED		  		  *
//	***************************************************

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

/****************************************************/
/* tagitems:										*/
/****************************************************/

#define BFBTAG_SongName		TAG_USER+1		// Ptr to module file name.
#define BFBTAG_SongFH		TAG_USER+2		// Ptr to module file handle.
#define BFBTAG_SongBuf		TAG_USER+3		// Ptr to module buffer.
#define BFBTAG_SampleName	TAG_USER+4		// Ptr to sample file name.
#define BFBTAG_SampleFH		TAG_USER+5		// Ptr to sample file handle.
#define BFBTAG_SampleBuf	TAG_USER+6		// Ptr to sample buffer.
#define BFBTAG_ModInfo		TAG_USER+7		// Ptr to struct ModInfo
#define BFBTAG_SongBufLen	TAG_USER+8		// Module buffer length.
#define BFBTAG_SampleBufLen	TAG_USER+9		// Sample buffer length.
#define BFBTAG_ModType		TAG_USER+10		// Moduletype number. (see above)

