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