[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 | {
|
---|
| 20 | sprintf(ebuf, "%02d", curvce + 1);
|
---|
| 21 | ebflag = TRUE;
|
---|
| 22 |
|
---|
| 23 | return(SUCCESS);
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | /* |
---|
| 27 |
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 | /*
|
---|
| 31 | =============================================================================
|
---|
| 32 | ef_ivce() -- parse (unload) the edit buffer
|
---|
| 33 | =============================================================================
|
---|
| 34 | */
|
---|
[7258c6a] | 35 |
|
---|
[f40a309] | 36 | int16_t ef_ivce(int16_t n)
|
---|
[7258c6a] | 37 | {
|
---|
[f40a309] | 38 | register int16_t i, tmpval;
|
---|
| 39 |
|
---|
| 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 | */
|
---|
| 59 |
|
---|
| 60 | /*
|
---|
| 61 | =============================================================================
|
---|
| 62 | rd_ivce() -- (re)display the field
|
---|
| 63 | =============================================================================
|
---|
[7258c6a] | 64 | */
|
---|
[f40a309] | 65 |
|
---|
| 66 | int16_t rd_ivce(int16_t n)
|
---|
| 67 | {
|
---|
| 68 | /* convert to ASCII */
|
---|
| 69 |
|
---|
| 70 | sprintf(dspbuf, "%02d", curvce + 1);
|
---|
| 71 |
|
---|
| 72 | vbank(0); /* display the value */
|
---|
| 73 |
|
---|
| 74 | vcputsv(instob, 64, idbox[n][4], idbox[n][5],
|
---|
| 75 | idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
|
---|
| 76 |
|
---|
| 77 | return(SUCCESS);
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | /* |
---|
| 81 |
|
---|
| 82 | */
|
---|
| 83 |
|
---|
| 84 | /*
|
---|
| 85 | =============================================================================
|
---|
| 86 | nd_ivce() -- handle new data entry
|
---|
[7258c6a] | 87 | =============================================================================
|
---|
[f40a309] | 88 | */
|
---|
[7258c6a] | 89 |
|
---|
[f40a309] | 90 | int16_t nd_ivce(int16_t n, int16_t k)
|
---|
| 91 | {
|
---|
| 92 | register int16_t ec;
|
---|
| 93 |
|
---|
| 94 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 95 | ebuf[ec] = k + '0';
|
---|
| 96 | ebuf[2] = '\0';
|
---|
| 97 |
|
---|
| 98 | dspbuf[0] = k + '0';
|
---|
| 99 | dspbuf[1] = '\0';
|
---|
| 100 |
|
---|
| 101 | vbank(0);
|
---|
| 102 |
|
---|
| 103 | vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
|
---|
| 104 | idbox[n][6], stccol, dspbuf, 14);
|
---|
| 105 |
|
---|
| 106 | advicur();
|
---|
| 107 |
|
---|
[6262b5c] | 108 | return(SUCCESS);
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 |
|
---|