[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 |
|
---|
| 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 "instdsp.h"
|
---|
| 16 |
|
---|
[e225e77] | 17 | #include "stdio.h"
|
---|
| 18 |
|
---|
[f40a309] | 19 | #define VCE_OFF 6
|
---|
| 20 |
|
---|
[0580615] | 21 | extern void advicur(void);
|
---|
[7258c6a] | 22 | extern void newvce(int16_t voice);
|
---|
[f40a309] | 23 |
|
---|
[e225e77] | 24 | extern void allwins(void);
|
---|
| 25 |
|
---|
[7258c6a] | 26 | extern uint16_t *instob;
|
---|
[f40a309] | 27 |
|
---|
[7258c6a] | 28 | extern int16_t stccol, curvce;
|
---|
[f40a309] | 29 |
|
---|
[7258c6a] | 30 | extern int16_t idbox[][8];
|
---|
[f40a309] | 31 |
|
---|
[7258c6a] | 32 | extern int8_t dspbuf[];
|
---|
[f40a309] | 33 |
|
---|
| 34 | /* |
---|
| 35 |
|
---|
| 36 | */
|
---|
| 37 |
|
---|
| 38 | /*
|
---|
| 39 | =============================================================================
|
---|
| 40 | et_ivce() -- load the edit buffer
|
---|
| 41 | =============================================================================
|
---|
| 42 | */
|
---|
[7258c6a] | 43 |
|
---|
[f40a309] | 44 | int16_t et_ivce(int16_t n)
|
---|
| 45 | {
|
---|
| 46 | sprintf(ebuf, "%02d", curvce + 1);
|
---|
| 47 | ebflag = TRUE;
|
---|
| 48 |
|
---|
| 49 | return(SUCCESS);
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | /* |
---|
| 53 |
|
---|
| 54 | */
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | =============================================================================
|
---|
| 58 | ef_ivce() -- parse (unload) the edit buffer
|
---|
| 59 | =============================================================================
|
---|
[7258c6a] | 60 | */
|
---|
[f40a309] | 61 |
|
---|
[7258c6a] | 62 | int16_t ef_ivce(int16_t n)
|
---|
[f40a309] | 63 | {
|
---|
| 64 | register int16_t i, tmpval;
|
---|
| 65 |
|
---|
| 66 | ebuf[2] = '\0'; /* terminate the string in ebuf */
|
---|
| 67 | ebflag = FALSE;
|
---|
| 68 |
|
---|
| 69 | tmpval = 0;
|
---|
| 70 |
|
---|
| 71 | for (i = 0; i < 2; i++) /* convert from ASCII to binary */
|
---|
| 72 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 73 |
|
---|
| 74 | if ((tmpval EQ 0) OR (tmpval GT 12))
|
---|
| 75 | return(FAILURE);
|
---|
| 76 |
|
---|
| 77 | newvce(tmpval - 1);
|
---|
| 78 | allwins();
|
---|
| 79 | return(SUCCESS);
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | /* |
---|
| 83 |
|
---|
| 84 | */
|
---|
| 85 |
|
---|
| 86 | /*
|
---|
| 87 | =============================================================================
|
---|
| 88 | rd_ivce() -- (re)display the field
|
---|
[7258c6a] | 89 | =============================================================================
|
---|
[f40a309] | 90 | */
|
---|
| 91 |
|
---|
| 92 | int16_t rd_ivce(int16_t n)
|
---|
| 93 | {
|
---|
| 94 | /* convert to ASCII */
|
---|
| 95 |
|
---|
| 96 | sprintf(dspbuf, "%02d", curvce + 1);
|
---|
| 97 |
|
---|
| 98 | vbank(0); /* display the value */
|
---|
| 99 |
|
---|
| 100 | vcputsv(instob, 64, idbox[n][4], idbox[n][5],
|
---|
| 101 | idbox[n][6], idbox[n][7] + VCE_OFF, dspbuf, 14);
|
---|
| 102 |
|
---|
| 103 | return(SUCCESS);
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | /* |
---|
| 107 |
|
---|
| 108 | */
|
---|
| 109 |
|
---|
| 110 | /*
|
---|
| 111 | =============================================================================
|
---|
[7258c6a] | 112 | nd_ivce() -- handle new data entry
|
---|
[f40a309] | 113 | =============================================================================
|
---|
[7258c6a] | 114 | */
|
---|
[f40a309] | 115 |
|
---|
| 116 | int16_t nd_ivce(int16_t n, int16_t k)
|
---|
| 117 | {
|
---|
| 118 | register int16_t ec;
|
---|
| 119 |
|
---|
| 120 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 121 | ebuf[ec] = k + '0';
|
---|
| 122 | ebuf[2] = '\0';
|
---|
| 123 |
|
---|
| 124 | dspbuf[0] = k + '0';
|
---|
| 125 | dspbuf[1] = '\0';
|
---|
| 126 |
|
---|
| 127 | vbank(0);
|
---|
| 128 |
|
---|
| 129 | vcputsv(instob, 64, ID_ENTRY, idbox[n][5],
|
---|
| 130 | idbox[n][6], stccol, dspbuf, 14);
|
---|
| 131 |
|
---|
| 132 | advicur();
|
---|
| 133 |
|
---|
| 134 | return(SUCCESS);
|
---|
| 135 | }
|
---|
| 136 |
|
---|