; AccessiblePlayer Include File
;

	IFND	APlayer_i
APlayer_i	=	1

	IFND	EXEC_TYPES_I
	INCLUDE	"Exec/Types.i"
	ENDC

	IFND	UTILITY_TAGITEM_I
	INCLUDE	"Utility/Tagitem.i"
	ENDC

apVersion	=	4		;Current Version Of APlayer

;******************************************************************************
;* Library Offsets
;******************************************************************************

apGetTags	=	-30

;******************************************************************************
;* Message Numbers
;******************************************************************************

MSG_NextMod	=	"NM"		;Load Next Module
MSG_NextPos	=	"NP"		;Update Position
MSG_CallBack	=	"CB"		;Call Your CallBack Routine

; Messages From Version 3 (Released as 1.21)

MSG_UpdateAbout	=	"UA"		;Update About Window

;******************************************************************************
;* 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		;OBSOLETE

	EITEM	APT_PlayerName
	EITEM	APT_Description

	EITEM	APT_ModuleName
	EITEM	APT_Author
	EITEM	APT_SubSong

	EITEM	APT_CIA			;OBSOLETE
	EITEM	APT_Pause
	EITEM	APT_Volume
	EITEM	APT_VolumeFunc

	EITEM	APT_FastMem		;OBSOLETE

	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		;OBSOLETE
	EITEM	APT_PlaySample		;OBSOLETE
	EITEM	APT_RealtimePlay

	EITEM	APT_CallBack

; Tags From Version 2 (Released as 1.1)

	EITEM	APT_Flags

; Tags From Version 3 (Released as 1.21)

	EITEM	APT_CfgWindow

; Tags From Version 4 (Released as 1.30)

	EITEM	APT_NewConfig

	EITEM	APT_UsedChannels
	EITEM	APT_SamplesType

	EITEM	APT_GetSampleInfo
	EITEM	APT_NewPlaySample

	EITEM	APT_NotePlayer
	EITEM	APT_DefaultPlayerInfo
	EITEM	APT_NotePlayerInfo

	EITEM	APT_InitNotePlayer
	EITEM	APT_EndNotePlayer
	EITEM	APT_InitNotePlayerSound
	EITEM	APT_EndNotePlayerSound
	EITEM	APT_PlayNote

	EITEM	APT_VirtualChangeChannel;Not Used Yet

APT_NotePlayerName      =       APT_PlayerName

;******************************************************************************
;* APT_Flags Flags
;******************************************************************************

AFB_AnyMem	=	0
AFB_UseAudio	=	1

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

; Flags From Version 3 (Released as 1.21)

AFB_SongEnd	=	2

AF_SongEnd	=	1<<AFB_SongEnd

;******************************************************************************
;* APT_NotePlayerInfo & APT_NotePlayer Flags From Version 4 (Released as 1.30)
;******************************************************************************

ANFB_ChipMem		=	0	;Only Used In APT_NotePlayerInfo
ANFB_FastMem		=	1	;Only Used In APT_NotePlayerInfo
ANFB_HardwareVolume	=	2
ANFB_Signed		=	3
ANFB_Unsigned		=	4
ANFB_Clock		=	5

ANF_ChipMem		=	1<<ANFB_ChipMem
ANF_FastMem		=	1<<ANFB_FastMem
ANF_HardwareVolume	=	1<<ANFB_HardwareVolume
ANF_Signed		=	1<<ANFB_Signed
ANF_Unsigned		=	1<<ANFB_Unsigned
ANF_Clock		=	1<<ANFB_Clock

;******************************************************************************
;* APT_SamplesType Types From Version 4 (Released as 1.30)
;******************************************************************************

ST_Signed		=	1
ST_Unsigned		=	2

;******************************************************************************
;* Global Data Structure
;******************************************************************************

	STRUCTURE APlayerGlobal,0
	ULONG	APG_FileSize
	UWORD	APG_Tune
	UWORD	APG_Reserved0
	UBYTE	APG_MaxVolume
	UBYTE	APG_Tempo
	STRUCT	APG_Reserved1,40

	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		;OBSOLETE

	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

; Data/Functions From Version 2 (Released as 1.1)

	FPTR	APG_CutSuffix

; Data/Functions From Version 3 (Released as 1.21)

	FPTR	APG_OpenFile
	FPTR	APG_CloseFile
	FPTR	APG_DirRequester
	FPTR	APG_FileRequester
	FPTR	APG_UpdateGadgets

	FPTR	APG_CalcTempo

; Data/Functions From Version 4 (Released as 1.30)

	APTR	APG_IntBase		;Intuition.library
	APTR	APG_GfxBase		;Graphics.library
	APTR	APG_UtiBase		;Utility.library
	APTR	APG_ReqBase		;Reqtools.library

	ULONG	APG_Clock
	ULONG	APG_MixingRate

	APTR	APG_SampleInfo
	APTR	APG_NullSample

	APTR	APG_ChannelInfo
	FPTR	APG_NotePlayer

	FPTR	APG_NewPlaySample

	FPTR	APG_GetMaxVolume

	UWORD	APG_MaxChannels
	LABEL	APlayerGlobal_SIZEOF

;******************************************************************************
;* Sample Info Structure From Version 4 (Released as 1.30)
;******************************************************************************

	STRUCTURE SampleInfo,0
	UBYTE	SI_Type			;See below for the types.
	UBYTE	SI_Flags		;See below for the flags.
	APTR	SI_Name			;This should be a pointer to a
					;NULL-terminated string with the name
					;of the sample here.
	APTR	SI_Address		;Set this to the start address of the
					;sample. Zero means no sample.
	LONG	SI_RealLength		;Set this to the length of the sample
					;in bytes.
	LONG	SI_Length		;This should be the length of the
					;sample in 8 bits. That means if you
					;have a 16 bit sample, this should be
					;the half of the SI_RealLength size.
	APTR	SI_LoopStart		;Set this to the address where to loop
					;from. If no loop, set this to the
					;start address of the sample.
	LONG	SI_LoopLength		;This should indicate how many bytes
					;of the sample to be looped. Zero
					;means no loop.
	UBYTE	SI_Volume		;Set this to the volume of the sample.
	UBYTE	SI_Finetune		;This is a byte between -8 and +7.
	UBYTE	SI_SampleBit		;Set this to the bit size of the sample
	UBYTE	SI_Pad
	LABEL	SampleInfo_SIZEOF

;******************************************************************************
;* SampleInfo Types From Version 4 (Released as 1.30)
;******************************************************************************

SIT_Sample		=	0
SIT_AM			=	1
SIT_FM			=	2
SIT_Hybrid		=	3
SIT_AdLib		=	4

;******************************************************************************
;* SampleInfo Flags From Version 4 (Released as 1.30)
;******************************************************************************

SIFB_Unsigned		=	0	;Set this if the sample is unsigned.

SIF_Unsigned		=	1<<SIFB_Unsigned

;******************************************************************************
;* NotePlayer Channel Structure From Version 4 (Released as 1.30)
;******************************************************************************

	STRUCTURE NPChannel,0
	UBYTE	NPC_Flags
	UBYTE	NPC_Reserved0
	APTR	NPC_Start
	ULONG	NPC_Length
	APTR	NPC_LoopStart
	ULONG	NPC_LoopLength
	UWORD	NPC_Period
	UWORD	NPC_Volume
	ULONG	NPC_Reserved1
	ULONG	NPC_Reserved2
	UWORD	NPC_Reserved3
	LABEL	NPChannel_SIZEOF

;******************************************************************************
;* NotePlayer Channel Flags From Version 4 (Released as 1.30)
;******************************************************************************

NPCFB_Sample		=	0
NPCFB_Loop		=	1
NPCFB_Period		=	2
NPCFB_QuadroPeriod	=	3
NPCFB_Volume		=	4

NPCF_Sample		=	1<<NPCFB_Sample
NPCF_Loop		=	1<<NPCFB_Loop
NPCF_Period		=	1<<NPCFB_Period
NPCF_QuadroPeriod	=	1<<NPCFB_QuadroPeriod
NPCF_Volume		=	1<<NPCFB_Volume

;******************************************************************************
;* Config Structure From Version 4 (Released as 1.30)
;******************************************************************************

	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
					;with only the "Player" or "NotePlayer"
					;path.
	APTR	CS_PrefData		;Pointer to your preference data.
	APTR	CS_DefPrefData		;Pointer to your default pref. data.
	ULONG	CS_PrefSize		;Number of bytes in 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.

	BOOL	CS_Text			;Text strings boolean. Set this if you
					;want some text else clear it.
					;Then the normal IntuiText structures
					;linked together.

;******************************************************************************
;* 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

;******************************************************************************
;* Special Gadget Kinds From Version 3 (Released as 1.21)
;******************************************************************************

DISK_KIND	=	800		;Will Make A Disk Gadget
UPARROW_KIND	=	801		;Up Arrow Image Button
DOWNARROW_KIND	=	802		;Down Arrow Image Button

	ENDC
