
	incdir	"Includes:"
	include	"misc/DeliPlayer.i"
	include	"libraries/ReqBase.i"

;
;
	SECTION Player,Code
;
;

	PLAYERHEADER PlayerTagArray

	dc.b '$VER: TestPlayer V1.1 (30 Mar 92)',0
	even

PlayerTagArray
	dc.l	DTP_PlayerVersion,0
	dc.l	DTP_PlayerName,PName
	dc.l	DTP_Creator,CName
	dc.l	DTP_Check2,Chk
	dc.l	DTP_Config,Config
	dc.l	DTP_UserConfig,UserConfig
	dc.l	DTP_SubSongRange,SubSong
	dc.l	DTP_InitPlayer,InitPlay
	dc.l	DTP_EndPlayer,EndPlay
	dc.l	DTP_InitSound,InitSnd
	dc.l	DTP_EndSound,EndSnd
	dc.l	DTP_StartInt,StartSnd
	dc.l	DTP_StopInt,StopSnd
	dc.l	DTP_Volume,Volume
	dc.l	DTP_Balance,Balance
	dc.l	DTP_Faster,Faster
	dc.l	DTP_Slower,Slower
	dc.l	DTP_PrevPatt,PrevPatt
	dc.l	DTP_NextPatt,NextPatt
	dc.l	DTP_PrevSong,PrevSub
	dc.l	DTP_NextSong,NextSub
	dc.l	TAG_DONE

*-----------------------------------------------------------------------*
;
; Player/Creatorname und lokale Daten
;
*-----------------------------------------------------------------------*

PName	dc.b 'TestPlayer',0
CName	dc.b 'Written by Delirium for Testpurposes',0
	even

TextStruct	dc.l 0					; ^Text
		dc.l 0					; ^ParamList
		dc.l 0					; ^Window
		dc.l 0					; ^MiddleText
		dc.l 0					; ^PositiveText
		dc.l OKTxt				; ^NegativeText
		dc.l TitleTxt				; ^Title
		dc.w $ffff				; KeyMask
		dc.w 0					; textcol
		dc.w 0					; detailcol
		dc.w 0					; blockcol
		dc.w 0					; versionnumber
		dc.w 0					; Timeout
		dc.l 0					; abortmask
		dc.l 0					; reserved

OKTxt	
	dc.b '  OK  ',0

TitleTxt
	dc.b 'Information',0

InitTxt1
	dc.b 10,'      InitPlayer-Routine called !',10,10
	dc.b ' This routine is called every time a new module',10
	dc.b ' is loaded. The AUDIOCHANNELS are to be allocated ',10
	dc.b ' here. Modulspecific initalisation is done here.',10,0

EndTxt1	dc.b 10,'      EndPlayer-Routine called !',10,10
	dc.b ' This routine is called every time a module is ',10
	dc.b ' killed (removed from memory). Player specific',10
	dc.b ' cleanup stuff is done here. The AUDIOCHANNELS',10
	dc.b ' are to be freed here.',10,0

InitTxt2
	dc.b 10,'      InitSound-Routine called !',10,10
	dc.b ' This routine is for initialisation of the module. ',10,0

EndTxt2
	dc.b 10,'      EndSound-Routine called !',10,10
	dc.b ' This routine removes the sound (clear audioregs).',10,0

StartTxt
	dc.b 10,'      StartSnd-Routine called !',10,10
	dc.b ' This routine is NULL if you use the automatic method ',10
	dc.b ' of installing the soundinterrupt via the Int pointer.',10
	dc.b ' If you can not use the inbuild method this code must',10
	dc.b ' start the soundinterrupts.',10,0

StopTxt
	dc.b 10,'      StopSnd-Routine called !',10,10
	dc.b ' This routine is NULL, if you use the inbuild method ',10
	dc.b ' via the Int pointer. It is thought for stoping the',10
	dc.b ' the sound interrupts.',10,0

InfoTxt1
	dc.b 10,'       Test of the UserConfig-Routine ! ',10,10
	dc.b ' This routine is thought for advanced Players! ',10
	dc.b ' Here you could, for example, set the default',10
	dc.b ' pathes for searching instruments. This pathes',10
	dc.b ' could be saved in config file, the suggested',10
	dc.b ' filename/path is s:<playername>.config. This',10
	dc.b ' playerspecific configfile should be loaded in',10
	dc.b ' the Config routine.',10,0

InfoTxt2
	dc.b 10,'       Test of the ConfigPlayer-Routine ! ',10,10
	dc.b ' This routine is called after that the player ',10
	dc.b ' is loaded. Here you can load a playerspecific',10
	dc.b ' configfile and set things like an instrument',10
	dc.b ' path.',10,0 

InfoTxt3
	dc.b 10,'   NextPatt-Routine called! ',10,10
	dc.b ' This routine skips one pattern ',10,0

InfoTxt4
	dc.b 10,'   PrevPatt-Routine called! ',10,10
	dc.b ' This routine skips one pattern back ',10,0

InfoTxt5
	dc.b 10,'   NextSubsong-Routine called! ',10,10
	dc.b ' This routine goes to the next subsong ',10,0

InfoTxt6
	dc.b 10,'   PrevSubsong-Routine called! ',10,10
	dc.b ' This routine goes to the previous subsong ',10,0

InfoTxt7
	dc.b 10,'   Faster-Routine called! ',10,10
	dc.b ' This routine increases the playspeed ',10,0

InfoTxt8
	dc.b 10,'   Slower-Routine called! ',10,10
	dc.b ' This routine decreases the playspeed ',10,0

InfoTxt9
	dc.b 10,'   SubSong-Routine called! ',10,10
	dc.b ' This routine has to find out the min & max subsong number ',10,0

InfoTxt10
	dc.b 10,'   Volume-Routine called! ',10,10
	dc.b ' This routine sets the volume ',10,0

InfoTxt11
	dc.b 10,'   Balance-Routine called! ',10,10
	dc.b ' This routine sets the balance ',10,0

	even

*-----------------------------------------------------------------------*
;
; Check if the module is a TestPlayer-Modul (THIS ROUTINE MUST EXIST!!!)
;
*-----------------------------------------------------------------------*

Chk	move.l	dtg_ChkData(a5),a0		; get module base
	moveq	#0,d0
	cmpi.l	#'TEST',(a0)			; is this the supported MODULETYPE?
	sne	d0				; set returnvalue
	rts


*-----------------------------------------------------------------------*
;
; Initialize the player
;
*-----------------------------------------------------------------------*

InitPlay
	lea	InitTxt1(pc),a1			; message
	bsr	DisplayMsg
	moveq	#0,d0				; no Error
	rts


*-----------------------------------------------------------------------*
;
; Clean up the player
;
*-----------------------------------------------------------------------*

EndPlay
	lea	EndTxt1(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Initialize the module
;
*-----------------------------------------------------------------------*

InitSnd
	lea	InitTxt2(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; End sound
;
*-----------------------------------------------------------------------*

EndSnd
	lea	EndTxt2(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Start interrupts
;
*-----------------------------------------------------------------------*

StartSnd	
	lea	StartTxt(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Start interrupts
;
*-----------------------------------------------------------------------*

StopSnd	
	lea	StopTxt(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; IMORTANT NOTE: There is a BIG difference between the »Config« and the 
;		 »UserConfig« Routine !!! The config routine is immediately 
;		 called after that the Player is loaded. It is used to 
;		 configure player (e.g. load config file and set pathes)!
;		 The difference between Config and InitPlayer is that 
;		 Config is called ONCE the player is loaded and that 
;		 InitPlayer is called every time a module is played
;		 The UserConfig routine is only called if the User selects
;		 the player in the PrefWindow and presses the Config Player
;		 GADGET. This routine is thought as a method of getting 
;		 informations (playerspecific preferences) from the user.
;		 E.g. pathes for instruments or maximum memory usage.
;
*-----------------------------------------------------------------------*
;
; get/set playerspecific preferences (configuration routines)
;
*-----------------------------------------------------------------------*

UserConfig
	lea	InfoTxt1(pc),a1			; message
	bra	DisplayMsg

Config
	lea	InfoTxt2(pc),a1			; message
	bsr	DisplayMsg
	moveq	#0,d0				; no Error
	rts


*-----------------------------------------------------------------------*
;
; Patterncontrol
;
*-----------------------------------------------------------------------*

NextPatt
	lea	InfoTxt3(pc),a1			; message
	bra	DisplayMsg

PrevPatt
	lea	InfoTxt4(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Subsongcontrol
;
*-----------------------------------------------------------------------*

SubSong
	lea	InfoTxt9(pc),a1			; message
	bra	DisplayMsg

NextSub
	lea	InfoTxt5(pc),a1			; message
	bra	DisplayMsg

PrevSub
	lea	InfoTxt6(pc),a1			; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Speedcontrol
;
*-----------------------------------------------------------------------*

Faster
	lea	InfoTxt7(pc),a1			; message
	bra	DisplayMsg

Slower
	lea	InfoTxt8(pc),a1			; message
	bra	DisplayMsg

*-----------------------------------------------------------------------*
;
; Volume & Balance Control
;
*-----------------------------------------------------------------------*

Volume
	lea	InfoTxt10(pc),a1		; message
	bra	DisplayMsg

Balance
	lea	InfoTxt11(pc),a1		; message
	bra	DisplayMsg


*-----------------------------------------------------------------------*
;
; Subroutines
;
*-----------------------------------------------------------------------*

DisplayMsg
	lea	TextStruct(pc),a0
	move.l	a1,(a0)
	move.l	dtg_ReqBase(a5),a6
	jsr	_LVOTextRequest(a6)		; write msg
	rts

