source: buchla-68k/orig/RAM/ETIVCE.C@ 4f508e6

Last change on this file since 4f508e6 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

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