home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / mus / delitracker-2.01.lha / DeliTracker / Files / developer.lha / Developer / Include / misc / DeliPlayer.i next >
Text File  |  1994-04-17  |  13KB  |  374 lines

  1. **
  2. **  $Filename: misc/DeliPlayer.i $
  3. **  $Release: 2.0 $
  4. **  $Revision: 2.01$
  5. **  $Date: 17/04/94$
  6. **
  7. **    Definitions and Macros for creating DeliTracker Playermodules
  8. **
  9. **    (C) Copyright 1991, 1992, 1993, 1994 Delirium Softdesign
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND    DELITRACKER_PLAYER_I
  14. DELITRACKER_PLAYER_I    SET    1
  15.  
  16.     IFND EXEC_PORTS_I
  17.         INCLUDE "exec/ports.i"
  18.     ENDC
  19.  
  20.     IFND EXEC_TYPES_I
  21.         INCLUDE "exec/types.i"
  22.     ENDC
  23.  
  24.     IFND UTILITY_TAGITEM_I
  25.         INCLUDE "utility/tagitem.i"
  26.     ENDC
  27.  
  28. ;----------------------------------------------------------------------------
  29.  
  30. DELIVERSION    EQU    16            ; Current Version of DeliTracker
  31. DELIREVISION    EQU    2            ; Current Revision of DeliTracker
  32.  
  33.  
  34. ;------------------------ Player Function Offsets ---------------------------
  35.  
  36.  STRUCTURE DeliTrackerPlayer,0
  37.  
  38.     STRUCT    dtp_RTS_code,4            ; RTS for security (private !)
  39.     STRUCT    dtp_ID,8            ; Identifier (private !)
  40.     APTR    dtp_TagArray            ; pointer to TagItem array
  41.     LABEL    dtp_SIZE
  42.  
  43. * The TagItem ID's (ti_Tag values) for the player interface follow.
  44.  
  45. DTP_TagBase    EQU    TAG_USER+"DT"
  46.  
  47.     ENUM    DTP_TagBase            ; TagBase
  48.  
  49.     EITEM    DTP_InternalPlayer        ; obsolete
  50.     EITEM    DTP_CustomPlayer        ; player is a customplayer
  51.  
  52.     EITEM    DTP_RequestDTVersion        ; minimum DeliTracker version needed
  53.     EITEM    DTP_RequestKickVersion        ; minimum KickStart version needed
  54. DTP_RequestV37    EQU    DTP_RequestKickVersion    ; obsolete
  55.  
  56.     EITEM    DTP_PlayerVersion        ; actual player version & revision
  57.     EITEM    DTP_PlayerName            ; name of this player
  58.     EITEM    DTP_Creator            ; misc string
  59.  
  60.     EITEM    DTP_Check1            ; Check Format before loading
  61.     EITEM    DTP_Check2            ; Check Format after file is loaded
  62.     EITEM    DTP_ExtLoad            ; Load additional files
  63.     EITEM    DTP_Interrupt            ; Interrupt routine
  64.     EITEM    DTP_Stop            ; Clear Patterncounter
  65.     EITEM    DTP_Config            ; Config Player
  66.     EITEM    DTP_UserConfig            ; User-Configroutine
  67.     EITEM    DTP_SubSongRange        ; Get min&max subsong number
  68.  
  69.     EITEM    DTP_InitPlayer            ; Initialisize the Player
  70.     EITEM    DTP_EndPlayer            ; Player clean up
  71.     EITEM    DTP_InitSound            ; Soundinitialisation routine
  72.     EITEM    DTP_EndSound            ; End sound
  73.     EITEM    DTP_StartInt            ; Start interrupt
  74.     EITEM    DTP_StopInt            ; Stop interrupt
  75.  
  76.     EITEM    DTP_Volume            ; Set Volume
  77.     EITEM    DTP_Balance            ; Set Balance
  78.     EITEM    DTP_Faster            ; Incease playspeed
  79.     EITEM    DTP_Slower            ; Decrease playspeed
  80.     EITEM    DTP_NextPatt            ; Jump to next pattern
  81.     EITEM    DTP_PrevPatt            ; Jump to previous pattern
  82.     EITEM    DTP_NextSong            ; Play next subsong
  83.     EITEM    DTP_PrevSong            ; Play previous subsong
  84.  
  85.     ;--- functions in revision 14 or higher (distributed as Release 1.35) ---
  86.  
  87.     EITEM    DTP_SubSongTest            ; Test, if given subsong is vaild
  88.  
  89.     ;--- functions in revision 16 or higher (distributed as Release 2.01) ---
  90.  
  91.     EITEM    DTP_NewSubSongRange        ; enhanced replacement for DTP_SubSongRange
  92.  
  93.     EITEM    DTP_DeliBase            ; the address of a pointer where DT
  94.                         ; stores a pointer to the DeliGlobals
  95.  
  96.     EITEM    DTP_Flags            ; misc Flags (see below)
  97.  
  98.     EITEM    DTP_CheckLen            ; Length of the Check Code
  99.  
  100.     EITEM    DTP_Description            ; misc string
  101.  
  102.     EITEM    DTP_Decrunch            ; pointer to Decrunch Code
  103.     EITEM    DTP_Convert            ; pointer to Converter Code
  104.  
  105.     EITEM    DTP_NotePlayer            ; pointer to a NotePlayer Structure
  106.     EITEM    DTP_NoteStruct            ; the address of a pointer to the
  107.                         ; NoteStruct Structure
  108.     EITEM    DTP_NoteInfo            ; a pointer where DT stores a pointer
  109.                         ; to the current NoteStruct Structure
  110.     EITEM    DTP_NoteSignal            ; pointer to NoteSignal code
  111.  
  112.     EITEM    DTP_Process            ; pointer to process entry code
  113.     EITEM    DTP_Priority            ; priority of the process
  114.     EITEM    DTP_StackSize            ; stack size of the process
  115.     EITEM    DTP_MsgPort            ; a pointer where DT stores a pointer
  116.                         ; to a port to send its messages
  117.  
  118.     EITEM    DTP_Appear            ; open your window, if you can
  119.     EITEM    DTP_Disappear            ; go dormant
  120.  
  121.     EITEM    DTP_ModuleName            ; get the name of the current module
  122.     EITEM    DTP_FormatName            ; get the name of the module format
  123.  
  124. *** end of player interface enumeration ***
  125.  
  126.  
  127. ; --- various flags ---------------------------------------------------------
  128.  
  129.     BITDEF    PLY,CUSTOM,0            ; player is a customplayer
  130.     BITDEF    PLY,SONGEND,1            ; player supports songend
  131.  
  132.  
  133. ; --- DeliTracker message ---------------------------------------------------
  134.  
  135.    STRUCTURE DeliMessage,MN_SIZE
  136.     ULONG    DTMN_Function            ; function pointer
  137.     ULONG    DTMN_Result            ; store the result here
  138.    LABEL DTMN_SIZE
  139.  
  140.  
  141. ;------------------------------ Player Header -------------------------------
  142. ;
  143. ; Here is the MACRO for creating the player header structure. Use this MACRO !!!
  144. ; Note: Macro68 users could have problems when assembling this macro!
  145.  
  146. PLAYERHEADER    MACRO
  147.     IFC    '\2',''
  148.     moveq    #-1,d0            ; this should return an error
  149.     rts                ; in case someone tried to run it
  150.     ELSEIF
  151.     bra.w    \2            ; branch to startupcode
  152.     ENDC
  153.     dc.b    'DELIRIUM'        ; identifier
  154.     dc.l    \1            ; ^tagitem array
  155.     ENDM
  156.  
  157.  
  158.     ;------ When a subroutine in the player is called, A5 will contain
  159.     ;------ the pointer to the DeliTrackerGlobals, the only exeption is
  160.     ;------ of course the interrupt routine.
  161.     ;------ The interruptroutine is called every 1/50 sec (via timerint).
  162.  
  163.     ;------ When Check is called, supply d0=0 if the format is ok
  164.     ;------ else d0<>0.
  165.  
  166.     ;------ Check1 is called before loading the complete file, you can
  167.     ;------ check in the first 1024 Bytes of the file. If the file is
  168.     ;------ smaller than 1kB, the remaining space will contain zero.
  169.  
  170.     ;------ Check2 is called after the complete file is loaded, you
  171.     ;------ can use dtg_ChkSize to determine the length of the file.
  172.     ;------ If you supply this tag the file can be crunched.
  173.  
  174.     ;------ ExtLoad: routine for loading additional files (instruments).
  175.     ;------    If successful, you must return d0=0 else d0<>0. In case of
  176.     ;------ an error DeliTracker frees all memory used for this module.
  177.  
  178.     ;------    InitPlayer: Here you should allocate the audio channels.
  179.     ;------ In case the player supports multi-modules, you must set here
  180.     ;------ dtg_SndNum to the minimal subsong number (not necessary if
  181.     ;------ you have supplied a DTP_SubSongRange routine!).
  182.     ;------ If successful, you must return d0=0 else d0<>0.
  183.  
  184.     ;------    EndPlayer: Here you should free the audio channels.
  185.  
  186.     ;------ InitSound: If you want to use the internal interrupt but don't
  187.     ;------ need the default 50 Hz frequency, you can write another timer
  188.     ;------ value into dtg_Timer.
  189.  
  190.     ;------ It is recommended to use DTP_SubSongRange/DTP_SubSongTest
  191.     ;------ instead of DTP_NextSong/DTP_PrevSong.
  192.  
  193.     ;------ Volume usually only copies the values dtg_Volume, dtg_SndLBal
  194.     ;------ and dtg_SndRBal to an internal buffer. The interrupt code has
  195.     ;------ access to this buffer and can set the volume correct.
  196.  
  197.     ;------ CheckLen: This tag is only allowed for players. If you supply
  198.     ;------ this tag, the player will be unloaded by DeliTracker in low
  199.     ;------ memory situations. When needed, it will be loaded again
  200.     ;------ automatically.
  201.  
  202.     ;------ Decrunch: Supply d0=0 if you could decrunch the file else
  203.     ;------ d0<>0.
  204.  
  205.     ;------ Convert: Supply d0=0 if you converted the file to another
  206.     ;------ format, else d0<>0.
  207.  
  208.     ;------ Appear: Supply d0<>0 if the window was already opend, else
  209.     ;------ d0=0.
  210.  
  211.     ;------ Disappear: Supply d0=0 if the window was already closed, else
  212.     ;------ d0<>0.
  213.  
  214.     ;------ ModuleName: This tag is only allowed for players. It contains
  215.     ;------ the address of a pointer to the module name (must be null
  216.     ;------ terminated).
  217.  
  218.     ;------ FormatName: This tag is only allowed for convert genies. It
  219.     ;------ contains the address of a pointer to the name of the module
  220.     ;------ format (must be null terminated).
  221.  
  222.     ;------ Note: the Player can consist of more Hunks. That means you
  223.     ;------ can seperate CHIP DATA form CODE (and you should do this!).
  224.  
  225.  
  226. ;---------------------------- Global Variables ------------------------------
  227.  
  228.  STRUCTURE DeliTrackerGlobals,0
  229.  
  230.     ;------ if you use dtg_AslBase, make sure that
  231.     ;------ DTP_RequestDTVersion is at least 13 !
  232.  
  233.     APTR    dtg_AslBase        ; librarybase don't CloseLibrary()
  234.  
  235.     APTR    dtg_DOSBase        ; librarybase -"-
  236.     APTR    dtg_IntuitionBase    ; librarybase -"-
  237.     APTR    dtg_GfxBase        ; librarybase -"-
  238.     APTR    dtg_GadToolsBase    : librarybase -"- (NULL for Kick 1.3 and below)
  239.     APTR    dtg_ReservedLibraryBase    ; reserved for future use
  240.  
  241.     APTR    dtg_DirArrayPtr        ; Ptr to the d