home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 202.lha / MidiToolBox / Sysex-sources / menu.c < prev    next >
C/C++ Source or Header  |  1988-12-27  |  17KB  |  486 lines

  1.  
  2. #include <exec/types.h>
  3. #include <exec/exec.h>
  4. #include <exec/memory.h>
  5. #include <intuition/intuition.h>
  6. #include <libraries/dos.h>
  7. #include <libraries/dosextens.h>
  8. #include <stdio.h>
  9. #include <midi/midi.h>
  10. #include <functions.h>
  11. #include <fcntl.h>
  12.  
  13. #define VERSION 33L    /* 1.2 Library Version    */
  14.  
  15. #define g0    0
  16. #define g1    1
  17. #define g2    2
  18. #define g3    3
  19. #define g4    4
  20. #define g5    5
  21. #define g6    6
  22. #define g7    7
  23. #define g8    8
  24. #define g9    9
  25. #define g10    10
  26. #define g11    11
  27. #define g12    12
  28. #define g13    13
  29. #define g14    14
  30. #define g15    15
  31. #define g16    16
  32.  
  33. SHORT BorderVectors1[] = {
  34.     0,0,
  35.     29,0,
  36.     29,12,
  37.     0,12,
  38.     0,0
  39. };
  40. struct Border Border1 = {
  41.     -2,-1,    /* XY origin relative to container TopLeft */
  42.     1,0,JAM2,    /* front pen, back pen and drawmode */
  43.     5,    /* number of XY vectors */
  44.     BorderVectors1,    /* pointer to XY vectors */
  45.     NULL    /* next border in list */
  46. };
  47. SHORT BorderVectors2[] = {
  48.     0,0,
  49.     38,0,
  50.     38,12,
  51.     0,12,
  52.     0,0
  53. };
  54. struct Border Border2 = {
  55.     -2,-1,    /* XY origin relative to container TopLeft */
  56.     1,0,JAM2,    /* front pen, back pen and drawmode */
  57.     5,    /* number of XY vectors */
  58.     BorderVectors2,    /* pointer to XY vectors */
  59.     NULL    /* next border in list */
  60. };
  61. struct Border Border3 = {
  62.     -9,-3,    /* XY origin relative to container TopLeft */
  63.     1,0,JAM2,    /* front pen, back pen and drawmode */
  64.     5,    /* number of XY vectors */
  65.     BorderVectors2,    /* pointer to XY vectors */
  66.     NULL    /* next border in list */
  67. };
  68.  
  69. struct IntuiText IText2 = {
  70.     1,0,JAM1,    /* front and back text pens, drawmode and fill byte */
  71.     -202,2,    /* XY origin relative to container TopLeft */
  72.     NULL,    /* font pointer or NULL for default */
  73.     (UBYTE *)"System Exclusive Channel",    /* pointer to text */
  74.     NULL    /* next IntuiText structure */
  75. };
  76.  
  77. struct IntuiText IText1 = {
  78.     1,0,JAM2,    /* front and back text pens, drawmode and fill byte */
  79.     8,2,    /* XY origin relative to container TopLeft */
  80.     NULL,    /* font pointer or NULL for default */
  81.     (UBYTE *)"16",    /* pointer to text */
  82.     &IText2    /* next IntuiText structure */
  83. };
  84.  
  85. struct Gadget Gadget1 = {
  86.     NULL,    /* next gadget */
  87.     214,13,    /* origin XY of hit box relative to window TopLeft */
  88.     35,11,    /* hit box width and height */
  89.     NULL,    /* gadget flags */
  90.     RELVERIFY,    /* activation flags */
  91.     BOOLGADGET,    /* gadget type flags */
  92.     (APTR)&Border2,    /* gadget border or image to be rendered */
  93.     NULL,    /* alternate imagery for selection */
  94.     &IText1,    /* first IntuiText structure */
  95.     NULL,    /* gadget mutual-exclude long word */
  96.     NULL,    /* SpecialInfo structure */
  97.     NULL,    /* user-definable data */
  98.     NULL    /* pointer to user-definable data */
  99. };
  100.  
  101. #define GadgetList1 Gadget1
  102.  
  103. struct IntuiText IText3 = {
  104.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  105.     19,1,    /* XY origin relative to container TopLeft */
  106.     NULL,    /* font pointer or NULL for default */
  107.     (UBYTE *)"Other (No Checking)",    /* pointer to text */
  108.     NULL    /* next IntuiText structure */
  109. };
  110.  
  111. struct MenuItem MenuItem5 = {
  112.     NULL,    /* next MenuItem structure */
  113.     0,36,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  114.     243,9,    /* hit box width and height */
  115.     CHECKIT+ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP+CHECKED,    /* Item flags */
  116.     0xffef,    /* each bit mutually-excludes a same-level Item */
  117.     (APTR)&IText3,    /* Item render  (IntuiText or Image or NULL) */
  118.     NULL,    /* Select render */
  119.     'q',    /* alternate command-key */
  120.     NULL,    /* SubItem list */
  121.     MENUNULL    /* filled in by Intuition for drag selections */
  122. };
  123.  
  124. struct IntuiText IText4 = {
  125.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  126.     19,1,    /* XY origin relative to container TopLeft */
  127.     NULL,    /* font pointer or NULL for default */
  128.     (UBYTE *)"Matrix 6",    /* pointer to text */
  129.     NULL    /* next IntuiText structure */
  130. };
  131.  
  132. struct MenuItem MenuItem4 = {
  133.     &MenuItem5,    /* next MenuItem structure */
  134.     0,27,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  135.     243,9,    /* hit box width and height */
  136.     CHECKIT+ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  137.     0xfff7,    /* each bit mutually-excludes a same-level Item */
  138.     (APTR)&IText4,    /* Item render  (IntuiText or Image or NULL) */
  139.     NULL,    /* Select render */
  140.     'm',    /* alternate command-key */
  141.     NULL,    /* SubItem list */
  142.     MENUNULL    /* filled in by Intuition for drag selections */
  143. };
  144.  
  145. struct IntuiText IText5 = {
  146.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  147.     19,1,    /* XY origin relative to container TopLeft */
  148.     NULL,    /* font pointer or NULL for default */
  149.     (UBYTE *)"TX81Z",    /* pointer to text */
  150.     NULL    /* next IntuiText structure */
  151. };
  152.  
  153. struct MenuItem MenuItem3 = {
  154.     &MenuItem4,    /* next MenuItem structure */
  155.     0,18,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  156.     243,9,    /* hit box width and height */
  157.     CHECKIT+ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  158.     0xfffb,    /* each bit mutually-excludes a same-level Item */
  159.     (APTR)&IText5,    /* Item render  (IntuiText or Image or NULL) */
  160.     NULL,    /* Select render */
  161.     't',    /* alternate command-key */
  162.     NULL,    /* SubItem list */
  163.     MENUNULL    /* filled in by Intuition for drag selections */
  164. };
  165.  
  166. struct IntuiText IText6 = {
  167.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  168.     19,1,    /* XY origin relative to container TopLeft */
  169.     NULL,    /* font pointer or NULL for default */
  170.     (UBYTE *)"FB-01",    /* pointer to text */
  171.     NULL    /* next IntuiText structure */
  172. };
  173.  
  174. struct MenuItem MenuItem2 = {
  175.     &MenuItem3,    /* next MenuItem structure */
  176.     0,9,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  177.     243,9,    /* hit box width and height */
  178.     CHECKIT+ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  179.     0xfffd,    /* each bit mutually-excludes a same-level Item */
  180.     (APTR)&IText6,    /* Item render  (IntuiText or Image or NULL) */
  181.     NULL,    /* Select render */
  182.     'f',    /* alternate command-key */
  183.     NULL,    /* SubItem list */
  184.     MENUNULL    /* filled in by Intuition for drag selections */
  185. };
  186.  
  187. struct IntuiText IText7 = {
  188.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  189.     19,1,    /* XY origin relative to container TopLeft */
  190.     NULL,    /* font pointer or NULL for default */
  191.     (UBYTE *)"DX7 TX7 DX27 DX21 DX100",    /* pointer to text */
  192.     NULL    /* next IntuiText structure */
  193. };
  194.  
  195. struct MenuItem MenuItem1 = {
  196.     &MenuItem2,    /* next MenuItem structure */
  197.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  198.     243,9,    /* hit box width and height */
  199.     CHECKIT+ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  200.     0xfffe,    /* each bit mutually-excludes a same-level Item */
  201.     (APTR)&IText7,    /* Item render  (IntuiText or Image or NULL) */
  202.     NULL,    /* Select render */
  203.     'd',    /* alternate command-key */
  204.     NULL,    /* SubItem list */
  205.     MENUNULL    /* filled in by Intuition for drag selections */
  206. };
  207.  
  208. struct Menu Menu3 = {
  209.     NULL,    /* next Menu structure */
  210.     263,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  211.     138,0,    /* Menu hit box width and height */
  212.     MENUENABLED,    /* Menu flags */
  213.     "Error Checking",    /* text of Menu name */
  214.     &MenuItem1    /* MenuItem linked list pointer */
  215. };
  216.  
  217. struct IntuiText IText8 = {
  218.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  219.     4,1,    /* XY origin relative to container TopLeft */
  220.     NULL,    /* font pointer or NULL for default */
  221.     (UBYTE *)"Master Data",    /* pointer to text */
  222.     NULL    /* next IntuiText structure */
  223. };
  224.  
  225. struct MenuItem SubItem3 = {
  226.     NULL,    /* next SubItem structure */
  227.     113,18,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  228.     104,9,    /* hit box width and height */
  229.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  230.     0,    /* each bit mutually-excludes a same-level Item */
  231.     (APTR)&IText8,    /* Item render  (IntuiText or Image or NULL) */
  232.     NULL,    /* Select render */
  233.     NULL,    /* alternate command-key */
  234.     NULL,    /* no SubItem list for SubItems */
  235.     MENUNULL    /* filled in by Intuition for drag selections */
  236. };
  237.  
  238. struct IntuiText IText9 = {
  239.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  240.     4,1,    /* XY origin relative to container TopLeft */
  241.     NULL,    /* font pointer or NULL for default */
  242.     (UBYTE *)"Splits Data",    /* pointer to text */
  243.     NULL    /* next IntuiText structure */
  244. };
  245.  
  246. struct MenuItem SubItem2 = {
  247.     &SubItem3,    /* next SubItem structure */
  248.     113,9,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  249.     104,9,    /* hit box width and height */
  250.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  251.     0,    /* each bit mutually-excludes a same-level Item */
  252.     (APTR)&IText9,    /* Item render  (IntuiText or Image or NULL) */
  253.     NULL,    /* Select render */
  254.     NULL,    /* alternate command-key */
  255.     NULL,    /* no SubItem list for SubItems */
  256.     MENUNULL    /* filled in by Intuition for drag selections */
  257. };
  258.  
  259. struct IntuiText IText10 = {
  260.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  261.     4,1,    /* XY origin relative to container TopLeft */
  262.     NULL,    /* font pointer or NULL for default */
  263.     (UBYTE *)"Single Voice",    /* pointer to text */
  264.     NULL    /* next IntuiText structure */
  265. };
  266.  
  267. struct MenuItem SubItem1 = {
  268.     &SubItem2,    /* next SubItem structure */
  269.     113,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  270.     104,9,    /* hit box width and height */
  271.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  272.     0,    /* each bit mutually-excludes a same-level Item */
  273.     (APTR)&IText10,    /* Item render  (IntuiText or Image or NULL) */
  274.     NULL,    /* Select render */
  275.     NULL,    /* alternate command-key */
  276.     NULL,    /* no SubItem list for SubItems */
  277.     MENUNULL    /* filled in by Intuition for drag selections */
  278. };
  279.  
  280. struct IntuiText IText11 = {
  281.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  282.     4,1,    /* XY origin relative to container TopLeft */
  283.     NULL,    /* font pointer or NULL for default */
  284.     (UBYTE *)"Matrix 6",    /* pointer to text */
  285.     NULL    /* next IntuiText structure */
  286. };
  287.  
  288. struct MenuItem MenuItem9 = {
  289.     NULL,    /* next MenuItem structure */
  290.     0,27,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  291.     128,9,    /* hit box width and height */
  292.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  293.     0,    /* each bit mutually-excludes a same-level Item */
  294.     (APTR)&IText11,    /* Item render  (IntuiText or Image or NULL) */
  295.     NULL,    /* Select render */
  296.     NULL,    /* alternate command-key */
  297.     &SubItem1,    /* SubItem list */
  298.     MENUNULL    /* filled in by Intuition for drag selections */
  299. };
  300.  
  301. struct IntuiText IText12 = {
  302.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  303.     4,1,    /* XY origin relative to container TopLeft */
  304.     NULL,    /* font pointer or NULL for default */
  305.     (UBYTE *)"Voice Bank",    /* pointer to text */
  306.     NULL    /* next IntuiText structure */
  307. };
  308.  
  309. struct MenuItem SubItem4 = {
  310.     NULL,    /* next SubItem structure */
  311.     124,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  312.     88,9,    /* hit box width and height */
  313.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  314.     0,    /* each bit mutually-excludes a same-level Item */
  315.     (APTR)&IText12,    /* Item render  (IntuiText or Image or NULL) */
  316.     NULL,    /* Select render */
  317.     NULL,    /* alternate command-key */
  318.     NULL,    /* no SubItem list for SubItems */
  319.     MENUNULL    /* filled in by Intuition for drag selections */
  320. };
  321.  
  322. struct IntuiText IText13 = {
  323.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  324.     4,1,    /* XY origin relative to container TopLeft */
  325.     NULL,    /* font pointer or NULL for default */
  326.     (UBYTE *)"DX21 DX27 DX100",    /* pointer to text */
  327.     NULL    /* next IntuiText structure */
  328. };
  329.  
  330. struct MenuItem MenuItem8 = {
  331.     &MenuItem9,    /* next MenuItem structure */
  332.     0,18,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  333.     128,9,    /* hit box width and height */
  334.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  335.     0,    /* each bit mutually-excludes a same-level Item */
  336.     (APTR)&IText13,    /* Item render  (IntuiText or Image or NULL) */
  337.     NULL,    /* Select render */
  338.     NULL,    /* alternate command-key */
  339.     &SubItem4,    /* SubItem list */
  340.     MENUNULL    /* filled in by Intuition for drag selections */
  341. };
  342.  
  343. struct IntuiText IText14 = {
  344.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  345.     4,1,    /* XY origin relative to container TopLeft */
  346.     NULL,    /* font pointer or NULL for default */
  347.     (UBYTE *)"Configuration Bank",    /* pointer to text */
  348.     NULL    /* next IntuiText structure */
  349. };
  350.  
  351. struct MenuItem SubItem6 = {
  352.     NULL,    /* next SubItem structure */
  353.     110,9,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  354.     152,9,    /* hit box width and height */
  355.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  356.     0,    /* each bit mutually-excludes a same-level Item */
  357.     (APTR)&IText14,    /* Item render  (IntuiText or Image or NULL) */
  358.     NULL,    /* Select render */
  359.     NULL,    /* alternate command-key */
  360.     NULL,    /* no SubItem list for SubItems */
  361.     MENUNULL    /* filled in by Intuition for drag selections */
  362. };
  363.  
  364. struct IntuiText IText15 = {
  365.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  366.     4,1,    /* XY origin relative to container TopLeft */
  367.     NULL,    /* font pointer or NULL for default */
  368.     (UBYTE *)"Voice Bank",    /* pointer to text */
  369.     NULL    /* next IntuiText structure */
  370. };
  371.  
  372. struct MenuItem SubItem5 = {
  373.     &SubItem6,    /* next SubItem structure */
  374.     110,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  375.     152,9,    /* hit box width and height */
  376.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  377.     0,    /* each bit mutually-excludes a same-level Item */
  378.     (APTR)&IText15,    /* Item render  (IntuiText or Image or NULL) */
  379.     NULL,    /* Select render */
  380.     NULL,    /* alternate command-key */
  381.     NULL,    /* no SubItem list for SubItems */
  382.     MENUNULL    /* filled in by Intuition for drag selections */
  383. };
  384.  
  385. struct IntuiText IText16 = {
  386.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  387.     4,1,    /* XY origin relative to container TopLeft */
  388.     NULL,    /* font pointer or NULL for default */
  389.     (UBYTE *)"FB-01",    /* pointer to text */
  390.     NULL    /* next IntuiText structure */
  391. };
  392.  
  393. struct MenuItem MenuItem7 = {
  394.     &MenuItem8,    /* next MenuItem structure */
  395.     0,9,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  396.     128,9,    /* hit box width and height */
  397.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  398.     13,    /* each bit mutually-excludes a same-level Item */
  399.     (APTR)&IText16,    /* Item render  (IntuiText or Image or NULL) */
  400.     NULL,    /* Select render */
  401.     NULL,    /* alternate command-key */
  402.     &SubItem5,    /* SubItem list */
  403.     MENUNULL    /* filled in by Intuition for drag selections */
  404. };
  405.  
  406. struct IntuiText IText17 = {
  407.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  408.     4,1,    /* XY origin relative to container TopLeft */
  409.     NULL,    /* font pointer or NULL for default */
  410.     (UBYTE *)"TX7",    /* pointer to text */
  411.     NULL    /* next IntuiText structure */
  412. };
  413.  
  414. struct MenuItem MenuItem6 = {
  415.     &MenuItem7,    /* next MenuItem structure */
  416.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  417.     128,9,    /* hit box width and height */
  418.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  419.     14,    /* each bit mutually-excludes a same-level Item */
  420.     (APTR)&IText17,    /* Item render  (IntuiText or Image or NULL) */
  421.     NULL,    /* Select render */
  422.     NULL,    /* alternate command-key */
  423.     NULL,    /* SubItem list */
  424.     MENUNULL    /* filled in by Intuition for drag selections */
  425. };
  426.  
  427. struct Menu Menu2 = {
  428.     &Menu3,    /* next Menu structure */
  429.     136,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  430.     120,0,    /* Menu hit box width and height */
  431.     MENUENABLED,    /* Menu flags */
  432.     "Dump Request",    /* text of Menu name */
  433.     &MenuItem6    /* MenuItem linked list pointer */
  434. };
  435.  
  436. struct IntuiText IText18 = {
  437.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  438.     0,1,    /* XY origin relative to container TopLeft */
  439.     NULL,    /* font pointer or NULL for default */
  440.     (UBYTE *)"Send SYS-EX File",    /* pointer to text */
  441.     NULL    /* next IntuiText structure */
  442. };
  443.  
  444. struct MenuItem MenuItem10 = {
  445.     NULL,    /* next MenuItem structure */
  446.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  447.     172,9,    /* hit box width and height */
  448.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  449.     1,    /* each bit mutually-excludes a same-level Item */
  450.     (APTR)&IText18,    /* Item render  (IntuiText or Image or NULL) */
  451.     NULL,    /* Select render */
  452.     'z',    /* alternate command-key */
  453.     NULL,    /* SubItem list */
  454.     MENUNULL    /* filled in by Intuition for drag selections */
  455. };
  456.  
  457. struct Menu Menu1 = {
  458.     &Menu2,    /* next Menu structure */
  459.     0,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  460.     129,9,    /* Menu hit box width and height */
  461.     MENUENABLED,    /* Menu flags */
  462.     "File Transmit",    /* text of Menu name */
  463.     &MenuItem10    /* MenuItem linked list pointer */
  464. };
  465.  
  466. #define MenuList1 Menu1
  467.  
  468. struct NewWindow NewWindowStructure1 = {
  469.     74,20,    /* window XY origin relative to TopLeft of screen */
  470.     264,60,    /* window width and height */
  471.     0,1,    /* detail and block pens */
  472.     GADGETUP+MENUPICK+CLOSEWINDOW+REQSET,    /* IDCMP flags */
  473.     WINDOWDRAG+WINDOWDEPTH+WINDOWCLOSE+ACTIVATE+NOCAREREFRESH,    /* other window flags */
  474.     &Gadget1,    /* first gadget in gadget list */
  475.     NULL,    /* custom CHECKMARK imagery */
  476.     (UBYTE *)"Sys-Ex Filer",    /* window title */
  477.     NULL,    /* custom screen pointer */
  478.     NULL,    /* custom bitmap */
  479.     264,60,    /* minimum width and height */
  480.     266,60,    /* maximum width and height */
  481.     WBENCHSCREEN    /* destination screen type */
  482. };
  483.  
  484.  
  485. /* end of PowerWindows source generation */
  486.