[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etaopt.c -- assignment editor - MIDI output port number field handlers
|
---|
| 4 | Version 4 -- 1987-12-11 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "stddefs.h"
|
---|
| 9 | #include "fields.h"
|
---|
| 10 | #include "vsdd.h"
|
---|
| 11 | #include "vsddsw.h"
|
---|
| 12 | #include "graphdef.h"
|
---|
| 13 |
|
---|
| 14 | #include "midas.h"
|
---|
| 15 | #include "asgdsp.h"
|
---|
| 16 |
|
---|
| 17 | extern unsigned *asgob;
|
---|
| 18 |
|
---|
| 19 | extern short stcrow, stccol;
|
---|
| 20 | extern short curmop;
|
---|
| 21 |
|
---|
| 22 | extern short adbox[][8];
|
---|
| 23 |
|
---|
| 24 | extern char dspbuf[];
|
---|
| 25 |
|
---|
| 26 | extern char *gprep[];
|
---|
| 27 |
|
---|
| 28 | /* |
---|
| 29 |
|
---|
| 30 | */
|
---|
| 31 |
|
---|
| 32 | /*
|
---|
| 33 | =============================================================================
|
---|
| 34 | et_aopt() -- load the edit buffer
|
---|
| 35 | =============================================================================
|
---|
| 36 | */
|
---|
[0580615] | 37 |
|
---|
[f40a309] | 38 | short et_aopt(short n)
|
---|
| 39 | {
|
---|
| 40 | sprintf(ebuf, "%01.1d", curmop);
|
---|
| 41 | ebflag = TRUE;
|
---|
| 42 |
|
---|
| 43 | return(SUCCESS);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | /*
|
---|
| 47 | =============================================================================
|
---|
| 48 | ef_aopt() -- parse (unload) the edit buffer
|
---|
| 49 | =============================================================================
|
---|
| 50 | */
|
---|
[0580615] | 51 |
|
---|
[f40a309] | 52 | short ef_aopt(short n)
|
---|
| 53 | {
|
---|
| 54 | register short tmpval;
|
---|
| 55 |
|
---|
| 56 | ebuf[1] = '\0'; /* terminate the string in ebuf */
|
---|
| 57 | ebflag = FALSE;
|
---|
| 58 |
|
---|
| 59 | tmpval = ebuf[0] - '0';
|
---|
| 60 |
|
---|
| 61 | if (tmpval GT 3)
|
---|
| 62 | return(FAILURE);
|
---|
| 63 |
|
---|
| 64 | curmop = tmpval;
|
---|
| 65 | modasg();
|
---|
| 66 | return(SUCCESS);
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | /* |
---|
| 70 |
|
---|
| 71 | */
|
---|
| 72 |
|
---|
| 73 | /*
|
---|
| 74 | =============================================================================
|
---|
| 75 | rd_aopt() -- (re)display the field
|
---|
| 76 | =============================================================================
|
---|
[0580615] | 77 | */
|
---|
[f40a309] | 78 |
|
---|
| 79 | short rd_aopt(short nn)
|
---|
| 80 | {
|
---|
| 81 | register short n;
|
---|
| 82 |
|
---|
| 83 | n = nn & 0xFF;
|
---|
| 84 |
|
---|
| 85 | vbank(0);
|
---|
| 86 | vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
|
---|
| 87 | adbox[n][6], adbox[n][7] + 9, gprep[curmop], 14);
|
---|
| 88 |
|
---|
| 89 | return(SUCCESS);
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | /*
|
---|
| 93 | =============================================================================
|
---|
| 94 | nd_aopt() -- handle new data entry
|
---|
| 95 | =============================================================================
|
---|
[0580615] | 96 | */
|
---|
[f40a309] | 97 |
|
---|
| 98 | short nd_aopt(short nn, short k)
|
---|
| 99 | {
|
---|
| 100 | register short n;
|
---|
| 101 |
|
---|
| 102 | if ((k < 1) OR (k > 2))
|
---|
| 103 | return(FAILURE);
|
---|
| 104 |
|
---|
| 105 | n = nn & 0xFF;
|
---|
| 106 | ebuf[0] = k + '0';
|
---|
| 107 | ebuf[1] = '\0';
|
---|
| 108 |
|
---|
| 109 | dspbuf[0] = k + '0';
|
---|
| 110 | dspbuf[1] = '\0';
|
---|
| 111 |
|
---|
| 112 | vbank(0);
|
---|
| 113 | vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
|
---|
| 114 |
|
---|
| 115 | return(SUCCESS);
|
---|
| 116 | }
|
---|
| 117 |
|
---|