home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / cdrom / cybersound / cdplayer / source / deliplayer.h < prev    next >
C/C++ Source or Header  |  1977-12-31  |  9KB  |  241 lines

  1. /**
  2.  **  $Filename: misc/DeliPlayer.h $
  3.  **  $Release: 2.0 $
  4.  **  $Revision: 2.10$
  5.  **  $Date: 05/02/95$
  6.  **
  7.  **  Definitions and Macros for creating DeliTracker Playermodules
  8.  **
  9.  **  (C) Copyright 1991, 1992, 1993, 1994, 1995 Delirium Softdesign
  10.  **      All Rights Reserved
  11.  **
  12.  ** Converted to C by Christian Buchner
  13.  **
  14.  **/
  15.  
  16. #ifndef    DELITRACKER_PLAYER_H
  17. #define DELITRACKER_PLAYER_H
  18.  
  19. #ifndef EXEC_TYPES_H
  20. #include <exec/types.h>
  21. #endif
  22.  
  23. #ifndef EXEC_PORTS_H
  24. #include <exec/ports.h>
  25. #endif
  26.  
  27. #ifndef UTILITY_TAGITEM_H
  28. #include <utility/tagitem.h>
  29. #endif
  30.  
  31. #ifndef INTUITION_SCREENS_H
  32. #include <intuition/screens.h>
  33. #endif
  34.  
  35. /* --------------------------------------------------------------------------- */
  36.  
  37. #define DELIVERSION 17            /* Current Version of DeliTracker */
  38. #define DELIREVISION 4            /* Current Revision of DeliTracker */
  39.  
  40. /* -------------- The declarations for the interface functions --------------- */
  41.  
  42. extern __asm APTR dt_GetListDataPos(register __d0 ULONG num);
  43. extern __asm ULONG dt_GetListDataSize(register __d0 ULONG num);
  44. extern __asm BOOL dt_LoadFile(void);
  45. extern __asm void dt_CopyDir(void);
  46. extern __asm void dt_CopyFile(void);
  47. extern __asm void dt_CopyString(register __a0 STRPTR string);
  48. extern __asm BOOL dt_AudioAlloc(void);
  49. extern __asm void dt_AudioFree(void);
  50. extern __asm void dt_StartInt(void);
  51. extern __asm void dt_StopInt(void);
  52. extern __asm void dt_SongEnd(void);
  53. extern __asm void dt_CutSuffix(void);
  54. extern __asm void dt_SetTimer(void);
  55. extern __asm void dt_WaitAudioDMA(void);
  56. extern __asm struct Screen *dt_LockScreen(void);
  57. extern __asm void dt_UnlockScreen(void);
  58. extern __asm void dt_NotePlayer(void);
  59. extern __asm APTR dt_AllocListData(register __d0 ULONG size, register __d1 ULONG memflags);
  60. extern __asm void dt_FreeListData(register __a1 APTR memblock);
  61.  
  62. /* ------------------------ Player Function Offsets -------------------------- */
  63.  
  64. struct DeliTrackerPlayer {
  65.     ULONG RTS_code;
  66.     UBYTE ID[8];
  67.     struct TagItem *TagArray;
  68. };
  69.  
  70. /* The TagItem ID's (ti_Tag values) for the player interface follow. */
  71.  
  72. #define DTP_Dummy    (TAG_USER + 0x4454)
  73.  
  74. #define DTP_InternalPlayer    (DTP_Dummy)            /* obsolete */
  75. #define DTP_CustomPlayer    (DTP_Dummy + 1)        /* player is a customplayer */
  76.  
  77. #define DTP_RequestDTVersion    (DTP_Dummy + 2)    /* minimum DeliTracker version needed */
  78. #define DTP_RequestKickVersion    (DTP_Dummy + 3)    /* minimum KickStart version needed */
  79.  
  80. #define DTP_PlayerVersion    (DTP_Dummy + 4)        /* actual player version & revision */
  81. #define DTP_PlayerName        (DTP_Dummy + 5)        /* name of this player */
  82. #define DTP_Creator            (DTP_Dummy + 6)        /* misc string */
  83.  
  84. #define DTP_Check1            (DTP_Dummy + 7)        /* Check Format before loading */
  85. #define DTP_Check2            (DTP_Dummy + 8)        /* Check Format after file is loaded */
  86. #define DTP_ExtLoad            (DTP_Dummy + 9)        /* Load additional files */
  87. #define DTP_Interrupt        (DTP_Dummy + 10)    /* Interrupt routine */
  88. #define DTP_Stop            (DTP_Dummy + 11)    /* Clear Patterncounter */
  89. #define DTP_Config            (DTP_Dummy + 12)    /* Config Player */
  90. #define DTP_UserConfig        (DTP_Dummy + 13)    /* User-Configroutine */
  91. #define DTP_SubSongRange    (DTP_Dummy + 14)    /* Get min&max subsong number */
  92.  
  93. #define DTP_InitPlayer        (DTP_Dummy + 15)    /* Initialisize the Player */
  94. #define DTP_EndPlayer        (DTP_Dummy + 16)    /* Player clean up */
  95. #define DTP_InitSound        (DTP_Dummy + 17)    /* Soundinitialisation routine */
  96. #define DTP_EndSound        (DTP_Dummy + 18)    /* End sound */
  97. #define DTP_StartInt        (DTP_Dummy + 19)    /* Start interrupt */
  98. #define DTP_StopInt            (DTP_Dummy + 20)    /* Stop interrupt */
  99.  
  100. #define DTP_Volume            (DTP_Dummy + 21)    /* Set Volume */
  101. #define DTP_Balance            (DTP_Dummy + 22)    /* Set Balance */
  102. #define DTP_Faster            (DTP_Dummy + 23)    /* Incease playspeed */
  103. #define DTP_Slower            (DTP_Dummy + 24)    /* Decrease playspeed */
  104. #define DTP_NextPatt        (DTP_Dummy + 25)    /* Jump to next pattern */
  105. #define DTP_PrevPatt        (DTP_Dummy + 26)    /* Jump to previous pattern */
  106. #define DTP_NextSong        (DTP_Dummy + 27)    /* Play next subsong */
  107. #define DTP_PrevSong        (DTP_Dummy + 28)    /* Play previous subsong */
  108.  
  109.     /*--- functions in revision 14 or higher (distributed as Release 1.35) --- */
  110.  
  111. #define DTP_SubSongTest        (DTP_Dummy + 29)    /* Test, if given subsong is vaild */
  112.  
  113.     /*--- functions in revision 16 or higher (distributed as Release 2.01) --- */
  114.  
  115. #define DTP_NewSubSongRange    (DTP_Dummy + 30)    /* enhanced replacement for DTP_SubSongRange */
  116.  
  117. #define DTP_DeliBase        (DTP_Dummy + 31)    /* the address of a pointer where DT */
  118.                                                 /* stores a pointer to the DeliGlobals */
  119.  
  120. #define DTP_Flags            (DTP_Dummy + 32)    /* misc Flags (see below) */
  121.  
  122. #define DTP_CheckLen        (DTP_Dummy + 33)    /* Length of the Check Code */
  123.  
  124. #define DTP_Description        (DTP_Dummy + 34)    /* misc string */
  125.  
  126. #define DTP_Decrunch        (DTP_Dummy + 35)    /* pointer to Decrunch Code */
  127. #define DTP_Convert            (DTP_Dummy + 36)    /* pointer to Converter Code */
  128.  
  129. #define DTP_NotePlayer        (DTP_Dummy + 37)    /* pointer to a NotePlayer Structure */
  130. #define DTP_NoteStruct        (DTP_Dummy + 38)    /* the address of a pointer to the */
  131.                                                 /* NoteStruct Structure */
  132. #define DTP_NoteInfo        (DTP_Dummy + 39)    /* a pointer where DT stores a pointer */
  133.                                                 /* to the current NoteStruct Structure */
  134. #define DTP_NoteSignal        (DTP_Dummy + 40)    /* pointer to NoteSignal code */
  135.  
  136. #define DTP_Process            (DTP_Dummy + 41)    /* pointer to process entry code */
  137. #define DTP_Priority        (DTP_Dummy + 42)    /* priority of the process */
  138. #define DTP_StackSize        (DTP_Dummy + 43)    /* stack size of the process */
  139. #define DTP_MsgPort            (DTP_Dummy + 44)    /* a pointer where DT stores a pointer */
  140.                                                 /* to a port to send its messages */
  141.  
  142. #define DTP_Appear            (DTP_Dummy + 45)    /* open your window, if you can */
  143. #define DTP_Disappear        (DTP_Dummy + 46)    /* go dormant */
  144.  
  145. #define DTP_ModuleName        (DTP_Dummy + 47)    /* get the name of the current module */
  146. #define DTP_FormatName        (DTP_Dummy + 48)    /* get the name of the module format */
  147. #define DTP_AuthorName        (DTP_Dummy + 49)    /* not implemented yet */
  148.  
  149.     /*--- functions in revision 17 or higher (distributed as Release 2.07) --- */
  150.  
  151. #define DTP_InitNote        (DTP_Dummy + 50)    /* NoteStruct initialization */
  152.  
  153. #define DTP_PlayTime        (DTP_Dummy + 51)    /* not implemented yet */
  154.  
  155. /* end of player interface enumeration */
  156.  
  157.  
  158. /* --- various flags --------------------------------------------------------- */
  159.  
  160. #define PLYB_CUSTOM 0        /* player is a customplayer */
  161. #define PLYF_CUSTOM 1<<0
  162. #define PLYB_SONGEND 1        /* player supports songend */
  163. #define PLYF_SONGEND 1<<1
  164.  
  165.     /*--- flags defined in revision 17 or higher (distributed as Release 2.07) --- */
  166.  
  167. #define PLYB_ANYMEM 2        /* modules of this player don't require chipmem */
  168. #define PLYF_ANYMEM 1<<2
  169.  
  170. /* --- DeliTracker message --------------------------------------------------- */
  171.  
  172. struct DeliMessage {
  173.     struct Message Message;
  174.     ULONG (*Function)(void);
  175.     ULONG Result;
  176. };
  177.  
  178. /* ---------------------------- Global Variables ------------------------------ */
  179.  
  180. struct DeliTrackerGlobals {
  181.  
  182.     /* ------ if you use dtg_AslBase, make sure that */
  183.     /* ------ DTP_RequestDTVersion is at least 13 ! */
  184.  
  185.     struct Library *AslBase;                /* library base, don't CloseLibrary()!! */
  186.  
  187.     struct Library *DOSBase;                /* library base -"- */
  188.     struct IntuitionBase *IntuitionBase;    /* library base -"- */
  189.     struct GfxBase *GfxBase;                /* library base -"- */
  190.     struct Library *GadToolsBase;            /* librarybase -"- (NULL for Kick 1.3 and below) */
  191.     APTR ReservedLibraryBase;                /* reserved for future use */
  192.  
  193.     STRPTR    DirArrayPtr;    /* Ptr to the directory of the current module */
  194.     STRPTR    FileArrayPtr;    /* Ptr to the filename of the current module */
  195.     STRPTR    PathArrayPtr;    /* Ptr to PathArray (e.g used in LoadFile()) */
  196.  
  197.     APTR    ChkData;        /* pointer to the module to be checked */
  198.     ULONG    ChkSize;        /* size of the module */
  199.  
  200.     UWORD    SndNum;        /* current sound number */
  201.     UWORD    SndVol;        /* volume (ranging from 0 to 64) */
  202.     UWORD    SndLBal;    /* left volume (ranging from 0 to 64) */
  203.     UWORD    SndRBal;    /* right volume (ranging from 0 to 64) */
  204.     UWORD    LED;        /* filter (0 if the LED is off) */
  205.     UWORD    Timer;        /* timer-value for the CIA-Timers */
  206.  
  207.     APTR    dtg_GetListData;
  208.     APTR    dtg_LoadFile;
  209.     APTR    dtg_CopyDir;
  210.     APTR    dtg_CopyFile;
  211.     APTR    dtg_CopyString;
  212.     APTR    dtg_AudioAlloc;
  213.     APTR    dtg_AudioFree;
  214.     APTR    dtg_StartInt;
  215.     APTR    dtg_StopInt;
  216.     APTR    dtg_SongEnd;        /* safe to call from interrupt code ! */
  217.     APTR    dtg_CutSuffix;
  218.  
  219.     /* ------ extension in revision 14 */
  220.  
  221.     APTR    dtg_SetTimer;        /* safe to call from interrupt code ! */
  222.  
  223.     /* ------ extension in revision 15 */
  224.  
  225.     APTR    dtg_WaitAudioDMA;    /* safe to call from interrupt code ! */
  226.  
  227.     /* ------ extension in revision 16 */
  228.  
  229.     APTR    dtg_LockScreen;
  230.     APTR    dtg_UnlockScreen;
  231.     APTR    dtg_NotePlayer;        /* safe to call from interrupt code ! */
  232.     APTR    dtg_AllocListData;
  233.     APTR    dtg_FreeListData;
  234.  
  235.     APTR    dtg_Reserved1;        /* do not use !!! */
  236.     APTR    dtg_Reserved2;        /* do not use !!! */
  237.     APTR    dtg_Reserved3;        /* do not use !!! */
  238. };
  239.  
  240. #endif
  241.