[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etivce.c -- instrument editor - voice number field handlers
|
---|
| 4 | Version 12 -- 1987-12-09 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[e225e77] | 9 |
|
---|
[f40a309] | 10 | #define VCE_OFF 6
|
---|
| 11 |
|
---|
| 12 | /*
|
---|
| 13 | =============================================================================
|
---|
| 14 | et_ivce() -- load the edit buffer
|
---|
| 15 | =============================================================================
|
---|
| 16 | */
|
---|
| 17 |
|
---|
[7258c6a] | 18 | int16_t et_ivce(int16_t n)
|
---|
[f40a309] | 19 | {
|
---|
[7ecfb7b] | 20 | (void)n;
|
---|
| 21 |
|
---|
[f40a309] | 22 | sprintf(ebuf, "%02d", curvce + 1);
|
---|
| 23 | ebflag = TRUE;
|
---|
| 24 |
|
---|
| 25 | return(SUCCESS);
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | /*
|
---|
| 29 | =============================================================================
|
---|
| 30 | ef_ivce() -- parse (unload) the edit buffer
|
---|
| 31 | =============================================================================
|
---|
| 32 | */
|
---|
| 33 |
|
---|
[7258c6a] | 34 | int16_t ef_ivce(int16_t n)
|
---|
[f40a309] | 35 | {
|
---|
[7258c6a] | 36 | register int16_t i, tmpval;
|
---|
[f40a309] | 37 |
|
---|
[7ecfb7b] | 38 | (void)n;
|
---|
| 39 |
|
---|
[f40a309] | 40 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 41 | ebflag = FALSE;
|
---|
| 42 |
|
---|
| 43 | tmpval = 0;
|
---|
| 44 |
|
---|
| 45 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 46 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 47 |
|
---|
| 48 | if ((tmpval EQ 0) OR (tmpval GT 12))
|
---|
| 49 | return(FAILURE);
|
---|
| 50 |
|
---|
| 51 | newvce(tmpval - 1);
|
---|
| 52 | allwins();
|
---|
| 53 | return(SUCCESS);
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | =============================================================================
|
---|
| 58 | rd_ivce() -- (re)display the field
|
---|
| 59 | =============================================================================
|
---|
| 60 | */
|
---|
| 61 |
|
---|
[7258c6a] | 62 | int16_t rd_ivce(int16_t n)
|
---|
[f40a309] | 63 | {
|
---|
| 64 | /* convert to ASCII */
|
---|
| 65 |
|
---|
| 66 | sprintf(dspbuf, "%02d", curvce + 1);
|
---|
| 67 |
|
---|
| 68 | vbank(0); /* display the value */
|
---|
| 69 |
|
---|
| 70 | vcputsv(instob, 64, idbox[n][4], idbox[n][5],
|
---|
| 71 | idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
|
---|
| 72 |
|
---|
| 73 | return(SUCCESS);
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | /*
|
---|
| 77 | =============================================================================
|
---|
| 78 | nd_ivce() -- handle new data entry
|
---|
| 79 | =============================================================================
|
---|
| 80 | */
|
---|
| 81 |
|
---|
[7258c6a] | 82 | int16_t nd_ivce(int16_t n, int16_t k)
|
---|
[f40a309] | 83 | {
|
---|
[7258c6a] | 84 | register int16_t ec;
|
---|
[f40a309] | 85 |
|
---|
| 86 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 87 | ebuf[ec] = k + '0';
|
---|
| 88 | ebuf[2] = '\0';
|
---|
| 89 |
|
---|
| 90 | dspbuf[0] = k + '0';
|
---|
| 91 | dspbuf[1] = '\0';
|
---|
| 92 |
|
---|
| 93 | vbank(0);
|
---|
| 94 |
|
---|
| 95 | vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
|
---|
| 96 | idbox[n][6], stccol, dspbuf, 14);
|
---|
| 97 |
|
---|
| 98 | advicur();
|
---|
| 99 |
|
---|
| 100 | return(SUCCESS);
|
---|
| 101 | }
|
---|
| 102 |
|
---|
[6262b5c] | 103 |
|
---|