source: buchla-68k/orig/RAM/SCFIELD.C@ 66b48e7

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

Imported original source code.

  • Property mode set to 100755
File size: 23.0 KB
Line 
1/*
2 =============================================================================
3 scfield.c -- score editor field setup
4 Version 62 -- 1989-11-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "graphdef.h"
12#include "hwdefs.h"
13#include "panel.h"
14#include "macros.h"
15#include "score.h"
16#include "scfns.h"
17#include "curpak.h"
18
19#include "midas.h"
20#include "scdsp.h"
21
22#define PCENTER 256L
23
24/* functions defined elsewhere */
25
26extern char *memset();
27
28extern short cxkstd(), cykstd(), select(), oktode(), stdctp3();
29extern short enterit(), stddkey(), nokey(), stdmkey();
30
31extern short et_strn(), ef_strn(), rd_strn(), nd_strn();
32extern short et_snbt(), ef_snbt(), rd_snbt(), nd_snbt();
33
34extern short et_ioas(), ef_ioas(), rd_ioas(), nd_ioas();
35extern short et_tune(), ef_tune(), rd_tune(), nd_tune();
36extern short et_tmpo(), ef_tmpo(), rd_tmpo(), nd_tmpo();
37extern short et_intp(), ef_intp(), rd_intp(), nd_intp();
38
39extern short et_inst(), ef_inst(), rd_inst(), nd_inst();
40extern short et_trns(), ef_trns(), rd_trns(), nd_trns();
41extern short et_dyn(), ef_dyn(), rd_dyn(), nd_dyn();
42extern short et_loc(), ef_loc(), rd_loc(), nd_loc();
43extern short et_vel(), ef_vel(), rd_vel(), nd_vel();
44
45extern short et_res1(), ef_res1(), rd_res1(), nd_res1();
46extern short et_aval(), ef_aval(), rd_aval(), nd_aval();
47extern short et_agrp(), ef_agrp(), rd_agrp(), nd_agrp();
48
49extern short et_scor(), ef_scor(), rd_scor(), nd_scor();
50
51/* forward references */
52
53short et_null(), ef_null(), rd_null(), nd_null();
54short sdcxu(), sdcyu(), sdxkey(), sdmkey(), scntfld();
55
56/*
57
58*/
59
60/* variables defined elsewhere */
61
62extern short ancmsw;
63extern short angroup;
64extern short astat;
65extern short clkrun;
66extern short cmfirst;
67extern short cmtype;
68extern short curhold;
69extern short curscor;
70extern short cxrate;
71extern short cxval;
72extern short cyrate;
73extern short cyval;
74extern short ebflag;
75extern short hcwval;
76extern short insmode;
77extern short oldpk;
78extern short oldsl;
79extern short pkctrl;
80extern short recsw;
81extern short scmctl;
82extern short sdmctl;
83extern short sliders;
84extern short stccol;
85extern short stcrow;
86extern short thcwval;
87extern short tvcwval;
88extern short vcwval;
89extern short vtccol;
90extern short vtcrow;
91extern short vtxval;
92extern short vtyval;
93
94extern long ctime;
95extern long t_ins;
96
97extern char ebuf[MAXEBUF+1];
98
99extern short crate1[];
100extern short ehdlist[];
101extern short grpmode[];
102extern short grpstat[];
103extern short grptmap[];
104extern short sdmlim[][4];
105extern short varmode[8][16];
106
107extern PFS (*swpt)[];
108extern PFS (*oldsw)[];
109
110extern struct fet *cfetp;
111extern struct fet *curfet;
112extern struct fet *infetp;
113
114extern struct selbox *csbp;
115
116extern struct selbox sdboxes[];
117
118extern struct s_entry *peg;
119
120/*
121
122*/
123
124struct fet sc_fet1[] = {
125
126 { 0, 2, 4, 0x0000, et_strn, ef_strn, rd_strn, nd_strn},
127 { 0, 11, 15, 0x0000, et_snbt, ef_snbt, rd_snbt, nd_snbt},
128
129 {17, 11, 12, 0x0000, et_ioas, ef_ioas, rd_ioas, nd_ioas},
130 {17, 19, 19, 0x0000, et_tune, ef_tune, rd_tune, nd_tune},
131 {17, 27, 29, 0x0000, et_tmpo, ef_tmpo, rd_tmpo, nd_tmpo},
132 {17, 35, 38, 0x0000, et_intp, ef_intp, rd_intp, nd_intp},
133
134 {18, 7, 8, 0, et_inst, ef_inst, rd_inst, nd_inst},
135 {18, 12, 13, 1, et_inst, ef_inst, rd_inst, nd_inst},
136 {18, 17, 18, 2, et_inst, ef_inst, rd_inst, nd_inst},
137 {18, 22, 23, 3, et_inst, ef_inst, rd_inst, nd_inst},
138 {18, 27, 28, 4, et_inst, ef_inst, rd_inst, nd_inst},
139 {18, 32, 33, 5, et_inst, ef_inst, rd_inst, nd_inst},
140 {18, 37, 38, 6, et_inst, ef_inst, rd_inst, nd_inst},
141 {18, 42, 43, 7, et_inst, ef_inst, rd_inst, nd_inst},
142 {18, 47, 48, 8, et_inst, ef_inst, rd_inst, nd_inst},
143 {18, 52, 53, 9, et_inst, ef_inst, rd_inst, nd_inst},
144 {18, 57, 58, 10, et_inst, ef_inst, rd_inst, nd_inst},
145 {18, 62, 63, 11, et_inst, ef_inst, rd_inst, nd_inst},
146
147 {19, 5, 8, 0, et_trns, ef_trns, rd_trns, nd_trns},
148 {19, 10, 13, 1, et_trns, ef_trns, rd_trns, nd_trns},
149 {19, 15, 18, 2, et_trns, ef_trns, rd_trns, nd_trns},
150 {19, 20, 23, 3, et_trns, ef_trns, rd_trns, nd_trns},
151 {19, 25, 28, 4, et_trns, ef_trns, rd_trns, nd_trns},
152 {19, 30, 33, 5, et_trns, ef_trns, rd_trns, nd_trns},
153 {19, 35, 38, 6, et_trns, ef_trns, rd_trns, nd_trns},
154 {19, 40, 43, 7, et_trns, ef_trns, rd_trns, nd_trns},
155 {19, 45, 48, 8, et_trns, ef_trns, rd_trns, nd_trns},
156 {19, 50, 53, 9, et_trns, ef_trns, rd_trns, nd_trns},
157 {19, 55, 58, 10, et_trns, ef_trns, rd_trns, nd_trns},
158 {19, 60, 63, 11, et_trns, ef_trns, rd_trns, nd_trns},
159
160/*
161
162*/
163
164 {20, 6, 6, 0, et_dyn, ef_dyn, rd_dyn, nd_dyn},
165 {20, 8, 8, 0, et_loc, ef_loc, rd_loc, nd_loc},
166
167 {20, 11, 11, 1, et_dyn, ef_dyn, rd_dyn, nd_dyn},
168 {20, 13, 13, 1, et_loc, ef_loc, rd_loc, nd_loc},
169
170 {20, 16, 16, 2, et_dyn, ef_dyn, rd_dyn, nd_dyn},
171 {20, 18, 18, 2, et_loc, ef_loc, rd_loc, nd_loc},
172
173 {20, 21, 21, 3, et_dyn, ef_dyn, rd_dyn, nd_dyn},
174 {20, 23, 23, 3, et_loc, ef_loc, rd_loc, nd_loc},
175
176 {20, 26, 26, 4, et_dyn, ef_dyn, rd_dyn, nd_dyn},
177 {20, 28, 28, 4, et_loc, ef_loc, rd_loc, nd_loc},
178
179 {20, 31, 31, 5, et_dyn, ef_dyn, rd_dyn, nd_dyn},
180 {20, 33, 33, 5, et_loc, ef_loc, rd_loc, nd_loc},
181
182 {20, 36, 36, 6, et_dyn, ef_dyn, rd_dyn, nd_dyn},
183 {20, 38, 38, 6, et_loc, ef_loc, rd_loc, nd_loc},
184
185 {20, 41, 41, 7, et_dyn, ef_dyn, rd_dyn, nd_dyn},
186 {20, 43, 43, 7, et_loc, ef_loc, rd_loc, nd_loc},
187
188 {20, 46, 46, 8, et_dyn, ef_dyn, rd_dyn, nd_dyn},
189 {20, 48, 48, 8, et_loc, ef_loc, rd_loc, nd_loc},
190
191 {20, 51, 51, 9, et_dyn, ef_dyn, rd_dyn, nd_dyn},
192 {20, 53, 53, 9, et_loc, ef_loc, rd_loc, nd_loc},
193
194 {20, 56, 56, 10, et_dyn, ef_dyn, rd_dyn, nd_dyn},
195 {20, 58, 58, 10, et_loc, ef_loc, rd_loc, nd_loc},
196
197 {20, 61, 61, 11, et_dyn, ef_dyn, rd_dyn, nd_dyn},
198 {20, 63, 63, 11, et_loc, ef_loc, rd_loc, nd_loc},
199
200/*
201
202*/
203
204 {21, 6, 8, 0, et_vel, ef_vel, rd_vel, nd_vel},
205 {21, 11, 13, 1, et_vel, ef_vel, rd_vel, nd_vel},
206 {21, 16, 18, 2, et_vel, ef_vel, rd_vel, nd_vel},
207 {21, 21, 23, 3, et_vel, ef_vel, rd_vel, nd_vel},
208 {21, 26, 28, 4, et_vel, ef_vel, rd_vel, nd_vel},
209 {21, 31, 33, 5, et_vel, ef_vel, rd_vel, nd_vel},
210 {21, 36, 38, 6, et_vel, ef_vel, rd_vel, nd_vel},
211 {21, 41, 43, 7, et_vel, ef_vel, rd_vel, nd_vel},
212 {21, 46, 48, 8, et_vel, ef_vel, rd_vel, nd_vel},
213 {21, 51, 53, 9, et_vel, ef_vel, rd_vel, nd_vel},
214 {21, 56, 58, 10, et_vel, ef_vel, rd_vel, nd_vel},
215 {21, 61, 63, 11, et_vel, ef_vel, rd_vel, nd_vel},
216
217
218 {23, 6, 6, 0, et_res1, ef_res1, rd_res1, nd_res1},
219 {23, 8, 12, 0, et_aval, ef_aval, rd_aval, nd_aval},
220
221 {23, 15, 15, 1, et_res1, ef_res1, rd_res1, nd_res1},
222 {23, 17, 21, 1, et_aval, ef_aval, rd_aval, nd_aval},
223
224 {23, 24, 24, 2, et_res1, ef_res1, rd_res1, nd_res1},
225 {23, 26, 30, 2, et_aval, ef_aval, rd_aval, nd_aval},
226
227 {23, 33, 33, 3, et_res1, ef_res1, rd_res1, nd_res1},
228 {23, 35, 39, 3, et_aval, ef_aval, rd_aval, nd_aval},
229
230 {23, 42, 42, 4, et_res1, ef_res1, rd_res1, nd_res1},
231 {23, 44, 48, 4, et_aval, ef_aval, rd_aval, nd_aval},
232
233 {23, 51, 51, 5, et_res1, ef_res1, rd_res1, nd_res1},
234 {23, 53, 57, 5, et_aval, ef_aval, rd_aval, nd_aval},
235
236 {23, 61, 62, 0, et_agrp, ef_agrp, rd_agrp, nd_agrp},
237
238 {24, 7, 8, 0x0000, et_scor, ef_scor, rd_scor, nd_scor},
239 {24, 10, 25, 0x0000, et_null, ef_null, rd_null, nd_null},
240
241
242 { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
243};
244
245/*
246
247*/
248
249struct curpak sc_flds = {
250
251 stdctp3, /* curtype */
252 nokey, /* premove */
253 nokey, /* pstmove */
254 cxkstd, /* cx_key */
255 cykstd, /* cy_key */
256 sdcxu, /* cx_upd */
257 sdcyu, /* cy_upd */
258 nokey, /* xy_up */
259 nokey, /* xy_dn */
260 sdxkey, /* x_key */
261 select, /* e_key */
262 sdmkey, /* m_key */
263 stddkey, /* d_key */
264 scntfld, /* not_fld */
265 sc_fet1, /* curfet */
266 sdboxes, /* csbp */
267 crate1, /* cratex */
268 crate1, /* cratey */
269 CT_GRAF, /* cmtype */
270 C1X, /* cxval */
271 C1Y /* cyval */
272};
273
274/*
275
276*/
277
278/*
279 =============================================================================
280 et_null() .. nd_null() -- null data entry key processors
281 =============================================================================
282*/
283
284short /* null et_... */
285et_null()
286{
287 return(SUCCESS);
288}
289
290short /* null ef_... */
291ef_null()
292{
293 return(SUCCESS);
294}
295
296short /* null rd_... */
297rd_null()
298{
299 return(SUCCESS);
300}
301
302short /* null nd_... */
303nd_null()
304{
305 return(SUCCESS);
306}
307
308/*
309
310*/
311
312/*
313 =============================================================================
314 istart() -- start insert mode
315 =============================================================================
316*/
317
318istart()
319{
320 register struct s_entry *ep, *pp, *tp;
321
322 if (insmode) /* can't already be inserting */
323 return;
324
325 ep = ep_adj(p_cur, 1, t_cur); /* locate tail */
326
327 if (EV_SCORE EQ (0x007F & ep->e_type)) /* skip begin score event */
328 ep = ep->e_fwd;
329
330 if (EV_FINI EQ (0x007F & ep->e_type)) /* null if at end of score */
331 return;
332
333 tp = scores[curscor]->e_bak; /* locate end of score */
334 pp = ep->e_bak; /* locate end of head */
335
336 ep->e_bak = E_NULL; /* unhook tail from head */
337 pp->e_fwd = tp; /* unhook head from tail */
338 (tp->e_bak)->e_fwd = E_NULL; /* unhook tail from end */
339
340 tp->e_bak = pp; /* connect end to head */
341
342 t_ins = t_cur; /* record tail time */
343 peg = ep; /* hang tail on peg */
344
345 p_cur = ep_adj(pp, 0, t_cur); /* adjust p_cur */
346 p_ctr = p_cur; /* adjust p_ctr */
347 p_bak = ep_adj(p_cur, 0, t_bak); /* adjust p_bak */
348 p_fwd = ep_adj(p_cur, 0, t_fwd); /* adjust p_fwd */
349
350 insmode = TRUE;
351}
352
353/*
354
355*/
356
357/*
358 =============================================================================
359 icancel() -- cancel insert mode
360 =============================================================================
361*/
362
363icancel()
364{
365 register struct s_entry *ep, *tp, *rp;
366 struct s_entry *pp;
367 long endtime;
368
369 if (NOT insmode)
370 return;
371
372 tp = scores[curscor]->e_bak; /* locate end of score */
373 pp = tp->e_bak; /* locate end of head */
374
375 endtime = pp->e_time; /* find last time in score */
376
377 if (t_cur > endtime) /* use max of t_cur, endtime */
378 endtime = t_cur;
379
380 rp = peg; /* point at start of tail */
381
382 while (E_NULL NE rp) { /* scan each event in the tail */
383
384 ep = rp; /* update pointers */
385 rp = ep->e_fwd;
386
387 ep->e_time = (ep->e_time - t_ins) + endtime; /* adjust time */
388 }
389
390 ep->e_fwd = tp; /* connect tail to end */
391 tp->e_bak = ep; /* connect end to tail */
392
393 pp->e_fwd = peg; /* connect head to tail */
394 peg->e_bak = pp; /* connect tail to head */
395
396 p_cur = ep_adj(pp, 0, t_cur); /* adjust p_cur */
397 p_ctr = p_cur; /* adjust p_ctr */
398 p_bak = ep_adj(p_cur, 0, t_bak); /* adjust p_bak */
399 p_fwd = ep_adj(p_cur, 0, t_fwd); /* adjust p_fwd */
400
401 insmode = FALSE;
402}
403
404/*
405
406*/
407
408/*
409 =============================================================================
410 sdcxu() -- score cursor x update processing
411 =============================================================================
412*/
413
414sdcxu()
415{
416 if (sdmctl EQ 0) { /* typewriter up */
417
418 vtcxupd();
419
420 } else if (sdmctl > 0) { /* menu up */
421
422 vtccol = XTOC(vtxval += cxrate);
423
424 if (vtccol > sdmlim[sdmctl][3])
425 vtxval = CTOX(vtccol = sdmlim[sdmctl][3]);
426 else if (vtccol < sdmlim[sdmctl][1])
427 vtxval = CTOX(vtccol = sdmlim[sdmctl][1]);
428
429 } else { /* no menu showing */
430
431 cxval += cxrate;
432
433 if (cxval > CXMAX)
434 cxval = CXMAX;
435 else if (cxval < 0)
436 cxval = 0;
437 }
438
439 return;
440}
441
442/*
443
444*/
445
446/*
447 =============================================================================
448 sdcyu() -- score cursor y update processing
449 =============================================================================
450*/
451
452sdcyu()
453{
454 if (sdmctl EQ 0) {
455
456 vtcyupd();
457
458 } else if (sdmctl > 0) { /* menu up */
459
460 vtcrow = YTOR(vtyval += cyrate);
461
462 if (vtcrow < sdmlim[sdmctl][0])
463 vtyval = RTOY(vtcrow = sdmlim[sdmctl][0]);
464 else if (vtcrow > sdmlim[sdmctl][2])
465 vtyval = RTOY(vtcrow = sdmlim[sdmctl][2]);
466
467 } else { /* no menu showing */
468
469 cyval += cyrate;
470
471 if (cyval > CYMAX)
472 cyval = CYMAX;
473 else if (cyval < 0)
474 cyval = 0;
475
476 }
477
478 return;
479}
480
481/*
482
483*/
484
485/*
486 =============================================================================
487 scntfld() -- not-in-field data entry key processing
488 =============================================================================
489*/
490
491short
492scntfld(k)
493short k;
494{
495 register short grp, fnc, var;
496
497 if (NOT astat)
498 return(FAILURE);
499
500 if (stcrow EQ 18) { /* group status or mode */
501
502 if (stccol LT 5)
503 return(FAILURE);
504
505 grp = (stccol - 5) / 5; /* group */
506 fnc = (stccol - 5) % 5; /* status or mode */
507
508 if (fnc EQ 0) { /* status */
509
510 if (k EQ 8) { /* '-' */
511
512 grpstat[grp] = FALSE;
513 dsgstat(grp);
514 return(SUCCESS);
515
516 } else if (k EQ 9) { /* '+' */
517
518 grpstat[grp] = TRUE;
519 dsgstat(grp);
520 return(SUCCESS);
521
522 } else
523 return(FAILURE);
524/*
525
526*/
527 } else if (fnc EQ 1) { /* mode */
528
529 if (k EQ 8) { /* '-' */
530
531 grpmode[grp] = 0;
532 dsgmode(grp);
533 return(SUCCESS);
534
535 } else if (k EQ 9) { /* '+' */
536
537 if (++grpmode[grp] GT 1)
538 grpmode[grp] = 2;
539
540 dsgmode(grp);
541 return(SUCCESS);
542
543 } else
544 return(FAILURE);
545
546 } else
547 return(FAILURE);
548/*
549
550*/
551 } else if (stcrow EQ 22) { /* analog variables */
552
553 if (stccol < 5)
554 return(FAILURE);
555
556 var = (stccol - 5) / 9; /* variable */
557 fnc = (stccol - 5) % 9; /* field column */
558 grp = abs(angroup) - 1; /* group */
559
560 if (fnc EQ 0) { /* mode column */
561
562 if (k EQ 8) { /* '-' */
563
564 varmode[var][grp] = 0;
565 dsvmode(var);
566 return(SUCCESS);
567
568 } else if (k EQ 9) { /* '+' */
569
570 if (++varmode[var][grp] GT 1)
571 varmode[var][grp] = 2;
572
573 dsvmode(var);
574 return(SUCCESS);
575 }
576 }
577 }
578
579 return(FAILURE);
580}
581
582/*
583
584*/
585
586/*
587 =============================================================================
588 cp2time() -- check cursor position and convert it to time
589
590 Sets 'ctime' if the cursor x argument, 'cx', is within the score.
591 =============================================================================
592*/
593
594short
595cp2time(cx)
596short cx;
597{
598 register long ct;
599
600 ct = t_cur + ((long)cx - PCENTER);
601
602 if (ct < 0L) /* if out of score time range */
603 return(FALSE); /* ... return FALSE */
604
605 ctime = ct; /* set ctime */
606 return(TRUE); /* ... and return TRUE */
607}
608
609/*
610
611*/
612
613/*
614 =============================================================================
615 delevts() -- delete record enabled non-note events at current time
616 =============================================================================
617*/
618
619short
620delevts(etp, thetime)
621register short etp;
622register long thetime;
623{
624 register struct s_entry *ep, *np;
625 register short et;
626 register short rc;
627 register short dsw;
628
629 rc = FALSE; /* intialize return code */
630
631 ep = ep_adj(p_cur, 1, thetime); /* start at left end of chain */
632
633/*
634
635*/
636 while (ep->e_time EQ thetime) { /* for each event at ctime ... */
637
638 np = ep->e_fwd; /* get next event pointer */
639 et = 0x007F & ep->e_type; /* get type */
640 dsw = oktode(ep); /* get deletion status */
641
642 if (dsw AND /* delete event if it's deletable ... */
643 ((etp EQ -1) OR (et EQ etp))) { /* ... and the right kind */
644
645 rc = TRUE;
646
647 if (-1 NE ehdlist[et]) /* if this is a header event ... */
648 eh_rmv(ep, ehdlist[et]); /* remove from hdr list */
649
650 /* fix up any effected pointers */
651
652 if (p_bak EQ ep)
653 p_bak = np;
654
655 if (p_cur EQ ep)
656 p_cur = np;
657
658 if (p_ctr EQ ep)
659 p_ctr = np;
660
661 if (p_fwd EQ ep)
662 p_fwd = np;
663
664 e_del(e_rmv(ep)); /* delete the event */
665 }
666
667 ep = np;
668 }
669
670 if (rc) /* if anything was deleted ... */
671 sc_refr(t_cur); /* ... update the display */
672
673 return(rc);
674}
675
676/*
677
678*/
679
680/*
681 =============================================================================
682 deladat() -- delete analog varaible data
683 =============================================================================
684*/
685
686short
687deladat()
688{
689 register struct s_entry *ep, *rp;
690 register short grp, rc, var, vc, vn;
691
692 rc = FALSE;
693
694 if (stccol < 6) /* pointing at var ? */
695 return(rc);
696
697 vn = (stccol - 6) / 9; /* variable number */
698 vc = (stccol - 6) % 9; /* variable column */
699
700 ep = ep_adj(p_cur, 1, t_cur); /* start at left end of chain */
701
702 if (vc EQ 0) { /* resolution */
703
704 while (t_cur EQ ep->e_time) {
705
706 rp = ep->e_fwd;
707
708 if (EV_ANRS EQ (0x007F & ep->e_type)) {
709
710 grp = 0x000F & ep->e_data1;
711 var = 0x000F & (ep->e_data1 >> 4);
712
713 if ((var EQ vn) AND grpstat[grp] AND
714 (2 EQ (ancmsw ? varmode[var][grp] :
715 grpmode[grp]))) {
716
717 /* fix pointers */
718
719 if (p_bak EQ ep)
720 p_bak = rp;
721
722 if (p_cur EQ ep)
723 p_cur = rp;
724
725 if (p_ctr EQ ep)
726 p_ctr = rp;
727
728 if (p_fwd EQ ep)
729 p_fwd = rp;
730
731 /* delete event */
732
733 eh_rmv(ep, EH_ANRS);
734 e_del(e_rmv(ep));
735 rc = TRUE;
736 }
737 }
738
739 ep = rp; /* next event */
740 }
741/*
742
743*/
744 } else if ((vc GE 2) AND (vc LE 6)) { /* value */
745
746 while (t_cur EQ ep->e_time) {
747
748 rp = ep->e_fwd;
749
750 if (EV_ANVL EQ (0x007F & ep->e_type)) {
751
752 grp = 0x000F & ep->e_data1;
753 var = 0x000F & (ep->e_data1 >> 4);
754
755 if ((var EQ vn) AND grpstat[grp] AND
756 (2 EQ (ancmsw ? varmode[var][grp] :
757 grpmode[grp]))) {
758
759 /* fix pointers */
760
761 if (p_bak EQ ep)
762 p_bak = rp;
763
764 if (p_cur EQ ep)
765 p_cur = rp;
766
767 if (p_ctr EQ ep)
768 p_ctr = rp;
769
770 if (p_fwd EQ ep)
771 p_fwd = rp;
772
773 e_del(e_rmv(ep)); /* delete */
774 rc = TRUE;
775 }
776 }
777
778 ep = rp; /* next event */
779 }
780 }
781
782 if (rc) { /* refresh the screen if it changed */
783
784 sc_refr(fc_val);
785 ds_anrs();
786 ds_anvl();
787 }
788
789 return(rc);
790}
791
792/*
793
794*/
795
796/*
797 =============================================================================
798 sdxkey() -- score delete key processing
799 =============================================================================
800*/
801
802sdxkey()
803{
804 register short col, grp, sect;
805 register struct s_entry *ep, *rp;
806
807 if (NOT astat) /* only do when key goes down */
808 return;
809
810 if (clkrun) /* ... and not while clock is running */
811 return;
812
813 if (scmctl NE -1) /* ... and area 1 menu is down */
814 return;
815/*
816
817*/
818 if (sdmctl EQ 4) { /* section menu is up */
819
820 if (((vtcrow EQ 19) OR (vtcrow EQ 20)) AND
821 (vtccol GE 24)) {
822
823 if (NOT recsw)
824 return;
825
826 /* set up to delete a section marker */
827
828 sect = ((vtccol - 24) >> 2) + ((vtcrow EQ 20) ? 10 : 0);
829 col = (vtccol - 24) & 3;
830
831 switch (col) {
832
833 case 0: /* delete begin section */
834
835
836 if (E_NULL NE (ep = seclist[curscor][sect])) {
837
838 /* fix pointers */
839
840 rp = ep->e_fwd;
841
842 if (p_bak EQ ep)
843 p_bak = rp;
844
845 if (p_cur EQ ep)
846 p_cur = rp;
847
848 if (p_ctr EQ ep)
849 p_ctr = rp;
850
851 if (p_fwd EQ ep)
852 p_fwd = rp;
853
854 eh_rmv(ep, EH_SBGN); /* delete */
855 e_del(e_rmv(ep));
856 seclist[curscor][sect] = E_NULL;
857 sdmenu(-1); /* take down menu */
858 sc_refr(fc_val); /* refresh screen */
859 }
860
861 break;
862/*
863
864*/
865 case 1: /* section number */
866 case 2:
867 break;
868
869 case 3: /* delete end section */
870
871 if (E_NULL NE
872 (ep = ehfind(EV_SEND, -1L, sect, -1))) {
873
874 /* fix pointers */
875
876 rp = ep->e_fwd;
877
878 if (p_bak EQ ep)
879 p_bak = rp;
880
881 if (p_cur EQ ep)
882 p_cur = rp;
883
884 if (p_ctr EQ ep)
885 p_ctr = rp;
886
887 if (p_fwd EQ ep)
888 p_fwd = rp;
889
890 eh_rmv(ep, EH_SEND); /* delete */
891 e_del(e_rmv(ep));
892 sdmenu(-1); /* take down menu */
893 sc_refr(fc_val); /* refresh screen */
894 }
895
896 break;
897 }
898
899 return;
900
901/*
902
903*/
904 } else if ((vtcrow EQ 23) AND
905 (vtccol GE 28) AND (vtccol LE 62)) {
906
907 /* group map entry */
908
909 col = vtccol - 28;
910
911 if (2 EQ (col % 3))
912 return;
913
914 grp = col / 3;
915 grptmap[grp] = -1;
916 dsgtme(grp);
917 return;
918 }
919 }
920
921 if (NOT recsw) /* do only if recording */
922 return;
923
924 if ((cyval GE 14) AND (cyval LE 223)) { /* notes */
925
926 delnote(); /* delete a note */
927
928 } else if ((cyval GE 224) AND (cyval LE 237)) { /* new data */
929
930 if (cp2time(cxval))
931 delevts(-1, ctime); /* delete all events at cursor */
932
933/*
934
935*/
936
937 } else if (stcrow EQ 17) {
938
939 if ((stccol GE 11) AND (stccol LE 12))
940 delevts(EV_ASGN, t_cur); /* assignment */
941 else if (stccol EQ 19)
942 delevts(EV_TUNE, t_cur); /* tuning */
943 else if ((stccol GE 27) AND (stccol LE 29))
944 delevts(EV_TMPO, t_cur); /* tempo */
945 else if ((stccol GE 36) AND (stccol LE 38))
946 delevts(EV_INTP, t_cur); /* interpolation */
947 else if ((stccol GE 40) AND (stccol LE 43))
948 delevts(EV_STOP, t_cur); /* stop */
949 else if ((stccol GE 45) AND (stccol LE 48))
950 delevts(EV_NEXT, t_cur); /* next */
951 else if ((stccol GE 50) AND (stccol LE 55))
952 delevts(EV_PNCH, t_cur); /* punch in/out */
953
954 } else if ((stcrow EQ 18) AND
955 (0 EQ ((stccol - 5) % 5))) { /* group status */
956
957 delevts(EV_GRP, t_cur);
958
959 } else if ((stcrow EQ 18) AND
960 ((2 EQ ((stccol - 5) % 5)) OR
961 (3 EQ ((stccol - 5) % 5)))) { /* instrument */
962
963 delevts(EV_INST, t_cur);
964
965 } else if (stcrow EQ 19) { /* transposition */
966
967 delevts(EV_TRNS, t_cur);
968
969 } else if ((stcrow EQ 20) AND (stccol GE 6) AND
970 (0 EQ ((stccol - 6) % 5))) { /* dynamics */
971
972 delevts(EV_DYN, t_cur);
973
974 } else if ((stcrow EQ 20) AND (stccol GE 6) AND
975 (2 EQ ((stccol - 6) % 5))) { /* location */
976
977 delevts(EV_LOCN, t_cur);
978
979 } else if (stcrow EQ 23) { /* analog */
980
981 deladat();
982/*
983
984*/
985 } else if (stcrow EQ 24) { /* score */
986
987 if (stccol LE 4) {
988
989 /* clear score */
990
991 if (insmode) /* cancel insert mode */
992 icancel();
993
994 sc_clr(curscor); /* clear score itself */
995 selscor(curscor); /* refresh the display */
996
997 } else if ((stccol GE 10) AND (stccol LE 25)) {
998
999 /* clear score name */
1000
1001 memset(scname[curscor], ' ', 16);
1002 dswin(13);
1003 }
1004 }
1005}
1006
1007/*
1008
1009*/
1010
1011/*
1012 =============================================================================
1013 sdmkey() -- score display menu key processor
1014 =============================================================================
1015*/
1016
1017sdmkey()
1018{
1019 if (astat) {
1020
1021 if (insmode)
1022 icancel();
1023 }
1024
1025 stdmkey();
1026}
1027
1028/*
1029
1030*/
1031
1032/*
1033 =============================================================================
1034 scfield() -- setup field routines for the score display
1035 =============================================================================
1036*/
1037
1038scfield()
1039{
1040 curset(&sc_flds);
1041}
Note: See TracBrowser for help on using the repository browser.