home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume6 / glib / part01 / glib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-14  |  3.7 KB  |  150 lines

  1. /* $Id: glib.h,v 1.6 89/05/06 17:13:25 lee Exp $
  2.  *
  3.  * GLIB - a Generic LIBrarian and editor for synths
  4.  * Tim Thompson
  5.  * modifications: Kesti, Lee
  6.  * $Log:    glib.h,v $
  7.  * Revision 1.6  89/05/06  17:13:25  lee
  8.  * rel. to comp.sources.misc
  9.  * 
  10.  */
  11.  
  12. #include <stdio.h>
  13. #include "machdep.h"
  14.  
  15. #define EOX 0xf7
  16. #define MOUSE -2
  17.  
  18. #ifndef BUFSIZ
  19. #define BUFSIZ 512
  20. #endif
  21.  
  22. /* If a machine needs to do something special to read/write a binary file, */
  23. /* this is a hook that a machdep.h can override to do what it  needs to. */
  24. /* For example, see the Atari ST version  of machdep.h */
  25. #ifndef OPENBINFILE
  26. #define OPENBINFILE(f,file,mode) f=fopen(file,mode)
  27. #endif
  28.  
  29.  
  30. #ifndef OPENTEXTFILE
  31. #define OPENTEXTFILE(f,name,mode) f=fopen(name,mode)
  32. #endif
  33.  
  34. /* Seconds before we give up trying to read something */
  35. #define TIMEOUT 5
  36.  
  37. #define NUMONSCREEN 12
  38. /* position of first voice row */
  39. #define FIRSTROW 10
  40. #define LEFTSIDE 2
  41. #define RIGHTSIDE 55
  42. #define YANKROW 12
  43. #define YANKCOL 31
  44. #define LIBBANKS 3
  45. #define NOREDRAW 0
  46. #define REDRAW 1
  47.  
  48. #define ctl(x) (x&037)
  49.  
  50. #define CH_REDRAW '\014'
  51.  
  52. #define CH_INC 'K'
  53. #define CH_INC2 'I'
  54. #define CH_INC3 '>'
  55. #define CH_DEC 'J'
  56. #define CH_DEC2 'M'
  57. #define CH_DEC3 '<'
  58. #define CH_SAME 'S'
  59.  
  60. #define CH_LEFT 'h'
  61. #define CH_DOWN 'j'
  62. #define CH_UP 'k'
  63. #define CH_RIGHT 'l'
  64. /* for arrow key support to work, next 4 defines
  65.  * can't be changed (unless code in unix-mach.c is modified)
  66.  */
  67. #define ALTCH_LEFT ctl('b')
  68. #define ALTCH_DOWN ctl('n')
  69. #define ALTCH_UP ctl('p')
  70. #define ALTCH_RIGHT ctl('f')
  71.  
  72. #define SCR_DOWN '\04'
  73. #define SCR_UP '\025'
  74.  
  75. #define STR_LEFT "h"
  76. #define STR_DOWN "j"
  77. #define STR_UP "k"
  78. #define STR_RIGHT "l"
  79.  
  80. #define VOICEBYTE(d,v,n) (*((d)+(v)*Voicesize+(n)))
  81.  
  82. struct paraminfo {
  83.     char *p_name;
  84.     char *p_label;
  85.     INT16 p_lrow;    /* position for printing name */
  86.     INT16 p_lcol;
  87.     INT16 p_vrow;        /* position for printing value */
  88.     INT16 p_vcol;
  89.     char *((*p_tovis)());
  90.     INT16 p_min;
  91.     INT16 p_max;
  92.     INT16 p_val;
  93.     INT16 p_flags;
  94. };
  95.  
  96. struct labelinfo {
  97.     INT16 l_row;
  98.     INT16 l_col;
  99.     char *l_text;
  100. };
  101.  
  102. struct editinfo {
  103.     char *ed_name;        /* Synth name */
  104.     struct paraminfo *ed_params;    /* list of parameters */
  105.     struct labelinfo *ed_labels;    /* screen labels in edit mode */
  106.     INT16 ed_nvoices;        /* number of voices */
  107.     INT16 ed_vsize;        /* size of each voice data, in bytes */
  108.     INT16 ed_nsize;        /* name size */
  109.     int ed_dataid;        /* data ID */
  110.     int (*ed_din)();    /* copy voice data into paraminfo array */
  111.     int (*ed_dout)();    /* copy voice data out of paraminfo array */
  112.     int (*ed_sedit)();    /* send 1 voice to synth edit buffer */
  113.     int (*ed_sone)();    /* send 1 voice to a synth (permanent) patch*/
  114.     int (*ed_sbulk)();    /* send bulk voice data */
  115.     int (*ed_gbulk)();    /* get bulk voice data */
  116.     char *(*ed_nof)();    /* get name of a voice out of data */
  117.     int (*ed_snof)();    /* set name of a voice in data */
  118.     char *(*ed_numof)();    /* convert voice number to on-screen text */
  119.     int (*ed_cvtnum)();    /* convert visable voice number to std. format */
  120.     int (*ed_cvtanum)();    /* convert alphanumeric voice number to std. format */
  121. };
  122.  
  123. struct peredinfo {
  124.     char *ed_libdata;    /* memory for library banks */
  125.     char *ed_syndata;    /* memory for synth bank */
  126.     char *ed_yankdata;    /* memory for yank buffer */
  127.     INT16 ed_libindex;    /* voice number of topmost displayed lib voice*/
  128.     INT16 ed_synindex;    /* ditto for synth side */
  129.     INT16 ed_channel;        /* MIDI channel # */
  130.     INT16 ed_erow;
  131.     INT16 ed_ecol;
  132. };
  133.  
  134. extern struct paraminfo *P;
  135. extern struct labelinfo *L;
  136. extern struct editinfo E[];
  137. extern int Rows, Cols, Channel, Nvoices, Voicesize, Redraw, DataID;
  138. extern char *Reason, *Synthname;
  139.  
  140. char *bankvoice();
  141. void setval();
  142. int getval();
  143. char *malloc(), *alloc(), *nextls();
  144. FILE *fopen();
  145. char *strcat(), *strcpy();
  146. long milliclock();
  147.  
  148. extern int synthinfileflag;
  149. extern int synthoutfileflag;
  150.