source: buchla-68k/ram/scselbx.c@ cbe2c15

Last change on this file since cbe2c15 was df097bf, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Code compiles, doesn't link.

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