| [3ae31e9] | 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | etaopt.c -- assignment editor - MIDI output port number field handlers
|
|---|
| 4 | Version 4 -- 1987-12-11 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include "stddefs.h"
|
|---|
| 9 | #include "fields.h"
|
|---|
| 10 | #include "vsdd.h"
|
|---|
| 11 | #include "vsddsw.h"
|
|---|
| 12 | #include "graphdef.h"
|
|---|
| 13 |
|
|---|
| 14 | #include "midas.h"
|
|---|
| 15 | #include "asgdsp.h"
|
|---|
| 16 |
|
|---|
| 17 | extern unsigned *asgob;
|
|---|
| 18 |
|
|---|
| 19 | extern short stcrow, stccol;
|
|---|
| 20 | extern short curmop;
|
|---|
| 21 |
|
|---|
| 22 | extern short adbox[][8];
|
|---|
| 23 |
|
|---|
| 24 | extern char dspbuf[];
|
|---|
| 25 |
|
|---|
| 26 | extern char *gprep[];
|
|---|
| 27 |
|
|---|
| 28 | /* |
|---|
| 29 |
|
|---|
| 30 | */
|
|---|
| 31 |
|
|---|
| 32 | /*
|
|---|
| 33 | =============================================================================
|
|---|
| 34 | et_aopt() -- load the edit buffer
|
|---|
| 35 | =============================================================================
|
|---|
| 36 | */
|
|---|
| 37 |
|
|---|
| 38 | short
|
|---|
| 39 | et_aopt(n)
|
|---|
| 40 | short n;
|
|---|
| 41 | {
|
|---|
| 42 | sprintf(ebuf, "%01.1d", curmop);
|
|---|
| 43 | ebflag = TRUE;
|
|---|
| 44 |
|
|---|
| 45 | return(SUCCESS);
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | /*
|
|---|
| 49 | =============================================================================
|
|---|
| 50 | ef_aopt() -- parse (unload) the edit buffer
|
|---|
| 51 | =============================================================================
|
|---|
| 52 | */
|
|---|
| 53 |
|
|---|
| 54 | short
|
|---|
| 55 | ef_aopt(n)
|
|---|
| 56 | short n;
|
|---|
| 57 | {
|
|---|
| 58 | register short tmpval;
|
|---|
| 59 |
|
|---|
| 60 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
|---|
| 61 | ebflag = FALSE;
|
|---|
| 62 |
|
|---|
| 63 | tmpval = ebuf[0] - '0';
|
|---|
| 64 |
|
|---|
| 65 | if (tmpval GT 3)
|
|---|
| 66 | return(FAILURE);
|
|---|
| 67 |
|
|---|
| 68 | curmop = tmpval;
|
|---|
| 69 | modasg();
|
|---|
| 70 | return(SUCCESS);
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | /* |
|---|
| 74 |
|
|---|
| 75 | */
|
|---|
| 76 |
|
|---|
| 77 | /*
|
|---|
| 78 | =============================================================================
|
|---|
| 79 | rd_aopt() -- (re)display the field
|
|---|
| 80 | =============================================================================
|
|---|
| 81 | */
|
|---|
| 82 |
|
|---|
| 83 | short
|
|---|
| 84 | rd_aopt(nn)
|
|---|
| 85 | short nn;
|
|---|
| 86 | {
|
|---|
| 87 | register short n;
|
|---|
| 88 |
|
|---|
| 89 | n = nn & 0xFF;
|
|---|
| 90 |
|
|---|
| 91 | vbank(0);
|
|---|
| 92 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
|---|
| 93 | adbox[n][6], adbox[n][7] + 9, gprep[curmop], 14);
|
|---|
| 94 |
|
|---|
| 95 | return(SUCCESS);
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | /*
|
|---|
| 99 | =============================================================================
|
|---|
| 100 | nd_aopt() -- handle new data entry
|
|---|
| 101 | =============================================================================
|
|---|
| 102 | */
|
|---|
| 103 |
|
|---|
| 104 | short
|
|---|
| 105 | nd_aopt(nn, k)
|
|---|
| 106 | short nn;
|
|---|
| 107 | register short k;
|
|---|
| 108 | {
|
|---|
| 109 | register short n;
|
|---|
| 110 |
|
|---|
| 111 | if ((k < 1) OR (k > 2))
|
|---|
| 112 | return(FAILURE);
|
|---|
| 113 |
|
|---|
| 114 | n = nn & 0xFF;
|
|---|
| 115 | ebuf[0] = k + '0';
|
|---|
| 116 | ebuf[1] = '\0';
|
|---|
| 117 |
|
|---|
| 118 | dspbuf[0] = k + '0';
|
|---|
| 119 | dspbuf[1] = '\0';
|
|---|
| 120 |
|
|---|
| 121 | vbank(0);
|
|---|
| 122 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
|---|
| 123 |
|
|---|
| 124 | return(SUCCESS);
|
|---|
| 125 | }
|
|---|
| 126 |
|
|---|