; AccessiblePlayer Include File
;

	IFND	EXEC_TYPES_I
	INCLUDE	"Exec/Types.i"
	ENDC

	IFND	UTILITY_TAGITEM_I
	INCLUDE	"Utility/Tagitem.i"
	ENDC

apVersion	=	2		;Current Version Of APlayer

; Library Offsets

apGetTags	=	-30

; Message Numbers

MSG_NextMod	=	"NM"
MSG_NextPos	=	"NP"
MSG_CallBack	=	"CB"

; Sample Info Structure

	STRUCTURE SampleInfoStruct,0
	STRUCT	SI_Name,24		;Store a NULL-terminated string with
					;the name of the sample here.
	APTR	SI_Address		;Set this to the start address of the
					;sample.
	LONG	SI_Length		;Set this to the length of the sample
					;in bytes.
	LONG	SI_RepLen		;This should indicate how many bytes
					;of the sample to be looped. Zero
					;means no loop.

; This Part Are Only Used In The APG_PlaySample Function

	UBYTE	SI_Volume		;Set this to the volume you want.
	UBYTE	SI_Channel		;Set this to the channel you want to
					;use.
	WORD	SI_Period		;Set this to the period you want to
					;play with.
	LABEL	SampleInfoStruct_SIZEOF

; Config Structure

	STRUCTURE ConfigStruct,0
	FPTR	CS_GadUpdate		;Pointer to a function that will fill
					;out a tag list with the new values.
					;It should return a pointer to the tag
					;lists in A0.
	FPTR	CS_Exit			;Pointer to a Exit function.
	UWORD	CS_Width		;Window Width.
	UWORD	CS_Height		;Window Height.
	APTR	CS_Title		;Pointer To Window Title.
	ULONG	CS_IDCMP		;Extra IDCMPs. These IDCMPs will
					;always be set: GADGETUP, GADGETDOWN,
					;VANILLAKEY and MENUPICK.
	APTR	CS_PrefName		;Pointer to a preference filename
					;without a path.
	APTR	CS_PrefData		;Pointer to your preference data.
	APTR	CS_DefPrefData		;Pointer to your default pref. data.
	ULONG	CS_PrefSize		;Number of bytes of your preferences.

	UWORD	CS_GadgetNum		;Number of gadgets you want - 1.
					;Then the Gadget Structure if any
					;gadgets. See macro below.

	UWORD	CS_BevelNum		;Number of bevel boxes you want - 1.
					;Then the Bevel Box Structure if any
					;boxes. See macro below.

; Tags

APT_TagBase		=	$80000000+"AP"

	ENUM	APT_TagBase

	EITEM	APT_RequestVersion
	EITEM	APT_EarlyCheck
	EITEM	APT_Check
	EITEM	APT_LoadModule
	EITEM	APT_FreeModule
	EITEM	APT_GetError
	EITEM	APT_ExtLoad
	EITEM	APT_ExtFree

	EITEM	APT_InitPlayer
	EITEM	APT_EndPlayer
	EITEM	APT_InitSound
	EITEM	APT_EndSound

	EITEM	APT_Interrupt
	EITEM	APT_StartIRQ
	EITEM	APT_StopIRQ

	EITEM	APT_Config

	EITEM	APT_PlayerName
	EITEM	APT_Description

	EITEM	APT_ModuleName
	EITEM	APT_Author
	EITEM	APT_SubSong

	EITEM	APT_CIA
	EITEM	APT_Pause
	EITEM	APT_Volume
	EITEM	APT_VolumeFunc

	EITEM	APT_FastMem

	EITEM	APT_GetMaxPattern
	EITEM	APT_GetMaxSample
	EITEM	APT_GetSongLength
	EITEM	APT_GetSongPos

	EITEM	APT_Rewind
	EITEM	APT_Forward
	EITEM	APT_ChangeChannel
	EITEM	APT_TestNextLine

	EITEM	APT_GetSample
	EITEM	APT_PlaySample
	EITEM	APT_RealtimePlay

	EITEM	APT_CallBack

; Tags From Version 2 (Released as 1.1)

	EITEM	APT_Flags

; APT_Flags Flags

AFB_AnyMem	=	0
AFB_UseAudio	=	1

AF_AnyMem	=	1<<AFB_AnyMem
AF_UseAudio	=	1<<AFB_UseAudio

; Global Data Structure

	STRUCTURE APlayerGlobal,0
	ULONG	APG_FileSize
	UWORD	APG_Tune
	WORD	APG_Hz			;Obsolete
	UBYTE	APG_MaxVolume
	UBYTE	APG_Tempo
	STRUCT	APG_SampleInfo,SampleInfoStruct_SIZEOF

	FPTR	APG_AllocMem
	FPTR	APG_FreeMem

	FPTR	APG_GetFilename
	FPTR	APG_FindName

	FPTR	APG_CheckLoad
	FPTR	APG_PartialLoad
	FPTR	APG_Load

	FPTR	APG_DupOpen
	FPTR	APG_DupClose
	FPTR	APG_Seek

	FPTR	APG_PlaySample

	FPTR	APG_CalcVolume
	FPTR	APG_WaitDMA
	FPTR	APG_SendMsg
	FPTR	APG_SetTimer

	FPTR	APG_NewProcess

	FPTR	APG_OpenWindow
	FPTR	APG_WaitMsg
	FPTR	APG_Reply
	FPTR	APG_ActivateGadget
	FPTR	APG_GetGadAdr
	FPTR	APG_Flash

	FPTR	APG_AllocChannels
	FPTR	APG_FreeChannels

; Functions From Version 2 (Released as 1.1)

	FPTR	APG_CutSuffix
	LABEL	APlayerGlobal_SIZEOF

; This Macro helps you to make Gadgets in your config window

GADSTR	MACRO
	dc.w	\2,\3,\4,\5,\6		;X, Y, Width, Height, ID
	dc.l	\7,\8,\9		;Flags, Text, Tags
	dc.w	\1			;Kind
	ENDM

; This Macro helps you to make Bevel Boxes in your config window

BEVSTR	MACRO
	dc.w	\1,\2,\3,\4		;X, Y, Width, Height
	dc.w	\5			;Normal (FALSE) Or Recessed (TRUE)
	ENDM
