[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etaccn.c -- assignment editor - source controller number field handlers
|
---|
| 4 | Version 7 -- 1988-03-19 -- 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 char *numblk();
|
---|
| 18 |
|
---|
| 19 | extern unsigned *asgob;
|
---|
| 20 |
|
---|
| 21 | extern short stcrow, stccol;
|
---|
| 22 |
|
---|
| 23 | extern short adbox[][8];
|
---|
| 24 |
|
---|
| 25 | extern char dspbuf[];
|
---|
| 26 |
|
---|
| 27 | extern short mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
|
---|
| 28 |
|
---|
| 29 | /* |
---|
| 30 |
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | /*
|
---|
| 34 | =============================================================================
|
---|
| 35 | et_accn() -- load the edit buffer
|
---|
| 36 | =============================================================================
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 39 | short
|
---|
| 40 | et_accn(n)
|
---|
| 41 | short n;
|
---|
| 42 | {
|
---|
| 43 | register short ctl;
|
---|
| 44 |
|
---|
| 45 | char buf[4];
|
---|
| 46 |
|
---|
| 47 | ctl = 0x00FF & (n >> 8);
|
---|
| 48 |
|
---|
| 49 | numblk(ebuf, (mctlnum[ctl] & 0x00FF));
|
---|
| 50 | ebflag = TRUE;
|
---|
| 51 |
|
---|
| 52 | return(SUCCESS);
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | /*
|
---|
| 56 | =============================================================================
|
---|
| 57 | ef_accn() -- parse (unload) the edit buffer
|
---|
| 58 | =============================================================================
|
---|
| 59 | */
|
---|
| 60 |
|
---|
| 61 | short
|
---|
| 62 | ef_accn(n)
|
---|
| 63 | short n;
|
---|
| 64 | {
|
---|
| 65 | register short tmpval, ctl, i;
|
---|
| 66 |
|
---|
| 67 | ctl = 0x00FF & (n >> 8);
|
---|
| 68 |
|
---|
| 69 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 70 | ebflag = FALSE;
|
---|
| 71 | tmpval = 0;
|
---|
| 72 |
|
---|
| 73 | if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
|
---|
| 74 |
|
---|
| 75 | tmpval = -1;
|
---|
| 76 |
|
---|
| 77 | } else {
|
---|
| 78 |
|
---|
| 79 | for (i = 0; i < 2; i++) {
|
---|
| 80 |
|
---|
| 81 | if (ebuf[i] EQ ' ')
|
---|
| 82 | ebuf[i] = '0';
|
---|
| 83 |
|
---|
| 84 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 85 | }
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 | if (mctlnum[ctl] EQ -1)
|
---|
| 89 | mctlnum[ctl] = tmpval;
|
---|
| 90 | else
|
---|
| 91 | mctlnum[ctl] = (mctlnum[ctl] & 0xFF00) | tmpval;
|
---|
| 92 |
|
---|
| 93 | modasg();
|
---|
| 94 | return(SUCCESS);
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | /* |
---|
| 98 |
|
---|
| 99 | */
|
---|
| 100 |
|
---|
| 101 | /*
|
---|
| 102 | =============================================================================
|
---|
| 103 | rd_accn() -- (re)display the field
|
---|
| 104 | =============================================================================
|
---|
| 105 | */
|
---|
| 106 |
|
---|
| 107 | short
|
---|
| 108 | rd_accn(nn)
|
---|
| 109 | short nn;
|
---|
| 110 | {
|
---|
| 111 | register short n, ctl;
|
---|
| 112 | char buf[4];
|
---|
| 113 |
|
---|
| 114 | n = 0x00FF & nn;
|
---|
| 115 | ctl = 0x00FF & (nn >> 8);
|
---|
| 116 |
|
---|
| 117 | vbank(0);
|
---|
| 118 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 119 | cfetp->frow, cfetp->flcol,
|
---|
| 120 | numblk(buf, (mctlnum[ctl] & 0x00FF)), 14);
|
---|
| 121 |
|
---|
| 122 | return(SUCCESS);
|
---|
| 123 | }
|
---|
| 124 |
|
---|
| 125 | /* |
---|
| 126 |
|
---|
| 127 | */
|
---|
| 128 |
|
---|
| 129 | /*
|
---|
| 130 | =============================================================================
|
---|
| 131 | nd_accn() -- handle new data entry
|
---|
| 132 | =============================================================================
|
---|
| 133 | */
|
---|
| 134 |
|
---|
| 135 | short
|
---|
| 136 | nd_accn(nn, k)
|
---|
| 137 | short nn;
|
---|
| 138 | register short k;
|
---|
| 139 | {
|
---|
| 140 | register short n;
|
---|
| 141 |
|
---|
| 142 | n = nn & 0xFF;
|
---|
| 143 | ebuf[stccol - cfetp->flcol] = k + '0';
|
---|
| 144 | ebuf[2] = '\0';
|
---|
| 145 |
|
---|
| 146 | dspbuf[0] = k + '0';
|
---|
| 147 | dspbuf[1] = '\0';
|
---|
| 148 |
|
---|
| 149 | vbank(0);
|
---|
| 150 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
|
---|
| 151 | stcrow, stccol, dspbuf, 14);
|
---|
| 152 |
|
---|
| 153 | advacur();
|
---|
| 154 | return(SUCCESS);
|
---|
| 155 | }
|
---|
| 156 |
|
---|