home *** CD-ROM | disk | FTP | other *** search
/ Da Capo / da_capo_vol1.bin / programs / amiga / midi / synth_librarian / sources / synthlib / synthlib.h < prev    next >
C/C++ Source or Header  |  1994-08-20  |  5KB  |  166 lines

  1. /**************************************************************/
  2. /* $VER: SynhLib.h Revison 1.1                                */
  3. /* This file is part of Synth Librarian v1.1                  */
  4. /* ©1993-1994 Jean-Alexis MONTIGNIES                          */
  5. /* This file must not be distributed modified or separatly    */
  6. /* without my written permission                              */
  7. /* See Synth_Librarian.guide for more details                 */
  8. /**************************************************************/
  9.  
  10. /* Synth librarian common include file */
  11.  
  12. #include <exec/types.h>
  13. #include <exec/nodes.h>
  14. #include <exec/ports.h>
  15. /* Définitions communes aux deux taches */
  16.  
  17. /* DumpNode est utilisé pour mémoriser les différents dumps qui parviennent
  18.    à l'AMIGA */
  19.  
  20. struct DumpNode
  21.  {struct Node DNode;
  22.   UBYTE        *Dump;
  23.   ULONG         DumpLength;
  24.   UBYTE        *Data;
  25.   ULONG         DataLength;
  26.   UWORD         Flags;
  27.   UBYTE         Name[32];
  28.   UBYTE         Type[16];
  29.  };
  30.  
  31. #define NODE_FLAGS_BUSY     1
  32. #define NODE_FLAGS_UNNAMED  2
  33. #define NODE_FLAGS_UNTYPED  4
  34.  
  35. /* Messages que les tâches s'adressent */
  36.  
  37. struct LibMessage
  38.  {struct Message LMess;
  39.   UBYTE Code;
  40.   UBYTE *Data;
  41.  };
  42.  
  43. /* Donnees à echanger */
  44. struct Exchange
  45.  {UBYTE *DataPtr;
  46.   struct DumpNode *Node;
  47.   ULONG Length;
  48.   ULONG Data1;
  49.   STRPTR Message;
  50.  };
  51.  
  52. /* Données concernant un driver */
  53. struct DriverData
  54.  {USHORT Flags;
  55.   ULONG (* Driver)(ULONG *StepPtr,struct Exchange *Ex);
  56.   void (* Close)(void);
  57.   struct List *TypeList;
  58.   STRPTR (* About)(void);
  59.   struct Node * (* Recognize)(struct DumpNode *ANode);
  60.  };
  61.  
  62. /* Significations de Step */
  63. /* Reception */
  64. #define STEP_RECIEVE_COMPLETE   -4
  65. #define STEP_ABORT              -3
  66. #define STEP_IO_ERROR           -2
  67. #define STEP_WAIT                0
  68. #define STEP_START               1
  69. #define STEP_RECIEVE             2
  70. #define STEP_CONTINUE            3
  71. #define STEP_RECIEVE_EOF         4
  72. #define STEP_NEXT_SYSEX          6
  73.  
  74. /* Emission */
  75. #define STEP_SEND                0x0100
  76. #define STEP_SEND_START          1+STEP_SEND
  77. #define STEP_SEND_CONTINUE       2+STEP_SEND
  78. #define STEP_SEND_SEND           3+STEP_SEND
  79. #define STEP_SEND_DELAY          5+STEP_SEND
  80. #define STEP_SEND_WAIT           6+STEP_SEND
  81. #define STEP_SEND_RECIEVE        8+STEP_SEND
  82. #define STEP_SEND_RECIEVE_EOF   10+STEP_SEND    
  83. #define STEP_SEND_IO_ERROR       -5+STEP_SEND
  84. #define STEP_SEND_ABORT          -3+STEP_SEND
  85. #define STEP_SEND_COMPLETE       -4+STEP_SEND
  86. /* Autres */
  87. #define STEP_MISC               0x0200
  88. #define STEP_INIT_DRIVER        STEP_MISC+0
  89. #define STEP_EXIT_DRIVER        STEP_MISC+1
  90. /* Requette */
  91. #define STEP_REQ                0x0300
  92. #define STEP_REQ_START          STEP_REQ+0
  93. #define STEP_REQ_SEND           STEP_REQ+1
  94. #define STEP_REQ_CONTINUE       STEP_REQ+3
  95. #define STEP_REQ_ABORT          STEP_REQ-3
  96. #define STEP_REQ_COMPLETE       STEP_REQ-4
  97. #define STEP_REQ_IO_ERROR       STEP_REQ-5
  98. #define STEP_REQ_WAIT           STEP_REQ+4
  99. #define STEP_REQ_RECIEVE        STEP_REQ+6
  100. #define STEP_REQ_RECIEVE_EOF    STEP_REQ+8
  101.  
  102. /* Significations des codes de messages */
  103. #define MSGCODE_INFO            0
  104. #define MSGCODE_ERROR           1
  105. #define MSGCODE_DATA            2
  106. #define MSGCODE_BYE             3
  107. #define MSGCODE_SEND_FINISHED   4
  108. #define MSGCODE_REQ_RESULT      5
  109. #define MSGCODE_DRIVER_QUITED   6
  110. #define MSGCODE_ABORT           64
  111. #define MSGCODE_SEND            65
  112. #define MSGCODE_EXIT            66
  113. #define MSGCODE_REQUEST         67
  114. #define MSGCODE_QUIT_DRIVER     68
  115. #define MSGCODE_NEW_DRIVER      69
  116. #define MSGCODE_IGNORED         128
  117.  
  118. /* Valeurs de Status */
  119. #define STATUS_RECIEVING        (1<<8)
  120. #define STATUS_SENDING          (1<<9)
  121. #define STATUS_EXIT             (1<<10)
  122. #define STATUS_REQUEST          (1<<11)
  123. #define STATUS_QUIT_DRIVER      (1<<12)
  124. #define STATUS_MASK_WAIT        0xFF
  125. #define STATUS_WAIT_IN          1
  126. #define STATUS_WAIT_OUT         2
  127. #define STATUS_WAIT_DELAY       3
  128. #define STATUS_WAIT_OUT_DELAY   4
  129. #define STATUS_WAIT_ALL         5
  130. #define STATUS_WAIT_OUT_IN      6
  131. #define STATUS_NOEXIT           (STATUS_RECIEVING+STATUS_SENDING+STATUS_REQUEST)
  132.  
  133. #define CODE_INIT_NOPORT        1
  134. #define CODE_INIT_NOSERIAL      2
  135. #define CODE_INIT_NOTIMER       3
  136. #define CODE_ERROR_SERIALIN     5
  137.  
  138. /* prototypes */
  139. void ComTask(void);
  140. int FileOpInit(void);
  141. void FileOpClose(void);
  142. void NewMessage(char *Str,UBYTE Code);
  143. void AddDumpToList(struct DumpNode *Node);
  144.  
  145. /* Externe */
  146. extern struct List DumpList;
  147. extern ULONG Flags;
  148. extern ULONG SelectedNumber;
  149. extern struct DumpNode *SelectedDump;
  150. extern ULONG SelectedRequest;
  151. extern struct Node *SelectedRequestNode;
  152.  
  153. #define MAIN_FLAGS_END   1
  154. #define MAIN_FLAGS_CLOSETASK 2
  155. #define MAIN_FLAGS_COMTASK 4
  156. #define MAIN_FLAGS_REQUEST 8
  157. #define MAIN_FLAGS_SEND 16
  158. #define MAIN_FLAGS_NAMED 32
  159. #define MAIN_FLAGS_DRIVER 64
  160. #define MAIN_FLAGS_CHANGE_DRIVER 128
  161.  
  162. #define GTD_LocaleBase 3
  163. #define GTD_ExecBase 2
  164. #define GTD_DosBase 1
  165. #define GTD_IntuitionBase 4
  166.