1 | /*
|
---|
2 | =============================================================================
|
---|
3 | scselbx.c -- MIDAS-VII -- score editor box selection functions
|
---|
4 | Version 87 -- 1989-11-15 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "stddefs.h"
|
---|
9 | #include "hwdefs.h"
|
---|
10 | #include "fields.h"
|
---|
11 | #include "vsdd.h"
|
---|
12 | #include "vsddvars.h"
|
---|
13 | #include "glcfns.h"
|
---|
14 | #include "glcdefs.h"
|
---|
15 | #include "graphdef.h"
|
---|
16 | #include "lcdline.h"
|
---|
17 | #include "panel.h"
|
---|
18 | #include "score.h"
|
---|
19 | #include "scfns.h"
|
---|
20 | #include "sclock.h"
|
---|
21 | #include "slice.h"
|
---|
22 | #include "secops.h"
|
---|
23 | #include "secdefs.h"
|
---|
24 | #include "macros.h"
|
---|
25 |
|
---|
26 | #include "midas.h"
|
---|
27 | #include "asgdsp.h"
|
---|
28 | #include "scdsp.h"
|
---|
29 |
|
---|
30 | #include "memory.h"
|
---|
31 | #include "stdio.h"
|
---|
32 | #include "strings.h"
|
---|
33 | #include "vsddsw.h"
|
---|
34 |
|
---|
35 | /* functions defined elsewhere */
|
---|
36 |
|
---|
37 | extern int16_t entbh(int16_t n);
|
---|
38 | extern void advscur(void);
|
---|
39 | extern int16_t oktode(struct s_entry *ep);
|
---|
40 | extern void nokey(void);
|
---|
41 |
|
---|
42 | /* |
---|
43 |
|
---|
44 | */
|
---|
45 |
|
---|
46 | /* variables defined elsewhere */
|
---|
47 |
|
---|
48 | extern void (*itxput)(int16_t row, int16_t col, int8_t *txt, int16_t tag);
|
---|
49 | extern void (*point)(int16_t x, int16_t y, int16_t pen);
|
---|
50 |
|
---|
51 | extern int16_t ancmsw;
|
---|
52 | extern int16_t angroup;
|
---|
53 | extern int16_t asmode;
|
---|
54 | extern int16_t clkrun;
|
---|
55 | extern int16_t clkctl;
|
---|
56 | extern int16_t clksrc;
|
---|
57 | extern int16_t ctrsw;
|
---|
58 | extern int16_t cxval;
|
---|
59 | extern int16_t cyval;
|
---|
60 | extern int16_t dubsw;
|
---|
61 | extern int16_t gomode;
|
---|
62 | extern int16_t grptran;
|
---|
63 | extern int16_t gtmsel;
|
---|
64 | extern int16_t hitbox;
|
---|
65 | extern int16_t hitcx;
|
---|
66 | extern int16_t hitcy;
|
---|
67 | extern int16_t insmode;
|
---|
68 | extern int16_t ismode;
|
---|
69 | extern int16_t lastam;
|
---|
70 | extern int16_t midiclk;
|
---|
71 | extern int16_t noteop;
|
---|
72 | extern int16_t notesel;
|
---|
73 | extern int16_t oldpk;
|
---|
74 | extern int16_t oldsl;
|
---|
75 | extern int16_t pchsw;
|
---|
76 | extern int16_t pkctrl;
|
---|
77 | extern int16_t pulsclk;
|
---|
78 | extern int16_t recsw;
|
---|
79 | extern int16_t scmctl;
|
---|
80 | extern int16_t sdmcol;
|
---|
81 | extern int16_t sdmctl;
|
---|
82 | extern int16_t sdmrow;
|
---|
83 | extern int16_t secop;
|
---|
84 | extern int16_t sgoflag;
|
---|
85 | extern int16_t sliders;
|
---|
86 | extern int16_t stccol;
|
---|
87 | extern int16_t stcrow;
|
---|
88 | extern int16_t stepclk;
|
---|
89 | extern int16_t stepenb;
|
---|
90 | extern int16_t submenu;
|
---|
91 | extern int16_t velflag;
|
---|
92 | extern int16_t vtccol;
|
---|
93 | extern int16_t vtcrow;
|
---|
94 |
|
---|
95 | /* |
---|
96 |
|
---|
97 | */
|
---|
98 |
|
---|
99 | extern int16_t grptmap[];
|
---|
100 |
|
---|
101 | extern int16_t sctctab[][64];
|
---|
102 |
|
---|
103 | extern struct asgent asgtab[];
|
---|
104 |
|
---|
105 | extern struct selbox *csbp;
|
---|
106 | extern struct selbox *curboxp;
|
---|
107 |
|
---|
108 | extern struct s_time stimes[N_SCORES][N_SECTS]; /* section times */
|
---|
109 |
|
---|
110 | extern uint16_t *obj8, *obj11;
|
---|
111 |
|
---|
112 | extern LPF (*swpt)[];
|
---|
113 | extern LPF (*oldsw)[];
|
---|
114 | extern LPF t_ngrp[];
|
---|
115 |
|
---|
116 | extern int8_t bfs[];
|
---|
117 | extern int8_t tunname[][32];
|
---|
118 |
|
---|
119 | extern struct gdsel *gdstbc[];
|
---|
120 |
|
---|
121 | /* forward references */
|
---|
122 |
|
---|
123 | int16_t sdboxfn(int16_t n);
|
---|
124 | void bspscur(void);
|
---|
125 | void svtdsp(uint16_t *obj, uint16_t fg, uint16_t bg, int16_t row, int16_t col, int8_t *buf);
|
---|
126 | void svtstop(void);
|
---|
127 | void sdmenu(int16_t n);
|
---|
128 |
|
---|
129 | extern int16_t infield(int16_t row, int16_t col, struct fet *fetp);
|
---|
130 | extern int16_t sc_refr(int32_t t);
|
---|
131 | extern int16_t sec_cpy(int16_t ns);
|
---|
132 | extern int16_t sec_dev(int16_t ns);
|
---|
133 | extern int16_t sec_dgr(int16_t ns);
|
---|
134 | extern int16_t sec_grp(int16_t ns);
|
---|
135 | extern int16_t sec_mov(int16_t ns);
|
---|
136 | extern int16_t sec_mrg(int16_t ns);
|
---|
137 | extern int16_t sec_rmv(int16_t ns);
|
---|
138 | extern int16_t vtyper(void);
|
---|
139 | extern uint16_t exp_c(uint16_t c);
|
---|
140 | extern void dnedmod(void);
|
---|
141 | extern void donote(void);
|
---|
142 | extern void ds_vmod(void);
|
---|
143 | extern void dsclk(void);
|
---|
144 | extern void dsimode(void);
|
---|
145 | extern void dsrpmod(void);
|
---|
146 | extern void icancel(void);
|
---|
147 | extern void istart(void);
|
---|
148 | extern void lcdlbls(void);
|
---|
149 | extern void scupd(void);
|
---|
150 | extern void sdwin(int16_t n);
|
---|
151 | extern void se_disp(struct s_entry *ep, int16_t sd, struct gdsel *gdstb[], int16_t cf);
|
---|
152 | extern void setleds(void);
|
---|
153 | extern void showim(void);
|
---|
154 | extern void stcclr(void);
|
---|
155 | extern void stcpos(int16_t row, int16_t col);
|
---|
156 | extern void stcset(void);
|
---|
157 | extern void ttcpos(int16_t row, int16_t col);
|
---|
158 | extern void vputa(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t attrib);
|
---|
159 | extern void vtsetup(uint16_t *obj, int16_t (*dsp)(), int16_t col, int8_t *ptr, int16_t tr, int16_t tc, int16_t (*adv)(), int16_t (*bsp)(), int16_t (*cup)(), int16_t (*cdn)(), int16_t (*stop)(), uint16_t fg, uint16_t bg);
|
---|
160 |
|
---|
161 | /* |
---|
162 |
|
---|
163 | */
|
---|
164 |
|
---|
165 | int8_t *sdmenus[][3] = { /* score display menus */
|
---|
166 |
|
---|
167 | /* 0 - typewriter */
|
---|
168 |
|
---|
169 | {" ABCDEFGHIJKLMNOPQRSTUVWXYZ | ",
|
---|
170 | " abcdefghijklmnopqrstuvwxyz -*- ",
|
---|
171 | " 0123456789+-/*().,:;!?&<> | "},
|
---|
172 |
|
---|
173 | /* 1 - note edit */
|
---|
174 |
|
---|
175 | {" Begin Acc Move Note Escape ",
|
---|
176 | " Begin Nat Move Begin ",
|
---|
177 | " End Note Move End "},
|
---|
178 |
|
---|
179 | /* 2 - clock source */
|
---|
180 |
|
---|
181 | {" Local PLS24 Step ",
|
---|
182 | " MIDI PLS48 ",
|
---|
183 | " SMPTE PLS96 "},
|
---|
184 |
|
---|
185 | /* 3 - clock control */
|
---|
186 |
|
---|
187 | {" Local ",
|
---|
188 | " MIDI ",
|
---|
189 | " SMPTE "},
|
---|
190 |
|
---|
191 | /* 4 - Section menu */
|
---|
192 |
|
---|
193 | {" GoTo Move SMPTE ",
|
---|
194 | " Begin Copy Del Gr ",
|
---|
195 | " End Merge Del Ev "}
|
---|
196 | };
|
---|
197 |
|
---|
198 | int8_t sdmln3[] =
|
---|
199 | " ReGrp Remove Trn S ";
|
---|
200 |
|
---|
201 | int8_t sdmln4[] =
|
---|
202 | "Escape D ";
|
---|
203 |
|
---|
204 | /* |
---|
205 |
|
---|
206 | */
|
---|
207 |
|
---|
208 | int16_t sdmht[][3] = { /* score section menu highlight table */
|
---|
209 |
|
---|
210 | /* row, lcol, rcol */
|
---|
211 |
|
---|
212 | { 6, 0, 0}, /* 0 - SOP_NUL */
|
---|
213 | { 3, 1, 4}, /* 1 - SOP_GO */
|
---|
214 | { 4, 1, 5}, /* 2 - SOP_BGN */
|
---|
215 | { 5, 1, 3}, /* 3 - SOP_END */
|
---|
216 | { 3, 8, 11}, /* 4 - SOP_MOV */
|
---|
217 | { 4, 8, 11}, /* 5 - SOP_CPY */
|
---|
218 | { 5, 8, 12}, /* 6 - SOP_MRG */
|
---|
219 | { 3, 15, 19}, /* 7 - SOP_STC */
|
---|
220 | { 4, 15, 23}, /* 8 - SOP_DGR */
|
---|
221 | { 5, 15, 23}, /* 9 - SOP_DEV */
|
---|
222 | { 6, 15, 20}, /* 10 - SOP_RMV */
|
---|
223 | { 6, 8, 12} /* 11 - SOP_GRP */
|
---|
224 | };
|
---|
225 |
|
---|
226 | int16_t sdmlim[][4] = { /* score display menu cursor limits */
|
---|
227 |
|
---|
228 | /* top, left, bottom, right */
|
---|
229 |
|
---|
230 | { 19, 1, 21, 30 }, /* 0 - typewriter */
|
---|
231 | { 19, 1, 21, 30 }, /* 1 - note edit */
|
---|
232 | { 19, 1, 21, 20 }, /* 2 - clock source */
|
---|
233 | { 19, 1, 21, 19 }, /* 3 - clock control */
|
---|
234 | { 19, 1, 23, 62 } /* 4 - section menu */
|
---|
235 | };
|
---|
236 |
|
---|
237 | /* |
---|
238 |
|
---|
239 | */
|
---|
240 |
|
---|
241 | int8_t *nedlbl[] = { /* note edit function labels */
|
---|
242 |
|
---|
243 | "Note Edit", /* 0 - NOP_NUL */
|
---|
244 | "Begin Acc", /* 1 - NOP_ACC */
|
---|
245 | "Begin Nat", /* 2 - NOP_NAT */
|
---|
246 | "End Note ", /* 3 - NOP_END */
|
---|
247 | "Move Note", /* 4 - NOP_MVN */
|
---|
248 | "Move Beg ", /* 5 - NOP_MVB */
|
---|
249 | "Move End " /* 6 - NOP_MVE */
|
---|
250 | };
|
---|
251 |
|
---|
252 | /* |
---|
253 |
|
---|
254 | */
|
---|
255 |
|
---|
256 | struct selbox sdboxes[] = {
|
---|
257 |
|
---|
258 | { 0, 0, 175, 13, 0, sdboxfn}, /* 0 - Sec, Beat, Frame */
|
---|
259 | {176, 0, 231, 13, 1, sdboxfn}, /* 1 - Insert */
|
---|
260 | {232, 0, 439, 13, 2, sdboxfn}, /* 2 - Clock */
|
---|
261 | {440, 0, 511, 13, 3, sdboxfn}, /* 3 - Note Edit */
|
---|
262 |
|
---|
263 | { 0, 238, 111, 251, 4, sdboxfn}, /* 4 - Assignment */
|
---|
264 | {112, 238, 167, 251, 5, sdboxfn}, /* 5 - Tune */
|
---|
265 | {168, 238, 247, 251, 6, entbh}, /* 6 - Tempo */
|
---|
266 | {248, 238, 319, 251, 7, entbh}, /* 7 - Interpolate */
|
---|
267 | {320, 238, 398, 251, 8, sdboxfn}, /* 8 - Stop/Next */
|
---|
268 | {400, 238, 455, 251, 9, sdboxfn}, /* 9 - In/Out */
|
---|
269 | {456, 238, 511, 251, 10, sdboxfn}, /* 10 - Output */
|
---|
270 |
|
---|
271 | { 0, 252, 511, 307, 11, sdboxfn}, /* 11 - Grp, Trns, Dyn, Vel */
|
---|
272 |
|
---|
273 | { 0, 308, 511, 335, 12, sdboxfn}, /* 12 - Ansrc, Anval */
|
---|
274 |
|
---|
275 | { 0, 336, 215, 349, 13, sdboxfn}, /* 13 - Score Title */
|
---|
276 | {216, 336, 455, 349, 14, sdboxfn}, /* 14 - Rec Mode */
|
---|
277 | {456, 336, 511, 349, 15, sdboxfn}, /* 15 - Memory */
|
---|
278 |
|
---|
279 | { 0, 14, 511, 237, 16, sdboxfn}, /* 16 - Note Display */
|
---|
280 |
|
---|
281 | { 0, 0, 0, 0, 0, FN_NULL} /* end of table */
|
---|
282 | };
|
---|
283 |
|
---|
284 | /* |
---|
285 |
|
---|
286 | */
|
---|
287 |
|
---|
288 | /*
|
---|
289 | =============================================================================
|
---|
290 | insect() -- return section number pointed to in section menu, or -1
|
---|
291 | =============================================================================
|
---|
292 | */
|
---|
293 |
|
---|
294 | int16_t insect(void)
|
---|
295 | {
|
---|
296 | register int16_t col;
|
---|
297 |
|
---|
298 | col = vtccol - 24;
|
---|
299 |
|
---|
300 | if (col < 0)
|
---|
301 | return(-1);
|
---|
302 |
|
---|
303 | sgoflag = col & 3;
|
---|
304 |
|
---|
305 | if ((vtcrow < 19) OR (vtcrow > 20))
|
---|
306 | return(-1);
|
---|
307 |
|
---|
308 | return((col >> 2) + (10 * (vtcrow - 19)));
|
---|
309 | }
|
---|
310 |
|
---|
311 | /*
|
---|
312 | =============================================================================
|
---|
313 | svtdsp() -- display data for the virtual typewriter
|
---|
314 | =============================================================================
|
---|
315 | */
|
---|
316 |
|
---|
317 | void svtdsp(uint16_t *obj, uint16_t fg, uint16_t bg, int16_t row, int16_t col, int8_t *buf)
|
---|
318 | {
|
---|
319 | if (v_regs[5] & 0x0180)
|
---|
320 | vbank(0);
|
---|
321 |
|
---|
322 | vputs(obj, row - 16, col, buf, SDW13ATR);
|
---|
323 | }
|
---|
324 |
|
---|
325 | /* |
---|
326 |
|
---|
327 | */
|
---|
328 |
|
---|
329 | /*
|
---|
330 | =============================================================================
|
---|
331 | svtstop() -- end vitrual typewriter data entry
|
---|
332 | =============================================================================
|
---|
333 | */
|
---|
334 |
|
---|
335 | void svtstop(void)
|
---|
336 | {
|
---|
337 | sdmenu(-1);
|
---|
338 | }
|
---|
339 |
|
---|
340 | /*
|
---|
341 | =============================================================================
|
---|
342 | bspscur() -- backspace the score display text cursor
|
---|
343 | =============================================================================
|
---|
344 | */
|
---|
345 |
|
---|
346 | void bspscur(void)
|
---|
347 | {
|
---|
348 | register int16_t newcol;
|
---|
349 |
|
---|
350 | if (infield(stcrow, stccol, curfet))
|
---|
351 | cfetp = infetp;
|
---|
352 | else
|
---|
353 | return;
|
---|
354 |
|
---|
355 | newcol = stccol - 1;
|
---|
356 |
|
---|
357 | if (newcol GE cfetp->flcol)
|
---|
358 | stcpos(stcrow, newcol);
|
---|
359 |
|
---|
360 | cxval = CTOX(stccol);
|
---|
361 | cyval = RTOY(stcrow);
|
---|
362 | }
|
---|
363 |
|
---|
364 | /* |
---|
365 |
|
---|
366 | */
|
---|
367 |
|
---|
368 | /*
|
---|
369 | =============================================================================
|
---|
370 | dsects() -- display list of section numbers
|
---|
371 | Highlight active sections and indicate SMPTE time-coded sections.
|
---|
372 | =============================================================================
|
---|
373 | */
|
---|
374 |
|
---|
375 | void dsects(void)
|
---|
376 | {
|
---|
377 | register int16_t atr, row, col, i, j;
|
---|
378 | int8_t buf[8];
|
---|
379 | int8_t cl, cr, csl, csr;
|
---|
380 | int16_t begun;
|
---|
381 |
|
---|
382 | register struct s_entry *sp;
|
---|
383 |
|
---|
384 | if (v_regs[5] & 0x0180)
|
---|
385 | vbank(0);
|
---|
386 |
|
---|
387 | row = 3;
|
---|
388 |
|
---|
389 | for (i = 0; i < N_SECTS; i += 10) {
|
---|
390 |
|
---|
391 | col = 24;
|
---|
392 |
|
---|
393 | for (j = 0; j < 10; j++) {
|
---|
394 |
|
---|
395 | if (stimes[curscor][i + j].sflags) { /* SMPTE time */
|
---|
396 |
|
---|
397 | csl = '[';
|
---|
398 | csr = ']';
|
---|
399 |
|
---|
400 | } else { /* no SMPTE time */
|
---|
401 |
|
---|
402 | csl = '{';
|
---|
403 | csr = '}';
|
---|
404 | }
|
---|
405 |
|
---|
406 | cl = ' ';
|
---|
407 | cr = ' ';
|
---|
408 |
|
---|
409 | if (E_NULL NE seclist[curscor][i + j]) {
|
---|
410 |
|
---|
411 | begun = TRUE;
|
---|
412 | atr = (SDBGMM | (SD_CHNG << 4));
|
---|
413 | cl = csl;
|
---|
414 |
|
---|
415 | } else {
|
---|
416 |
|
---|
417 | begun = FALSE;
|
---|
418 | atr = SDMENUBG;
|
---|
419 | }
|
---|
420 |
|
---|
421 | sp = hplist[curscor][EH_SEND];
|
---|
422 |
|
---|
423 | while (sp) {
|
---|
424 |
|
---|
425 | if (sp->e_data1 EQ (i + j)) {
|
---|
426 |
|
---|
427 | cr = begun ? csr : '}';
|
---|
428 | break;
|
---|
429 | }
|
---|
430 |
|
---|
431 | sp = sp->e_up;
|
---|
432 | }
|
---|
433 |
|
---|
434 | sprintf(buf, "%c%02d%c", cl, 1 + (i + j), cr);
|
---|
435 |
|
---|
436 | vputs(obj8, row, col, buf, atr);
|
---|
437 | col += 4;
|
---|
438 | }
|
---|
439 |
|
---|
440 | ++row;
|
---|
441 | }
|
---|
442 | }
|
---|
443 |
|
---|
444 | /* |
---|
445 |
|
---|
446 | */
|
---|
447 |
|
---|
448 | /*
|
---|
449 | =============================================================================
|
---|
450 | dsgtmn() -- display group map source group number
|
---|
451 | =============================================================================
|
---|
452 | */
|
---|
453 |
|
---|
454 | void dsgtmn(int16_t n, int16_t f)
|
---|
455 | {
|
---|
456 | int8_t buf[4];
|
---|
457 | int16_t atr, col;
|
---|
458 |
|
---|
459 | sprintf(buf, "%02d", n + 1);
|
---|
460 |
|
---|
461 | col = (3 * n) + 28;
|
---|
462 | atr = f ? (SDBGMM | (SD_CHNG <<4)) : SDMENUBG;
|
---|
463 |
|
---|
464 | if (v_regs[5] & 0x0180)
|
---|
465 | vbank(0);
|
---|
466 |
|
---|
467 | vputs(obj8, 6, col, buf, atr);
|
---|
468 | }
|
---|
469 |
|
---|
470 | /*
|
---|
471 | =============================================================================
|
---|
472 | dsgtme() -- display group map destination group number
|
---|
473 | =============================================================================
|
---|
474 | */
|
---|
475 |
|
---|
476 | void dsgtme(int16_t n)
|
---|
477 | {
|
---|
478 | int8_t buf[4];
|
---|
479 | int16_t col;
|
---|
480 |
|
---|
481 | if (grptmap[n] EQ -1)
|
---|
482 | strcpy(buf, " ");
|
---|
483 | else
|
---|
484 | sprintf(buf, "%02d", grptmap[n] + 1);
|
---|
485 |
|
---|
486 | col = (3 * n) + 28;
|
---|
487 |
|
---|
488 | if (v_regs[5] & 0x0180)
|
---|
489 | vbank(0);
|
---|
490 |
|
---|
491 | vputs(obj8, 7, col, buf, SDMENUBG);
|
---|
492 | }
|
---|
493 |
|
---|
494 | /* |
---|
495 |
|
---|
496 | */
|
---|
497 |
|
---|
498 | /*
|
---|
499 | =============================================================================
|
---|
500 | dsgtmap() -- display group map and transposition value
|
---|
501 | =============================================================================
|
---|
502 | */
|
---|
503 |
|
---|
504 | void dsgtmap(void)
|
---|
505 | {
|
---|
506 | int8_t buf[6];
|
---|
507 | register int16_t i;
|
---|
508 |
|
---|
509 | if (v_regs[5] & 0x0180)
|
---|
510 | vbank(0);
|
---|
511 |
|
---|
512 | sprintf(buf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
|
---|
513 |
|
---|
514 | vputs(obj8, 7, 22, buf, SDMENUBG);
|
---|
515 |
|
---|
516 | for (i = 0; i < 12; i++) {
|
---|
517 |
|
---|
518 | dsgtmn(i, gtmsel EQ i);
|
---|
519 | dsgtme(i);
|
---|
520 | }
|
---|
521 | }
|
---|
522 |
|
---|
523 | /*
|
---|
524 | =============================================================================
|
---|
525 | ingroup() -- return group number selected
|
---|
526 | =============================================================================
|
---|
527 | */
|
---|
528 |
|
---|
529 | int16_t ingroup(void)
|
---|
530 | {
|
---|
531 | register int16_t col;
|
---|
532 |
|
---|
533 | col = vtccol - 28;
|
---|
534 |
|
---|
535 | if (col < 0)
|
---|
536 | return(-1);
|
---|
537 |
|
---|
538 | if (2 EQ (col % 3))
|
---|
539 | return(-1);
|
---|
540 |
|
---|
541 | return(col / 3);
|
---|
542 | }
|
---|
543 |
|
---|
544 | /* |
---|
545 |
|
---|
546 | */
|
---|
547 |
|
---|
548 | /*
|
---|
549 | =============================================================================
|
---|
550 | sdmtxt() -- output text to the score area submenu
|
---|
551 | =============================================================================
|
---|
552 | */
|
---|
553 |
|
---|
554 | void sdmtxt(int16_t row, int16_t col, int8_t *txt, int16_t tag)
|
---|
555 | {
|
---|
556 | if ((v_regs[5] & 0x0180) NE 0x0100)
|
---|
557 | vbank(1);
|
---|
558 |
|
---|
559 | vcputsv(obj11, 64, SD_TEXT, SDBG16, row, col, txt, 14);
|
---|
560 | }
|
---|
561 |
|
---|
562 | /* |
---|
563 |
|
---|
564 | */
|
---|
565 |
|
---|
566 | /*
|
---|
567 | =============================================================================
|
---|
568 | showam() -- show menu of assignments
|
---|
569 | =============================================================================
|
---|
570 | */
|
---|
571 |
|
---|
572 | void showam(int16_t asg)
|
---|
573 | {
|
---|
574 | register int16_t col, na, row;
|
---|
575 |
|
---|
576 | if (asg EQ 1)
|
---|
577 | na = 48;
|
---|
578 | else
|
---|
579 | na = NASGS;
|
---|
580 |
|
---|
581 | for (col = 2; col < 60; col += 15) {
|
---|
582 |
|
---|
583 | if (asg GE na)
|
---|
584 | return;
|
---|
585 |
|
---|
586 | (*itxput)(0, col, "No Assignment", 0);
|
---|
587 |
|
---|
588 | for (row = 1; row < 15; row++) {
|
---|
589 |
|
---|
590 | if (asg GE na)
|
---|
591 | return;
|
---|
592 |
|
---|
593 | sprintf(bfs, "%02d %-10.10s", asg, asgtab[asg].a_name);
|
---|
594 | (*itxput)(row, col, bfs, 1);
|
---|
595 | ++asg;
|
---|
596 | }
|
---|
597 | }
|
---|
598 | }
|
---|
599 |
|
---|
600 | /* |
---|
601 |
|
---|
602 | */
|
---|
603 |
|
---|
604 | /*
|
---|
605 | =============================================================================
|
---|
606 | showtm() -- show menu of tunings
|
---|
607 | =============================================================================
|
---|
608 | */
|
---|
609 |
|
---|
610 | void showtm(void)
|
---|
611 | {
|
---|
612 | register int16_t row, tun;
|
---|
613 |
|
---|
614 | tun = 0;
|
---|
615 |
|
---|
616 | (*itxput)(0, 0, "N Name", 0);
|
---|
617 |
|
---|
618 | for (row = 1; row < 11; row++) {
|
---|
619 |
|
---|
620 | sprintf(bfs, "%d %-32.32s", tun, tunname[tun]);
|
---|
621 | (*itxput)(row, 0, bfs, 1);
|
---|
622 | ++tun;
|
---|
623 | }
|
---|
624 | }
|
---|
625 |
|
---|
626 | /* |
---|
627 |
|
---|
628 | */
|
---|
629 |
|
---|
630 | /*
|
---|
631 | =============================================================================
|
---|
632 | showsm() -- show menu of scores
|
---|
633 | =============================================================================
|
---|
634 | */
|
---|
635 |
|
---|
636 | void showsm(void)
|
---|
637 | {
|
---|
638 | register int16_t col, row, scr;
|
---|
639 |
|
---|
640 | scr = 1;
|
---|
641 |
|
---|
642 | for (col = 1; col < 46; col+= 22) {
|
---|
643 |
|
---|
644 | if (scr > N_SCORES)
|
---|
645 | return;
|
---|
646 |
|
---|
647 | (*itxput)(0, col, "No Score", 0);
|
---|
648 |
|
---|
649 | for (row = 1; row < 15; row++) {
|
---|
650 |
|
---|
651 | if (scr > N_SCORES)
|
---|
652 | return;
|
---|
653 |
|
---|
654 | sprintf(bfs, "%02d %-16.16s", scr, scname[scr - 1]);
|
---|
655 | (*itxput)(row, col, bfs, 1);
|
---|
656 | ++scr;
|
---|
657 | }
|
---|
658 | }
|
---|
659 | }
|
---|
660 |
|
---|
661 | /* |
---|
662 |
|
---|
663 | */
|
---|
664 |
|
---|
665 | /*
|
---|
666 | =============================================================================
|
---|
667 | scmenu() -- display a submenu in area 1 (score area)
|
---|
668 | =============================================================================
|
---|
669 | */
|
---|
670 |
|
---|
671 | void scmenu(int16_t n)
|
---|
672 | {
|
---|
673 | register int16_t i;
|
---|
674 | register struct octent *op;
|
---|
675 |
|
---|
676 | if (n GE 0) { /* put up a submenu */
|
---|
677 |
|
---|
678 | itxput = sdmtxt; /* setup output function */
|
---|
679 |
|
---|
680 | vbank(0);
|
---|
681 |
|
---|
682 | v_odtab[0][0] |= V_BLA; /* turn off line objcect */
|
---|
683 | objclr(0);
|
---|
684 |
|
---|
685 | v_odtab[1][0] |= V_BLA; /* turn off score object */
|
---|
686 | objclr(1);
|
---|
687 |
|
---|
688 | v_odtab[2][0] |= V_BLA; /* turn off keyboard object */
|
---|
689 | objclr(2);
|
---|
690 |
|
---|
691 | vbank(1); /* clear the window */
|
---|
692 | vbfill4(obj11, 128, 0, 0, 511, 223, exp_c(SDBG16));
|
---|
693 |
|
---|
694 | vbank(0); /* turn on window object */
|
---|
695 | SetPri(11, 4);
|
---|
696 |
|
---|
697 | switch (n) { /* fill the window */
|
---|
698 |
|
---|
699 | case 0: /* instruments */
|
---|
700 |
|
---|
701 | showim(); /* show the instruments */
|
---|
702 | break;
|
---|
703 |
|
---|
704 | case 1: /* assignments */
|
---|
705 |
|
---|
706 | showam(lastam); /* show the assignments */
|
---|
707 | stcpos(17, 11); /* position the cursor */
|
---|
708 |
|
---|
709 | cxval = CTOX(11);
|
---|
710 | cyval = RTOY(17);
|
---|
711 |
|
---|
712 | if (infield(stcrow, stccol, curfet))
|
---|
713 | cfetp = infetp;
|
---|
714 |
|
---|
715 | break;
|
---|
716 |
|
---|
717 | case 2: /* tunings */
|
---|
718 |
|
---|
719 | showtm(); /* show the tunings */
|
---|
720 | stcpos(17, 19); /* position the cursor */
|
---|
721 |
|
---|
722 | cxval = CTOX(19);
|
---|
723 | cyval = RTOY(17);
|
---|
724 |
|
---|
725 | if (infield(stcrow, stccol, curfet))
|
---|
726 | cfetp = infetp;
|
---|
727 |
|
---|
728 | break;
|
---|
729 |
|
---|
730 | case 3: /* scores */
|
---|
731 |
|
---|
732 | showsm(); /* show the scores */
|
---|
733 | stcpos(24, 7); /* position the cursor */
|
---|
734 |
|
---|
735 | cxval = CTOX(7);
|
---|
736 | cyval = RTOY(24);
|
---|
737 |
|
---|
738 | if (infield(stcrow, stccol, curfet))
|
---|
739 | cfetp = infetp;
|
---|
740 |
|
---|
741 | break;
|
---|
742 |
|
---|
743 | default: /* eh ? */
|
---|
744 |
|
---|
745 | break;
|
---|
746 | }
|
---|
747 |
|
---|
748 | } else { /* take down the submenu */
|
---|
749 |
|
---|
750 | vbank(0);
|
---|
751 |
|
---|
752 | v_odtab[4][0] |= V_BLA; /* turn off window object */
|
---|
753 | objclr(4);
|
---|
754 |
|
---|
755 | op = &v_obtab[13]; /* turn on keyboard object */
|
---|
756 | objon(2, op->objy, op->ysize);
|
---|
757 | v_odtab[2][0] &= ~V_BLA;
|
---|
758 |
|
---|
759 | op = &v_obtab[14]; /* turn on score object */
|
---|
760 | objon(1, op->objy, op->ysize);
|
---|
761 | v_odtab[1][0] &= ~V_BLA;
|
---|
762 |
|
---|
763 | op = &v_obtab[15]; /* turn on line object */
|
---|
764 | objon(0, op->objy, op->ysize);
|
---|
765 | v_odtab[0][0] &= ~V_BLA;
|
---|
766 | }
|
---|
767 |
|
---|
768 | scmctl = n; /* set new menu type */
|
---|
769 | }
|
---|
770 | /* |
---|
771 |
|
---|
772 | */
|
---|
773 |
|
---|
774 | /*
|
---|
775 | =============================================================================
|
---|
776 | sdmenu() -- display a submenu in area 2 (text areas)
|
---|
777 | =============================================================================
|
---|
778 | */
|
---|
779 |
|
---|
780 | void sdmenu(int16_t n)
|
---|
781 | {
|
---|
782 | register int16_t i, wasup;
|
---|
783 |
|
---|
784 | wasup = sdmctl; /* save previous menu type */
|
---|
785 | sdmctl = n; /* set new menu type */
|
---|
786 |
|
---|
787 | if (n GE 0) { /* put up a menu */
|
---|
788 |
|
---|
789 | submenu = TRUE; /* indicate there's a menu up */
|
---|
790 |
|
---|
791 | sdmrow = stcrow; /* save underline cursor position */
|
---|
792 | sdmcol = stccol; /* ... */
|
---|
793 |
|
---|
794 | memsetw(&sctctab[3][0], exp_c(SDBGMM), 64); /* recolor */
|
---|
795 | memsetw(&sctctab[4][0], exp_c(SDBGMM), 64);
|
---|
796 | memsetw(&sctctab[5][0], exp_c(SDBGMM), 64);
|
---|
797 |
|
---|
798 | if (n EQ 4) { /* extra 2 lines for section menu */
|
---|
799 |
|
---|
800 | memsetw(&sctctab[6][0], exp_c(SDBGMM), 64);
|
---|
801 | memsetw(&sctctab[7][0], exp_c(SDBGMM), 64);
|
---|
802 | }
|
---|
803 |
|
---|
804 | stcclr(); /* re-color the cursor background */
|
---|
805 | stcpos(sdmrow, sdmcol); /* turn underline cursor back on */
|
---|
806 |
|
---|
807 | if (infield(stcrow, stccol, curfet))
|
---|
808 | cfetp = infetp;
|
---|
809 |
|
---|
810 | if (v_regs[5] & 0x0180)
|
---|
811 | vbank(0);
|
---|
812 |
|
---|
813 | for (i = 0; i < 3; i++) /* top 3 lines of menu */
|
---|
814 | vputs(obj8, 3 + i, 0, sdmenus[n][i], SDMENUBG);
|
---|
815 | /* |
---|
816 |
|
---|
817 | */
|
---|
818 | if (n EQ 4) { /* extra 2 lines for section menu */
|
---|
819 |
|
---|
820 | vputs(obj8, 6, 0, sdmln3, SDMENUBG);
|
---|
821 | vputs(obj8, 7, 0, sdmln4, SDMENUBG);
|
---|
822 |
|
---|
823 | secop = SOP_NUL; /* clear section operation code */
|
---|
824 |
|
---|
825 | grptran = 0; /* reset transpose value */
|
---|
826 | gtmsel = -1; /* de-select source group */
|
---|
827 |
|
---|
828 | for (i = 0; i < 12; i++) /* reset the map */
|
---|
829 | grptmap[i] = i;
|
---|
830 |
|
---|
831 | dsects(); /* display list of sections */
|
---|
832 | dsgtmap(); /* display group map and transpose */
|
---|
833 |
|
---|
834 | point = GLCplot; /* setup to plot on LCD */
|
---|
835 | GLCcurs(G_ON);
|
---|
836 |
|
---|
837 | if (ismode NE IS_NULL) { /* cancel inst. mode */
|
---|
838 |
|
---|
839 | ismode = IS_NULL;
|
---|
840 | pkctrl = oldpk;
|
---|
841 | sliders = oldsl;
|
---|
842 | swpt = oldsw;
|
---|
843 | lcdlbls();
|
---|
844 | }
|
---|
845 |
|
---|
846 | if (gomode NE GO_NULL) { /* cancel goto mode */
|
---|
847 |
|
---|
848 | gomode = GO_NULL;
|
---|
849 | pkctrl = oldpk;
|
---|
850 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
851 | }
|
---|
852 |
|
---|
853 | if (asmode) { /* cancel assign mode */
|
---|
854 |
|
---|
855 | asmode = 0;
|
---|
856 | pkctrl = oldpk;
|
---|
857 | swpt = oldsw;
|
---|
858 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
859 | }
|
---|
860 |
|
---|
861 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
862 | oldpk = pkctrl;
|
---|
863 |
|
---|
864 | if (sliders NE LS_LIBR)
|
---|
865 | oldsl = sliders;
|
---|
866 |
|
---|
867 | oldsw = swpt; /* put panel in group mode */
|
---|
868 | swpt = &t_ngrp;
|
---|
869 | pkctrl = PK_NGRP;
|
---|
870 | sliders = LS_NGRP;
|
---|
871 |
|
---|
872 | lcdlbls();
|
---|
873 | setleds();
|
---|
874 | }
|
---|
875 |
|
---|
876 | SetPri(TTCURS, TTCPRI); /* turn on menu cursor */
|
---|
877 | ttcpos(sdmlim[n][0], sdmlim[n][1]); /* position menu cursor */
|
---|
878 | /* |
---|
879 |
|
---|
880 | */
|
---|
881 | } else { /* take down the menu */
|
---|
882 |
|
---|
883 | submenu = FALSE; /* indicate menu has gone bye bye */
|
---|
884 |
|
---|
885 | if (v_regs[5] & 0x0180)
|
---|
886 | vbank(0);
|
---|
887 |
|
---|
888 | objclr(TTCPRI); /* turn off the menu cursor */
|
---|
889 | stcset(); /* restore underline cursor */
|
---|
890 | stcclr(); /* ... */
|
---|
891 | sdwin(11); /* redisplay window 11 data */
|
---|
892 |
|
---|
893 | if (wasup EQ 4) {
|
---|
894 |
|
---|
895 | sdwin(12); /* redisplay window 12 data */
|
---|
896 |
|
---|
897 | stcpos(sdmrow, sdmcol); /* display underline cursor */
|
---|
898 |
|
---|
899 | cxval = CTOX(sdmcol);
|
---|
900 | cyval = RTOY(sdmrow);
|
---|
901 |
|
---|
902 | if (infield(stcrow, stccol, curfet))
|
---|
903 | cfetp = infetp;
|
---|
904 |
|
---|
905 | pkctrl = oldpk; /* restore panel state */
|
---|
906 | sliders = oldsl;
|
---|
907 | swpt = oldsw;
|
---|
908 |
|
---|
909 | lcdlbls(); /* refresh LCD */
|
---|
910 | setleds(); /* refresh LEDs */
|
---|
911 |
|
---|
912 | } else {
|
---|
913 |
|
---|
914 | stcpos(sdmrow, sdmcol); /* display underline cursor */
|
---|
915 |
|
---|
916 | cxval = CTOX(sdmcol);
|
---|
917 | cyval = RTOY(sdmrow);
|
---|
918 |
|
---|
919 | if (infield(stcrow, stccol, curfet))
|
---|
920 | cfetp = infetp;
|
---|
921 | }
|
---|
922 | }
|
---|
923 | }
|
---|
924 |
|
---|
925 | /* |
---|
926 |
|
---|
927 | */
|
---|
928 |
|
---|
929 | /*
|
---|
930 | =============================================================================
|
---|
931 | hilitnt() -- setup for a note operation
|
---|
932 | =============================================================================
|
---|
933 | */
|
---|
934 |
|
---|
935 | void hilitnt(int16_t nop)
|
---|
936 | {
|
---|
937 | noteop = nop; /* set note operation */
|
---|
938 | notesel = FALSE; /* indicate no note selected */
|
---|
939 | sdmenu(-1); /* take down the menu */
|
---|
940 | dnedmod(); /* update the note edit window */
|
---|
941 | }
|
---|
942 |
|
---|
943 | /* |
---|
944 |
|
---|
945 | */
|
---|
946 |
|
---|
947 | /*
|
---|
948 | =============================================================================
|
---|
949 | hilitop() -- highlight a section operation and set secop
|
---|
950 | =============================================================================
|
---|
951 | */
|
---|
952 |
|
---|
953 | void hilitop(int16_t n)
|
---|
954 | {
|
---|
955 | register int16_t row, lc, rc, col;
|
---|
956 |
|
---|
957 | if (clkrun) /* don't do anything if clock is running */
|
---|
958 | return;
|
---|
959 |
|
---|
960 | if (v_regs[5] & 0x0180)
|
---|
961 | vbank(0);
|
---|
962 |
|
---|
963 | if (secop NE SOP_NUL) {
|
---|
964 |
|
---|
965 | row = sdmht[secop][0];
|
---|
966 | lc = sdmht[secop][1];
|
---|
967 | rc = sdmht[secop][2];
|
---|
968 |
|
---|
969 | for (col = lc; col LE rc; col++)
|
---|
970 | vputa(obj8, row, col, SDMENUBG);
|
---|
971 | }
|
---|
972 |
|
---|
973 | secop = n;
|
---|
974 |
|
---|
975 | row = sdmht[n][0];
|
---|
976 | lc = sdmht[n][1];
|
---|
977 | rc = sdmht[n][2];
|
---|
978 |
|
---|
979 | for (col = lc; col LE rc; col++)
|
---|
980 | vputa(obj8, row, col, (SDBGMM | (SD_ENTR << 4)));
|
---|
981 | }
|
---|
982 |
|
---|
983 | /* |
---|
984 |
|
---|
985 | */
|
---|
986 |
|
---|
987 | /*
|
---|
988 | =============================================================================
|
---|
989 | dosecop() -- do the current section operation
|
---|
990 | =============================================================================
|
---|
991 | */
|
---|
992 |
|
---|
993 | void dosecop(void)
|
---|
994 | {
|
---|
995 | register int16_t sect;
|
---|
996 | register struct s_entry *ep;
|
---|
997 |
|
---|
998 | if (clkrun OR (-1 EQ (sect = insect()))) {
|
---|
999 |
|
---|
1000 | secop = SOP_NUL;
|
---|
1001 | return;
|
---|
1002 | }
|
---|
1003 |
|
---|
1004 | if (insmode) {
|
---|
1005 |
|
---|
1006 | icancel();
|
---|
1007 | dsimode();
|
---|
1008 | }
|
---|
1009 |
|
---|
1010 | switch (secop) {
|
---|
1011 |
|
---|
1012 | case SOP_GO: /* GoTo */
|
---|
1013 |
|
---|
1014 | if (sgoflag EQ 3) { /* GoTo End Section */
|
---|
1015 |
|
---|
1016 | ep = hplist[curscor][EH_SEND];
|
---|
1017 |
|
---|
1018 | while (ep) {
|
---|
1019 |
|
---|
1020 | if (ep->e_data1 EQ sect) {
|
---|
1021 |
|
---|
1022 | sc_goto(fc_val = ep->e_time);
|
---|
1023 | break;
|
---|
1024 | }
|
---|
1025 |
|
---|
1026 | ep = ep->e_up;
|
---|
1027 | }
|
---|
1028 |
|
---|
1029 | } else { /* GoTo Begin Section */
|
---|
1030 |
|
---|
1031 | if (E_NULL NE (ep = seclist[curscor][sect]))
|
---|
1032 | sc_goto(fc_val = ep->e_time);
|
---|
1033 | }
|
---|
1034 |
|
---|
1035 | break;
|
---|
1036 | /* |
---|
1037 |
|
---|
1038 | */
|
---|
1039 | case SOP_BGN: /* Begin */
|
---|
1040 |
|
---|
1041 | if (NOT recsw) /* only in record mode */
|
---|
1042 | break;
|
---|
1043 |
|
---|
1044 | if (v_regs[5] & 0x0180)
|
---|
1045 | vbank(0);
|
---|
1046 |
|
---|
1047 | if (E_NULL NE (ep = seclist[curscor][sect])) {
|
---|
1048 |
|
---|
1049 | eh_rmv(ep, EH_SBGN);
|
---|
1050 | e_rmv(ep);
|
---|
1051 | ep->e_time = t_cur;
|
---|
1052 | p_cur = e_ins(ep, ep_adj(p_cur, 1, t_cur)->e_bak)->e_fwd;
|
---|
1053 | eh_ins(ep, EH_SBGN);
|
---|
1054 | se_exec(ep, D_FWD);
|
---|
1055 |
|
---|
1056 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
1057 |
|
---|
1058 | ep->e_time = t_cur;
|
---|
1059 | ep->e_type = EV_SBGN;
|
---|
1060 | ep->e_data1 = sect;
|
---|
1061 | p_cur = e_ins(ep, ep_adj(p_cur, 1, t_cur)->e_bak)->e_fwd;
|
---|
1062 | eh_ins(ep, EH_SBGN);
|
---|
1063 | seclist[curscor][sect] = ep;
|
---|
1064 | se_exec(ep, D_FWD);
|
---|
1065 | }
|
---|
1066 |
|
---|
1067 | sc_refr(fc_val); /* refresh the screen */
|
---|
1068 | break;
|
---|
1069 | /* |
---|
1070 |
|
---|
1071 | */
|
---|
1072 | case SOP_END: /* End */
|
---|
1073 |
|
---|
1074 | if (NOT recsw) /* only in record mode */
|
---|
1075 | break;
|
---|
1076 |
|
---|
1077 | if (v_regs[5] & 0x0180)
|
---|
1078 | vbank(0);
|
---|
1079 |
|
---|
1080 | if (E_NULL NE (ep = ehfind(EH_SEND, -1L, sect, -1))) {
|
---|
1081 |
|
---|
1082 | eh_rmv(ep, EH_SEND);
|
---|
1083 | e_rmv(ep);
|
---|
1084 | ep->e_time = t_cur;
|
---|
1085 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1086 | eh_ins(ep, EH_SEND);
|
---|
1087 | se_exec(ep, D_FWD);
|
---|
1088 |
|
---|
1089 | } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
|
---|
1090 |
|
---|
1091 | ep->e_time = t_cur;
|
---|
1092 | ep->e_type = EV_SEND;
|
---|
1093 | ep->e_data1 = sect;
|
---|
1094 | p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1095 | eh_ins(ep, EH_SEND);
|
---|
1096 | se_exec(ep, D_FWD);
|
---|
1097 | }
|
---|
1098 |
|
---|
1099 | sc_refr(fc_val); /* refresh the screen */
|
---|
1100 | break;
|
---|
1101 | /* |
---|
1102 |
|
---|
1103 | */
|
---|
1104 | case SOP_MOV: /* Move */
|
---|
1105 |
|
---|
1106 | if (NOT recsw) /* only in record mode */
|
---|
1107 | break;
|
---|
1108 |
|
---|
1109 | if (sec_mov(sect)) /* move the section */
|
---|
1110 | break;
|
---|
1111 |
|
---|
1112 | sc_refr(fc_val); /* refresh screen if successful */
|
---|
1113 | break;
|
---|
1114 |
|
---|
1115 | case SOP_CPY: /* Copy */
|
---|
1116 |
|
---|
1117 | if (NOT recsw) /* only in record mode */
|
---|
1118 | break;
|
---|
1119 |
|
---|
1120 | if (sec_cpy(sect)) /* copy the section */
|
---|
1121 | break;
|
---|
1122 |
|
---|
1123 | sc_refr(fc_val); /* refresh screen if successful */
|
---|
1124 | break;
|
---|
1125 |
|
---|
1126 | case SOP_MRG: /* Merge */
|
---|
1127 |
|
---|
1128 | if (NOT recsw) /* only in record mode */
|
---|
1129 | break;
|
---|
1130 |
|
---|
1131 | if (sec_mrg(sect)) /* merge the section */
|
---|
1132 | break;
|
---|
1133 |
|
---|
1134 | sc_refr(fc_val); /* refresh screen if successful */
|
---|
1135 | break;
|
---|
1136 |
|
---|
1137 | case SOP_GRP: /* ReGrp */
|
---|
1138 |
|
---|
1139 | if (NOT recsw) /* only in record mode */
|
---|
1140 | break;
|
---|
1141 |
|
---|
1142 | if (sec_grp(sect)) /* regroup the section */
|
---|
1143 | break;
|
---|
1144 |
|
---|
1145 | sc_refr(fc_val); /* refresh screen if successful */
|
---|
1146 | break;
|
---|
1147 |
|
---|
1148 | /* |
---|
1149 |
|
---|
1150 | */
|
---|
1151 | case SOP_STC: /* SMPTE */
|
---|
1152 |
|
---|
1153 | if (NOT recsw) /* only in record mode */
|
---|
1154 | break;
|
---|
1155 |
|
---|
1156 | break;
|
---|
1157 |
|
---|
1158 | case SOP_DGR: /* Delete Gr */
|
---|
1159 |
|
---|
1160 | if (NOT recsw) /* only in record mode */
|
---|
1161 | break;
|
---|
1162 |
|
---|
1163 | if (sec_dgr(sect)) /* delete note events */
|
---|
1164 | break;
|
---|
1165 |
|
---|
1166 | sc_refr(fc_val); /* refresh display if successful */
|
---|
1167 | break;
|
---|
1168 |
|
---|
1169 | case SOP_DEV: /* Delete Ev */
|
---|
1170 |
|
---|
1171 | if (NOT recsw) /* only in record mode */
|
---|
1172 | break;
|
---|
1173 |
|
---|
1174 | if (sec_dev(sect)) /* delete non-note events */
|
---|
1175 | break;
|
---|
1176 |
|
---|
1177 | sc_refr(fc_val); /* refresh display if successful */
|
---|
1178 | break;
|
---|
1179 |
|
---|
1180 | case SOP_RMV: /* Remove */
|
---|
1181 |
|
---|
1182 | if (NOT recsw) /* only in record mode */
|
---|
1183 | break;
|
---|
1184 |
|
---|
1185 | if (sec_rmv(sect)) /* remove section */
|
---|
1186 | break;
|
---|
1187 |
|
---|
1188 | sc_refr(fc_val); /* refresh display if successful */
|
---|
1189 | break;
|
---|
1190 | }
|
---|
1191 |
|
---|
1192 | secop = SOP_NUL;
|
---|
1193 | }
|
---|
1194 |
|
---|
1195 | /* |
---|
1196 |
|
---|
1197 | */
|
---|
1198 |
|
---|
1199 | /*
|
---|
1200 | =============================================================================
|
---|
1201 | clkset() -- set the clock state
|
---|
1202 | =============================================================================
|
---|
1203 | */
|
---|
1204 |
|
---|
1205 | void clkset(int16_t st)
|
---|
1206 | {
|
---|
1207 | clkrun = st;
|
---|
1208 |
|
---|
1209 | switch (clksrc) {
|
---|
1210 |
|
---|
1211 | case CK_LOCAL: /* Local */
|
---|
1212 | case CK_SMPTE: /* SMPTE */
|
---|
1213 |
|
---|
1214 | midiclk = FALSE;
|
---|
1215 | pulsclk = FALSE;
|
---|
1216 |
|
---|
1217 | if (st)
|
---|
1218 | fc_sw = 1;
|
---|
1219 | else
|
---|
1220 | fc_sw = 0;
|
---|
1221 |
|
---|
1222 | return;
|
---|
1223 |
|
---|
1224 | case CK_MIDI: /* MIDI */
|
---|
1225 |
|
---|
1226 | fc_sw = 0;
|
---|
1227 | pulsclk = FALSE;
|
---|
1228 |
|
---|
1229 | if (st)
|
---|
1230 | midiclk = TRUE;
|
---|
1231 | else
|
---|
1232 | midiclk = FALSE;
|
---|
1233 |
|
---|
1234 | return;
|
---|
1235 | /* |
---|
1236 |
|
---|
1237 | */
|
---|
1238 | case CK_PLS24: /* PLS24 */
|
---|
1239 | case CK_PLS48: /* PLS48 */
|
---|
1240 | case CK_PLS96: /* PLS96 */
|
---|
1241 |
|
---|
1242 | fc_sw = 0;
|
---|
1243 | midiclk = FALSE;
|
---|
1244 |
|
---|
1245 | if (st)
|
---|
1246 | pulsclk = TRUE;
|
---|
1247 | else
|
---|
1248 | pulsclk = FALSE;
|
---|
1249 |
|
---|
1250 | return;
|
---|
1251 |
|
---|
1252 | case CK_STEP: /* Step */
|
---|
1253 |
|
---|
1254 | fc_sw = 0;
|
---|
1255 | midiclk = FALSE;
|
---|
1256 | pulsclk = FALSE;
|
---|
1257 |
|
---|
1258 | return;
|
---|
1259 | }
|
---|
1260 | }
|
---|
1261 |
|
---|
1262 | /* |
---|
1263 |
|
---|
1264 | */
|
---|
1265 |
|
---|
1266 | /*
|
---|
1267 | =============================================================================
|
---|
1268 | sdboxfn() -- process score display box hits
|
---|
1269 | =============================================================================
|
---|
1270 | */
|
---|
1271 |
|
---|
1272 | int16_t sdboxfn(int16_t n)
|
---|
1273 | {
|
---|
1274 | register int16_t row, col, grp, what, i;
|
---|
1275 | register struct s_entry *ep;
|
---|
1276 | int16_t atr, modewas;
|
---|
1277 |
|
---|
1278 | row = hitcy / 14;
|
---|
1279 | col = hitcx >> 3;
|
---|
1280 |
|
---|
1281 | switch (hitbox) {
|
---|
1282 |
|
---|
1283 | case 0: /* signature, section, beat, frame */
|
---|
1284 |
|
---|
1285 | if (col EQ 0) { /* signature */
|
---|
1286 |
|
---|
1287 | if (clkrun) /* clock can't be running */
|
---|
1288 | return(FAILURE);
|
---|
1289 |
|
---|
1290 | if (ac_code EQ N_SHARP)
|
---|
1291 | ac_code = N_FLAT;
|
---|
1292 | else
|
---|
1293 | ac_code = N_SHARP;
|
---|
1294 |
|
---|
1295 | sc_refr(fc_val);
|
---|
1296 | return(SUCCESS);
|
---|
1297 |
|
---|
1298 | } else if ((col GE 2) AND (col LE 4)) { /* section menu */
|
---|
1299 |
|
---|
1300 | if (clkrun) /* clock can't be running */
|
---|
1301 | return(FAILURE);
|
---|
1302 |
|
---|
1303 | if (sdmctl EQ -1) { /* menu not up yet */
|
---|
1304 |
|
---|
1305 | sdmenu(4); /* put up the menu */
|
---|
1306 | return(SUCCESS);
|
---|
1307 | /* |
---|
1308 |
|
---|
1309 | */
|
---|
1310 | } else { /* menu up */
|
---|
1311 |
|
---|
1312 | if (vtcrow EQ 19) {
|
---|
1313 |
|
---|
1314 | if ((vtccol GE 1) AND
|
---|
1315 | (vtccol LE 4)) { /* GoTo */
|
---|
1316 |
|
---|
1317 | hilitop(SOP_GO);
|
---|
1318 | return(SUCCESS);
|
---|
1319 |
|
---|
1320 | } else if ((vtccol GE 8) AND
|
---|
1321 | (vtccol LE 11)) { /* Move */
|
---|
1322 |
|
---|
1323 | hilitop(SOP_MOV);
|
---|
1324 | return(SUCCESS);
|
---|
1325 |
|
---|
1326 | } else if ((vtccol GE 15) AND
|
---|
1327 | (vtccol LE 19)) { /* SMPTE */
|
---|
1328 |
|
---|
1329 | hilitop(SOP_STC);
|
---|
1330 | return(SUCCESS);
|
---|
1331 |
|
---|
1332 | } else if ((vtccol GE 24) AND
|
---|
1333 | (vtccol LE 62)) { /* number */
|
---|
1334 |
|
---|
1335 | if (-1 NE insect()) {
|
---|
1336 |
|
---|
1337 | sdmenu(-1);
|
---|
1338 | dosecop();
|
---|
1339 | }
|
---|
1340 |
|
---|
1341 | return(SUCCESS);
|
---|
1342 | }
|
---|
1343 | /* |
---|
1344 |
|
---|
1345 | */
|
---|
1346 | } else if (vtcrow EQ 20) {
|
---|
1347 |
|
---|
1348 | if ((vtccol GE 1) AND
|
---|
1349 | (vtccol LE 5)) { /* Begin */
|
---|
1350 |
|
---|
1351 | hilitop(SOP_BGN);
|
---|
1352 | return(SUCCESS);
|
---|
1353 |
|
---|
1354 | } else if ((vtccol GE 8) AND
|
---|
1355 | (vtccol LE 11)) { /* Copy */
|
---|
1356 |
|
---|
1357 | hilitop(SOP_CPY);
|
---|
1358 | return(SUCCESS);
|
---|
1359 |
|
---|
1360 | } else if ((vtccol GE 15) AND
|
---|
1361 | (vtccol LE 20)) { /* Del Gr */
|
---|
1362 |
|
---|
1363 | hilitop(SOP_DGR);
|
---|
1364 | return(SUCCESS);
|
---|
1365 |
|
---|
1366 | } else if ((vtccol GE 24) AND
|
---|
1367 | (vtccol LE 62)) { /* number */
|
---|
1368 |
|
---|
1369 | if (-1 NE insect()) {
|
---|
1370 |
|
---|
1371 | sdmenu(-1);
|
---|
1372 | dosecop();
|
---|
1373 | }
|
---|
1374 |
|
---|
1375 | return(SUCCESS);
|
---|
1376 | }
|
---|
1377 | /* |
---|
1378 |
|
---|
1379 | */
|
---|
1380 | } else if (vtcrow EQ 21) {
|
---|
1381 |
|
---|
1382 | if ((vtccol GE 1) AND
|
---|
1383 | (vtccol LE 3)) { /* End */
|
---|
1384 |
|
---|
1385 | hilitop(SOP_END);
|
---|
1386 | return(SUCCESS);
|
---|
1387 |
|
---|
1388 | } else if ((vtccol GE 8) AND
|
---|
1389 | (vtccol LE 12)) { /* Merge */
|
---|
1390 |
|
---|
1391 | hilitop(SOP_MRG);
|
---|
1392 | return(SUCCESS);
|
---|
1393 |
|
---|
1394 | } else if ((vtccol GE 15) AND
|
---|
1395 | (vtccol LE 20)) { /* Del Ev */
|
---|
1396 |
|
---|
1397 | hilitop(SOP_DEV);
|
---|
1398 | return(SUCCESS);
|
---|
1399 | }
|
---|
1400 |
|
---|
1401 | /* |
---|
1402 |
|
---|
1403 | */
|
---|
1404 | } else if (vtcrow EQ 22) {
|
---|
1405 |
|
---|
1406 | if ((vtccol GE 8) AND
|
---|
1407 | (vtccol LE 12)) { /* ReGrp */
|
---|
1408 |
|
---|
1409 | hilitop(SOP_GRP);
|
---|
1410 | return(SUCCESS);
|
---|
1411 |
|
---|
1412 | } else if ((vtccol GE 15) AND
|
---|
1413 | (vtccol LE 20)) { /* Remove */
|
---|
1414 |
|
---|
1415 | hilitop(SOP_RMV);
|
---|
1416 | return(SUCCESS);
|
---|
1417 |
|
---|
1418 | } else if ((vtccol GE 28) AND
|
---|
1419 | (vtccol LE 62)) { /* number */
|
---|
1420 |
|
---|
1421 | if (gtmsel GE 0)
|
---|
1422 | dsgtmn(gtmsel, FALSE);
|
---|
1423 |
|
---|
1424 | if (-1 NE (gtmsel = ingroup()))
|
---|
1425 | dsgtmn(gtmsel, TRUE);
|
---|
1426 |
|
---|
1427 | return(SUCCESS);
|
---|
1428 | }
|
---|
1429 |
|
---|
1430 | } else if (vtcrow EQ 23) {
|
---|
1431 |
|
---|
1432 | if ((vtccol GE 1) AND
|
---|
1433 | (vtccol LE 6)) { /* Escape */
|
---|
1434 |
|
---|
1435 | secop = SOP_NUL;
|
---|
1436 | sdmenu(-1);
|
---|
1437 | return(SUCCESS);
|
---|
1438 |
|
---|
1439 | } else if ((vtccol GE 22) AND
|
---|
1440 | (vtccol LE 24)) { /* Transpose */
|
---|
1441 |
|
---|
1442 | return(entbh(-1));
|
---|
1443 | }
|
---|
1444 | }
|
---|
1445 | }
|
---|
1446 |
|
---|
1447 | return(FAILURE);
|
---|
1448 |
|
---|
1449 | } else
|
---|
1450 | return(entbh(-1));
|
---|
1451 |
|
---|
1452 | /* |
---|
1453 |
|
---|
1454 | */
|
---|
1455 | case 1: /* insert */
|
---|
1456 |
|
---|
1457 | modewas = insmode; /* save old insert state */
|
---|
1458 |
|
---|
1459 | if (insmode) /* toggle ... */
|
---|
1460 | icancel(); /* ... insert on -> off */
|
---|
1461 | else
|
---|
1462 | istart(); /* ... insert of -> on */
|
---|
1463 |
|
---|
1464 | if (modewas NE insmode) /* only refresh if changed */
|
---|
1465 | sc_refr(fc_val);
|
---|
1466 |
|
---|
1467 | dsimode(); /* update insert mode display */
|
---|
1468 | return(SUCCESS);
|
---|
1469 |
|
---|
1470 | case 2: /* clock control, source */
|
---|
1471 |
|
---|
1472 | if (col LE 33) { /* clock */
|
---|
1473 |
|
---|
1474 | clkset(NOT clkrun);
|
---|
1475 | dsclk();
|
---|
1476 | return(SUCCESS);
|
---|
1477 |
|
---|
1478 | /* |
---|
1479 |
|
---|
1480 | */
|
---|
1481 | } else if ((col GE 35) AND (col LE 43)) { /* control */
|
---|
1482 |
|
---|
1483 | if (sdmctl EQ -1) { /* menu not yet up */
|
---|
1484 |
|
---|
1485 | sdmenu(3);
|
---|
1486 | return(SUCCESS);
|
---|
1487 |
|
---|
1488 | } else { /* menu up */
|
---|
1489 |
|
---|
1490 | if (vtcrow EQ 19) {
|
---|
1491 |
|
---|
1492 | if ((vtccol GE 1) AND
|
---|
1493 | (vtccol LE 5)) {
|
---|
1494 |
|
---|
1495 | clkctl = CK_LOCAL;
|
---|
1496 | sdmenu(-1);
|
---|
1497 | sdwin(2);
|
---|
1498 | return(SUCCESS);
|
---|
1499 | }
|
---|
1500 |
|
---|
1501 | } else if (vtcrow EQ 20) {
|
---|
1502 |
|
---|
1503 | if ((vtccol GE 1) AND
|
---|
1504 | (vtccol LE 5)) {
|
---|
1505 |
|
---|
1506 | clkctl = CK_MIDI;
|
---|
1507 | sdmenu(-1);
|
---|
1508 | sdwin(2);
|
---|
1509 | return(SUCCESS);
|
---|
1510 | }
|
---|
1511 |
|
---|
1512 | } else if (vtcrow EQ 21) {
|
---|
1513 |
|
---|
1514 | if ((vtccol GE 1) AND
|
---|
1515 | (vtccol LE 5)) {
|
---|
1516 |
|
---|
1517 | clkctl = CK_SMPTE;
|
---|
1518 | sdmenu(-1);
|
---|
1519 | sdwin(2);
|
---|
1520 | return(SUCCESS);
|
---|
1521 | }
|
---|
1522 | }
|
---|
1523 | }
|
---|
1524 |
|
---|
1525 | return(FAILURE);
|
---|
1526 | /* |
---|
1527 |
|
---|
1528 | */
|
---|
1529 | } else if (col GE 45) { /* source */
|
---|
1530 |
|
---|
1531 | if (sdmctl EQ -1) { /* menu not yet up */
|
---|
1532 |
|
---|
1533 | sdmenu(2);
|
---|
1534 | setleds();
|
---|
1535 | return(SUCCESS);
|
---|
1536 |
|
---|
1537 | } else { /* menu up */
|
---|
1538 |
|
---|
1539 | if (vtcrow EQ 19) {
|
---|
1540 |
|
---|
1541 | if ((vtccol GE 1) AND
|
---|
1542 | (vtccol LE 5)) {
|
---|
1543 |
|
---|
1544 | clksrc = CK_LOCAL;
|
---|
1545 | pkctrl = PK_PFRM;
|
---|
1546 | setleds();
|
---|
1547 | sdmenu(-1);
|
---|
1548 | sdwin(2);
|
---|
1549 | return(SUCCESS);
|
---|
1550 |
|
---|
1551 | } else if ((vtccol GE 9) AND
|
---|
1552 | (vtccol LE 13)) {
|
---|
1553 |
|
---|
1554 | clksrc = CK_PLS24;
|
---|
1555 | pkctrl = PK_PFRM;
|
---|
1556 | setleds();
|
---|
1557 | sdmenu(-1);
|
---|
1558 | sdwin(2);
|
---|
1559 | return(SUCCESS);
|
---|
1560 |
|
---|
1561 | } else if ((vtccol GE 17) AND
|
---|
1562 | (vtccol LE 20)) {
|
---|
1563 |
|
---|
1564 | clksrc = CK_STEP;
|
---|
1565 | pkctrl = PK_NOTE;
|
---|
1566 | stepenb = TRUE;
|
---|
1567 | setleds();
|
---|
1568 | sdmenu(-1);
|
---|
1569 | sdwin(2);
|
---|
1570 | return(SUCCESS);
|
---|
1571 | }
|
---|
1572 |
|
---|
1573 | /* |
---|
1574 |
|
---|
1575 | */
|
---|
1576 | } else if (vtcrow EQ 20) {
|
---|
1577 |
|
---|
1578 | if ((vtccol GE 1) AND
|
---|
1579 | (vtccol LE 5)) {
|
---|
1580 |
|
---|
1581 | clksrc = CK_MIDI;
|
---|
1582 | pkctrl = PK_PFRM;
|
---|
1583 | setleds();
|
---|
1584 | sdmenu(-1);
|
---|
1585 | sdwin(2);
|
---|
1586 | return(SUCCESS);
|
---|
1587 |
|
---|
1588 | } else if ((vtccol GE 9) AND
|
---|
1589 | (vtccol LE 13)) {
|
---|
1590 |
|
---|
1591 | clksrc = CK_PLS48;
|
---|
1592 | pkctrl = PK_PFRM;
|
---|
1593 | setleds();
|
---|
1594 | sdmenu(-1);
|
---|
1595 | sdwin(2);
|
---|
1596 | return(SUCCESS);
|
---|
1597 | }
|
---|
1598 | /* |
---|
1599 |
|
---|
1600 | */
|
---|
1601 | } else if (vtcrow EQ 21) {
|
---|
1602 |
|
---|
1603 | if ((vtccol GE 1) AND
|
---|
1604 | (vtccol LE 5)) {
|
---|
1605 |
|
---|
1606 | clksrc = CK_SMPTE;
|
---|
1607 | pkctrl = PK_PFRM;
|
---|
1608 | setleds();
|
---|
1609 | sdmenu(-1);
|
---|
1610 | sdwin(2);
|
---|
1611 | return(SUCCESS);
|
---|
1612 |
|
---|
1613 | } else if ((vtccol GE 9) AND
|
---|
1614 | (vtccol LE 13)) {
|
---|
1615 |
|
---|
1616 | clksrc = CK_PLS96;
|
---|
1617 | pkctrl = PK_PFRM;
|
---|
1618 | setleds();
|
---|
1619 | sdmenu(-1);
|
---|
1620 | sdwin(2);
|
---|
1621 | return(SUCCESS);
|
---|
1622 | }
|
---|
1623 | }
|
---|
1624 | }
|
---|
1625 | }
|
---|
1626 |
|
---|
1627 | return(FAILURE);
|
---|
1628 |
|
---|
1629 | /* |
---|
1630 |
|
---|
1631 | */
|
---|
1632 | case 3: /* note edit */
|
---|
1633 |
|
---|
1634 | if (clkrun) /* clock can't be running */
|
---|
1635 | return(FAILURE);
|
---|
1636 |
|
---|
1637 | if (scmctl NE -1)
|
---|
1638 | scmenu(-1);
|
---|
1639 |
|
---|
1640 | if (sdmctl EQ -1) { /* menu not up */
|
---|
1641 |
|
---|
1642 | sdmenu(1);
|
---|
1643 | noteop = NOP_NUL;
|
---|
1644 | return(SUCCESS);
|
---|
1645 |
|
---|
1646 | } else { /* menu up - select operation */
|
---|
1647 |
|
---|
1648 | if (vtcrow EQ 19) {
|
---|
1649 |
|
---|
1650 | if ((vtccol GE 1) AND
|
---|
1651 | (vtccol LE 9)) { /* Begin Acc */
|
---|
1652 |
|
---|
1653 | hilitnt(NOP_ACC);
|
---|
1654 | return(SUCCESS);
|
---|
1655 |
|
---|
1656 | } else if ((vtccol GE 13) AND
|
---|
1657 | (vtccol LE 21)) { /* Move Note */
|
---|
1658 |
|
---|
1659 | hilitnt(NOP_MVN);
|
---|
1660 | return(SUCCESS);
|
---|
1661 |
|
---|
1662 | } else if ((vtccol GE 25) AND
|
---|
1663 | (vtccol LE 30)) { /* Escape */
|
---|
1664 |
|
---|
1665 | hilitnt(NOP_NUL);
|
---|
1666 | return(SUCCESS);
|
---|
1667 |
|
---|
1668 | }
|
---|
1669 |
|
---|
1670 | return(FAILURE);
|
---|
1671 | /* |
---|
1672 |
|
---|
1673 | */
|
---|
1674 | } else if (vtcrow EQ 20) {
|
---|
1675 |
|
---|
1676 | if ((vtccol GE 1) AND
|
---|
1677 | (vtccol LE 9)) { /* Begin Nat */
|
---|
1678 |
|
---|
1679 | hilitnt(NOP_NAT);
|
---|
1680 | return(SUCCESS);
|
---|
1681 |
|
---|
1682 | } else if ((vtccol GE 13) AND
|
---|
1683 | (vtccol LE 22)) { /* Move Begin */
|
---|
1684 |
|
---|
1685 | hilitnt(NOP_MVB);
|
---|
1686 | return(SUCCESS);
|
---|
1687 | }
|
---|
1688 |
|
---|
1689 | return(FAILURE);
|
---|
1690 |
|
---|
1691 | } else if (vtcrow EQ 21) {
|
---|
1692 |
|
---|
1693 | if ((vtccol GE 1) AND
|
---|
1694 | (vtccol LE 8)) { /* End Note */
|
---|
1695 |
|
---|
1696 | hilitnt(NOP_END);
|
---|
1697 | return(SUCCESS);
|
---|
1698 |
|
---|
1699 | } else if ((vtccol GE 13) AND
|
---|
1700 | (vtccol LE 20)) { /* Move End */
|
---|
1701 |
|
---|
1702 | hilitnt(NOP_MVE);
|
---|
1703 | return(SUCCESS);
|
---|
1704 | }
|
---|
1705 |
|
---|
1706 | return(FAILURE);
|
---|
1707 |
|
---|
1708 | } else
|
---|
1709 | return(FAILURE);
|
---|
1710 | }
|
---|
1711 |
|
---|
1712 | return(FAILURE);
|
---|
1713 |
|
---|
1714 | /* |
---|
1715 |
|
---|
1716 | */
|
---|
1717 | case 4: /* assignments */
|
---|
1718 |
|
---|
1719 | if (col LE 9) {
|
---|
1720 |
|
---|
1721 | if (scmctl NE 1) { /* not up yet -- show page 1 */
|
---|
1722 |
|
---|
1723 | lastam = 0;
|
---|
1724 | scmenu(1);
|
---|
1725 |
|
---|
1726 | } else { /* up - switch pages */
|
---|
1727 |
|
---|
1728 | if (lastam EQ 0) { /* show page 2 */
|
---|
1729 |
|
---|
1730 | lastam = 60;
|
---|
1731 | scmenu(1);
|
---|
1732 |
|
---|
1733 | } else { /* take down menu */
|
---|
1734 |
|
---|
1735 | lastam = 0;
|
---|
1736 | scmenu(-1);
|
---|
1737 | }
|
---|
1738 | }
|
---|
1739 |
|
---|
1740 | return(SUCCESS);
|
---|
1741 |
|
---|
1742 | } else {
|
---|
1743 |
|
---|
1744 | return(entbh(-1)); /* data entry */
|
---|
1745 | }
|
---|
1746 |
|
---|
1747 | case 5: /* tunings */
|
---|
1748 |
|
---|
1749 | if ((col GE 14) AND (col LE 17)) {
|
---|
1750 |
|
---|
1751 | if (scmctl NE 2)
|
---|
1752 | scmenu(2); /* put up menu */
|
---|
1753 | else
|
---|
1754 | scmenu(-1); /* take down menu */
|
---|
1755 |
|
---|
1756 | return(SUCCESS);
|
---|
1757 |
|
---|
1758 | } else {
|
---|
1759 |
|
---|
1760 | return(entbh(-1)); /* data entry */
|
---|
1761 | }
|
---|
1762 | /* |
---|
1763 |
|
---|
1764 | */
|
---|
1765 | case 8: /* stop/next */
|
---|
1766 |
|
---|
1767 | if ((col GE 40) AND (col LE 43)) { /* stop */
|
---|
1768 |
|
---|
1769 | if (recsw) {
|
---|
1770 |
|
---|
1771 | if (v_regs[5] & 0x0180)
|
---|
1772 | vbank(0);
|
---|
1773 |
|
---|
1774 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_STOP, -1, -1))) {
|
---|
1775 |
|
---|
1776 | se_exec(ep, D_FWD);
|
---|
1777 |
|
---|
1778 | } else if (E_NULL NE (ep = e_alc(E_SIZE1))) {
|
---|
1779 |
|
---|
1780 | ep->e_time = t_cur;
|
---|
1781 | ep->e_type = EV_STOP;
|
---|
1782 | p_cur= e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1783 | se_exec(ep, D_FWD);
|
---|
1784 | ctrsw = TRUE;
|
---|
1785 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
1786 | scupd();
|
---|
1787 | }
|
---|
1788 | }
|
---|
1789 |
|
---|
1790 | } else if ((col GE 45) AND (col LE 48)) { /* next */
|
---|
1791 |
|
---|
1792 | if (recsw) {
|
---|
1793 |
|
---|
1794 | if (v_regs[5] & 0x0180)
|
---|
1795 | vbank(0);
|
---|
1796 |
|
---|
1797 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_NEXT, -1, -1))) {
|
---|
1798 |
|
---|
1799 | se_exec(ep, D_FWD);
|
---|
1800 |
|
---|
1801 | } else if (E_NULL NE (ep = e_alc(E_SIZE1))) {
|
---|
1802 |
|
---|
1803 | ep->e_time = t_cur;
|
---|
1804 | ep->e_type = EV_NEXT;
|
---|
1805 | p_cur= e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1806 | se_exec(ep, D_FWD);
|
---|
1807 | ctrsw = TRUE;
|
---|
1808 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
1809 | scupd();
|
---|
1810 | }
|
---|
1811 | }
|
---|
1812 |
|
---|
1813 | }
|
---|
1814 |
|
---|
1815 | return(SUCCESS);
|
---|
1816 |
|
---|
1817 | /* |
---|
1818 |
|
---|
1819 | */
|
---|
1820 | case 9: /* punch in/out */
|
---|
1821 |
|
---|
1822 | if ((col GE 50) AND (col LE 51)) { /* punch in */
|
---|
1823 |
|
---|
1824 | if (recsw) {
|
---|
1825 |
|
---|
1826 | if (v_regs[5] & 0x0180)
|
---|
1827 | vbank(0);
|
---|
1828 |
|
---|
1829 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_STOP, 1, -1))) {
|
---|
1830 |
|
---|
1831 | se_exec(ep, D_FWD);
|
---|
1832 |
|
---|
1833 | } else if (E_NULL NE (ep = e_alc(E_SIZE1))) {
|
---|
1834 |
|
---|
1835 | ep->e_time = t_cur;
|
---|
1836 | ep->e_type = EV_PNCH;
|
---|
1837 | ep->e_data1 = 1;
|
---|
1838 | p_cur= e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1839 | se_exec(ep, D_FWD);
|
---|
1840 | ctrsw = TRUE;
|
---|
1841 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
1842 | scupd();
|
---|
1843 | }
|
---|
1844 | }
|
---|
1845 |
|
---|
1846 | } else if ((col GE 53) AND (col LE 55)) { /* punch out */
|
---|
1847 |
|
---|
1848 | if (recsw) {
|
---|
1849 |
|
---|
1850 | if (v_regs[5] & 0x0180)
|
---|
1851 | vbank(0);
|
---|
1852 |
|
---|
1853 | if (E_NULL NE (ep = findev(p_cur, t_cur, EV_PNCH, 0, -1))) {
|
---|
1854 |
|
---|
1855 | se_exec(ep, D_FWD);
|
---|
1856 |
|
---|
1857 | } else if (E_NULL NE (ep = e_alc(E_SIZE1))) {
|
---|
1858 |
|
---|
1859 | ep->e_time = t_cur;
|
---|
1860 | ep->e_type = EV_PNCH;
|
---|
1861 | ep->e_data1 = 0;
|
---|
1862 | p_cur= e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
|
---|
1863 | se_exec(ep, D_FWD);
|
---|
1864 | ctrsw = TRUE;
|
---|
1865 | se_disp(ep, D_FWD, gdstbc, 1);
|
---|
1866 | scupd();
|
---|
1867 | }
|
---|
1868 | }
|
---|
1869 |
|
---|
1870 | }
|
---|
1871 |
|
---|
1872 | return(SUCCESS);
|
---|
1873 | /* |
---|
1874 |
|
---|
1875 | */
|
---|
1876 | case 10: /* Output */
|
---|
1877 |
|
---|
1878 | return(SUCCESS);
|
---|
1879 |
|
---|
1880 | case 11: /* group/ins, trans, dyn/loc, velocity */
|
---|
1881 |
|
---|
1882 | if ((row EQ 18) AND (col LE 3)) { /* inst. menu */
|
---|
1883 |
|
---|
1884 | if (scmctl NE 0)
|
---|
1885 | scmenu(0); /* put up the menu */
|
---|
1886 | else
|
---|
1887 | scmenu(-1); /* take down the menu */
|
---|
1888 |
|
---|
1889 | return(SUCCESS);
|
---|
1890 |
|
---|
1891 | } else if ((row EQ 21) AND (col LE 3)) { /* velocity flag */
|
---|
1892 |
|
---|
1893 | velflag = NOT velflag;
|
---|
1894 | ds_vmod();
|
---|
1895 | return(SUCCESS);
|
---|
1896 |
|
---|
1897 | } else
|
---|
1898 | return(entbh(-1)); /* inst. number */
|
---|
1899 |
|
---|
1900 | /* |
---|
1901 |
|
---|
1902 | */
|
---|
1903 | case 12: /* analog source, value */
|
---|
1904 |
|
---|
1905 | if ((row EQ 23) AND (col LE 4)) { /* display enable */
|
---|
1906 |
|
---|
1907 | angroup = -angroup;
|
---|
1908 |
|
---|
1909 | if (angroup < 0)
|
---|
1910 | atr = SDW12ATR;
|
---|
1911 | else
|
---|
1912 | atr = (SD_CHNG << 4) | SDBG12;
|
---|
1913 |
|
---|
1914 | if (v_regs[5] & 0x0180)
|
---|
1915 | vbank(0);
|
---|
1916 |
|
---|
1917 | for (i = 0; i < 4; i++)
|
---|
1918 | vputa(obj8, 7, i, atr);
|
---|
1919 |
|
---|
1920 | return(SUCCESS);
|
---|
1921 |
|
---|
1922 | } else if ((row EQ 22) AND (col LE 4)) { /* r/p source */
|
---|
1923 |
|
---|
1924 | ancmsw = NOT ancmsw;
|
---|
1925 |
|
---|
1926 | if (ancmsw)
|
---|
1927 | atr = (SD_CHNG << 4) | SDBG12;
|
---|
1928 | else
|
---|
1929 | atr = SDW12ATR;
|
---|
1930 |
|
---|
1931 | if (v_regs[5] & 0x0180)
|
---|
1932 | vbank(0);
|
---|
1933 |
|
---|
1934 | for (i = 0; i < 4; i++)
|
---|
1935 | vputa(obj8, 6, i, atr);
|
---|
1936 |
|
---|
1937 | return(SUCCESS);
|
---|
1938 |
|
---|
1939 | } else {
|
---|
1940 |
|
---|
1941 | return(entbh(-1));
|
---|
1942 | }
|
---|
1943 | /* |
---|
1944 |
|
---|
1945 | */
|
---|
1946 | case 13: /* score number and title */
|
---|
1947 |
|
---|
1948 | if (col LE 4) { /* score menu */
|
---|
1949 |
|
---|
1950 | if (scmctl NE 3)
|
---|
1951 | scmenu(3); /* put up menu */
|
---|
1952 | else
|
---|
1953 | scmenu(-1); /* take down menu */
|
---|
1954 |
|
---|
1955 | return(SUCCESS);
|
---|
1956 |
|
---|
1957 | } else if ((col GE 10) AND (col LE 25)) { /* score name */
|
---|
1958 |
|
---|
1959 | if (sdmctl NE 0) {
|
---|
1960 |
|
---|
1961 | sdmenu(0);
|
---|
1962 |
|
---|
1963 | vtsetup(obj8, svtdsp, 10, scname[curscor], 19, 1,
|
---|
1964 | advscur, bspscur, nokey, nokey, svtstop,
|
---|
1965 | SDW13DEA, SDBG13);
|
---|
1966 |
|
---|
1967 | } else {
|
---|
1968 |
|
---|
1969 | vtyper();
|
---|
1970 | }
|
---|
1971 |
|
---|
1972 | return(SUCCESS);
|
---|
1973 |
|
---|
1974 | } else
|
---|
1975 | return(entbh(-1));
|
---|
1976 | /* |
---|
1977 |
|
---|
1978 | */
|
---|
1979 | case 14: /* rec mode */
|
---|
1980 |
|
---|
1981 | if ((col GE 31) AND (col LE 34)) { /* Play */
|
---|
1982 |
|
---|
1983 | recsw = FALSE;
|
---|
1984 | dsrpmod();
|
---|
1985 | return(SUCCESS);
|
---|
1986 |
|
---|
1987 | } else if ((col GE 36) AND (col LE 40)) { /* Recrd */
|
---|
1988 |
|
---|
1989 | recsw = TRUE;
|
---|
1990 | dsrpmod();
|
---|
1991 | return(SUCCESS);
|
---|
1992 |
|
---|
1993 | } else if ((col GE 42) AND (col LE 47)) { /* OvrDub */
|
---|
1994 |
|
---|
1995 | dubsw = NOT dubsw;
|
---|
1996 | dsrpmod();
|
---|
1997 | return(SUCCESS);
|
---|
1998 |
|
---|
1999 | } else if ((col GE 49) AND (col LE 55)) { /* PunchIn */
|
---|
2000 |
|
---|
2001 | pchsw = NOT pchsw;
|
---|
2002 | dsrpmod();
|
---|
2003 | return(SUCCESS);
|
---|
2004 |
|
---|
2005 | }
|
---|
2006 |
|
---|
2007 | return(FAILURE);
|
---|
2008 |
|
---|
2009 | case 16: /* note display */
|
---|
2010 |
|
---|
2011 | if (NOP_NUL NE noteop)
|
---|
2012 | donote();
|
---|
2013 |
|
---|
2014 | return(SUCCESS);
|
---|
2015 | }
|
---|
2016 |
|
---|
2017 | return(FAILURE);
|
---|
2018 | }
|
---|