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 |
|
---|
17 | #include "stdio.h"
|
---|
18 |
|
---|
19 | #define VCE_OFF 6
|
---|
20 |
|
---|
21 | extern void advicur(void);
|
---|
22 | extern void newvce(int16_t voice);
|
---|
23 |
|
---|
24 | extern void allwins(void);
|
---|
25 |
|
---|
26 | extern uint16_t *instob;
|
---|
27 |
|
---|
28 | extern int16_t stccol, curvce;
|
---|
29 |
|
---|
30 | extern int16_t idbox[][8];
|
---|
31 |
|
---|
32 | extern int8_t dspbuf[];
|
---|
33 |
|
---|
34 | /* |
---|
35 |
|
---|
36 | */
|
---|
37 |
|
---|
38 | /*
|
---|
39 | =============================================================================
|
---|
40 | et_ivce() -- load the edit buffer
|
---|
41 | =============================================================================
|
---|
42 | */
|
---|
43 |
|
---|
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 | =============================================================================
|
---|
60 | */
|
---|
61 |
|
---|
62 | int16_t ef_ivce(int16_t n)
|
---|
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
|
---|
89 | =============================================================================
|
---|
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 | =============================================================================
|
---|
112 | nd_ivce() -- handle new data entry
|
---|
113 | =============================================================================
|
---|
114 | */
|
---|
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 |
|
---|