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