home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / MM1 / SOUNDUTILS / mm1_tracker.lzh / TRACKER4.6 / Amiga / amiga.h next >
Text File  |  1994-11-24  |  3KB  |  139 lines

  1. /* amiga/amiga.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: amiga.h,v 1.16 1994/06/22 21:54:12 Espie Exp Espie $
  6.  * $Log: amiga.h,v $
  7.  *
  8.  * Revision 1.15  1994/01/09  04:49:18  Espie
  9.  * File requester !
  10.  * Added pause gadget.
  11.  * Uncentralized event handling using event management functions.
  12.  * Scroller back calls.
  13.  * Fully working asynchronous interface.
  14.  * Problem with output ? Still to fix !
  15.  * new TYPE_SYNC_DO.
  16.  * Protos for obtain_message, send.
  17.  *
  18.  */
  19.  
  20. #define forever for(;;)
  21.  
  22. /* list scanning.
  23.  * next is needed: with it, we can actually unlink the node while scanning
  24.  * the current list.  Type is provided to avoid type-casting errors in
  25.  * SCANLIST expansion.
  26.  */
  27. #define SCANLIST(node, next, list, type) \
  28.    for((node) = (type)((struct MinList *)(list))->mlh_Head; \
  29.       (next) = (type)((struct MinNode *)(node))->mln_Succ; \
  30.       (node) = (next))
  31.  
  32.  
  33. #define PUBLIC_PORT_NAME "Debug this tracker"
  34.  
  35. /* number of messages to allocate */
  36. #define BUFFER_SIZE 500
  37. /* (total size: 500 * 32 = 16000 bytes, corresponding to roughly
  38.  * 1.5 second */
  39.  
  40. struct ext_message
  41.    {
  42.    struct Message msg;
  43. #define TYPE_DIE 0
  44. #define TYPE_WAIT 1
  45. #define TYPE_FLUSH_CHANNEL 2
  46. #define TYPE_SETUP 3
  47. #define TYPE_CHANGE 4
  48. #define TYPE_FLUSH_BUFFER 5
  49. #define TYPE_COMM 6
  50. #define TYPE_SYNC 7
  51. #define TYPE_SYNC_DO 8
  52. #define TYPE_INVALID 9
  53. #define TYPE_PAUSE 10
  54. #define TYPE_UNPAUSE 11
  55.  
  56.    int type;
  57.    union
  58.       {
  59.       struct
  60.          {
  61.          void (*func)(VALUE p);
  62.          VALUE p;
  63.          } hook;
  64.       struct 
  65.          {
  66.          ULONG high;
  67.          ULONG low;
  68.          } time;
  69.       struct
  70.          {
  71.          void *start;
  72.          ULONG length;
  73.          } sample;
  74.       struct
  75.          {
  76.          USHORT channel_mask;
  77.          USHORT cycle;
  78.          USHORT pitch;
  79.          USHORT volume;
  80.          } info;
  81.       struct
  82.          {
  83.          struct MsgPort *port;
  84.          struct Task *task;
  85.          } comm;
  86.       } data;
  87.    };
  88.  
  89.  
  90. /* the audio server entry point */      
  91. XT void subtask P((struct ext_message *msg));
  92.  
  93. /* Standard functions of the client */
  94.  
  95. /* mes = obtain_message():
  96.  *    obtain a message we can send to the server
  97.  *    (this call may block, but usually not for long)
  98.  */
  99. XT struct ext_message *obtain_message P((void));
  100.  
  101. /* mes = await_type(type):
  102.  *    wait for the return of the next message of a given type
  103.  *    and returns it. Synchronization with the server.
  104.  */
  105. XT struct ext_message *await_type P((int type));
  106.  
  107. /* send(msg, type):
  108.  *    send msg to the server, filling type along the way
  109.  */
  110. XT void send P((struct ext_message *msg, int type));
  111.  
  112.  
  113. XT void add_scroller P((char *s));
  114.  
  115. XT struct Screen *obtain_pubscreen(void);
  116.  
  117. XT void set_break(void);
  118. XT void check_events(void);
  119. XT void await_events(void);
  120. XT void install_signal_handler(int signal, void (*f)(GENERIC data), GENERIC data);
  121. XT void remove_signal_handler(int signal);
  122. XT void install_req_handler(ULONG mask, void (*req_f)(ULONG received));
  123. XT void remove_req_handler(void);
  124.  
  125. struct amiganame
  126.    {
  127.    struct MinNode n;
  128.    int i;
  129.    char s[0];  
  130.    };
  131.  
  132. /* prototypes for the file requester */
  133.  
  134. XT void launch_requester P((void));
  135. XT void requested_file P((struct amiganame *name));
  136.  
  137. /* V39 function */
  138. XT void set_busy_pointer P((BOOL maybe));
  139.