mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-30 17:26:31 +00:00
d0cafb0198
Update and fix more documentation. Alter Splash messages and logo color.
959 lines
101 KiB
HTML
Executable file
959 lines
101 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.06">
|
|
<style type="text/css">
|
|
body {background-color:#000000;}
|
|
.cF0{color:#ffffff;background-color:#000000;}
|
|
.cF1{color:#3465a4;background-color:#000000;}
|
|
.cF2{color:#4e9a06;background-color:#000000;}
|
|
.cF3{color:#06989a;background-color:#000000;}
|
|
.cF4{color:#a24444;background-color:#000000;}
|
|
.cF5{color:#75507b;background-color:#000000;}
|
|
.cF6{color:#ce982f;background-color:#000000;}
|
|
.cF7{color:#bcc0b9;background-color:#000000;}
|
|
.cF8{color:#555753;background-color:#000000;}
|
|
.cF9{color:#729fcf;background-color:#000000;}
|
|
.cFA{color:#82bc49;background-color:#000000;}
|
|
.cFB{color:#34e2e2;background-color:#000000;}
|
|
.cFC{color:#ac3535;background-color:#000000;}
|
|
.cFD{color:#ad7fa8;background-color:#000000;}
|
|
.cFE{color:#fce94f;background-color:#000000;}
|
|
.cFF{color:#000000;background-color:#000000;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>define</span><span class=cF0> PSMR_FLAT -</span><span class=cFE>8</span><span class=cF0>
|
|
<a name="l2"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_SHARP -</span><span class=cFE>7</span><span class=cF0>
|
|
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_TIE -</span><span class=cFE>6</span><span class=cF0>
|
|
<a name="l4"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_REST -</span><span class=cFE>5</span><span class=cF0>
|
|
<a name="l5"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_INS_NOTE -</span><span class=cFE>4</span><span class=cF0>
|
|
<a name="l6"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_DELETE_NOTE -</span><span class=cFE>3</span><span class=cF0>
|
|
<a name="l7"></a>#</span><span class=cF1>define</span><span class=cF0> PSMR_SET_WORD -</span><span class=cFE>2</span><span class=cF0>
|
|
<a name="l8"></a>
|
|
<a name="l9"></a></span><span class=cF1>F64</span><span class=cF0> PopUpDuration()
|
|
<a name="l10"></a>{
|
|
<a name="l11"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l12"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocNew</span><span class=cF0>;
|
|
<a name="l13"></a>
|
|
<a name="l14"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,
|
|
<a name="l15"></a> </span><span class=cF6>"$GREEN$$MU,\"Set Word\",LE=PSMR_SET_WORD$\n"</span><span class=cF0>
|
|
<a name="l16"></a> </span><span class=cF6>"$MU,\"Toggle Sharp\",LE=PSMR_SHARP$\n"</span><span class=cF0>
|
|
<a name="l17"></a> </span><span class=cF6>"$MU,\"Toggle Flat\",LE=PSMR_FLAT$\n"</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF6>"$MU,\"Toggle Tie\",LE=PSMR_TIE$\n"</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF6>"$MU,\"Make Rest\",LE=PSMR_REST$\n"</span><span class=cF0>
|
|
<a name="l20"></a> </span><span class=cF6>"$MU,\"Insert Note\",LE=PSMR_INS_NOTE$\n"</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF6>"$MU,\"Delete Note\",LE=PSMR_DELETE_NOTE$\n\n"</span><span class=cF0>);
|
|
<a name="l22"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < PSM_DURATIONS_NUM; i++)
|
|
<a name="l23"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$MU,\"%7.5f\",LE=%d$\n"</span><span class=cF0>, psm_durations[i], i);
|
|
<a name="l24"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"\n$MU,\"CANCEL\",LE=DOCM_CANCEL$\n"</span><span class=cF0>);
|
|
<a name="l25"></a> i = </span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
|
|
<a name="l26"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
|
<a name="l27"></a>
|
|
<a name="l28"></a> </span><span class=cF1>return</span><span class=cF0> i;
|
|
<a name="l29"></a>}
|
|
<a name="l30"></a>
|
|
<a name="l31"></a></span><span class=cF1>U0</span><span class=cF0> PsmRightClick(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l32"></a>{
|
|
<a name="l33"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *st2;
|
|
<a name="l34"></a> PsmNote *tmpn, *tmpn1;
|
|
<a name="l35"></a> </span><span class=cF9>I64</span><span class=cF0> i, old_doc_flags;
|
|
<a name="l36"></a>
|
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l38"></a> old_doc_flags = </span><span class=cF5>DocPut</span><span class=cF0>->flags;
|
|
<a name="l39"></a> psm.cur_note = tmpn = PsmFindNote(x, y);
|
|
<a name="l40"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn != &psm.head)
|
|
<a name="l41"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l42"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_USER_TASK_DEFAULT</span><span class=cF0>;
|
|
<a name="l43"></a> i = PopUpDuration;
|
|
<a name="l44"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i < PSM_DURATIONS_NUM)
|
|
<a name="l45"></a> {
|
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE)
|
|
<a name="l47"></a> tmpn->duration=i;
|
|
<a name="l48"></a> }
|
|
<a name="l49"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l50"></a> {
|
|
<a name="l51"></a> </span><span class=cF1>switch</span><span class=cF0> (i)
|
|
<a name="l52"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l53"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_REST:
|
|
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE)
|
|
<a name="l55"></a> tmpn->ona = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l56"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l57"></a>
|
|
<a name="l58"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_SHARP:
|
|
<a name="l59"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE && tmpn->ona)
|
|
<a name="l60"></a> {
|
|
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Btr</span><span class=cF7>(</span><span class=cF0>&tmpn->flags, PSMf_FLAT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l62"></a> tmpn->ona++;
|
|
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Btc</span><span class=cF7>(</span><span class=cF0>&tmpn->flags, PSMf_SHARP</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l64"></a> tmpn->ona--;
|
|
<a name="l65"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l66"></a> tmpn->ona++;
|
|
<a name="l67"></a> }
|
|
<a name="l68"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l69"></a>
|
|
<a name="l70"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_FLAT:
|
|
<a name="l71"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE && tmpn->ona)
|
|
<a name="l72"></a> {
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Btr</span><span class=cF7>(</span><span class=cF0>&tmpn->flags, PSMf_SHARP</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l74"></a> tmpn->ona--;
|
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Btc</span><span class=cF7>(</span><span class=cF0>&tmpn->flags, PSMf_FLAT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l76"></a> tmpn->ona++;
|
|
<a name="l77"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l78"></a> tmpn->ona--;
|
|
<a name="l79"></a> }
|
|
<a name="l80"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l81"></a>
|
|
<a name="l82"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_TIE:
|
|
<a name="l83"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE)
|
|
<a name="l84"></a> </span><span class=cF5>Btc</span><span class=cF0>(&tmpn->flags, PSMf_TIE);
|
|
<a name="l85"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l86"></a>
|
|
<a name="l87"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_SET_WORD:
|
|
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE)
|
|
<a name="l89"></a> {
|
|
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l91"></a> </span><span class=cF5>DocPut</span><span class=cF0>->flags &= ~</span><span class=cF3>DOCF_FORM</span><span class=cF0>;
|
|
<a name="l92"></a> </span><span class=cF1>if</span><span class=cF0> (PsmHasWords</span><span class=cF7>(</span><span class=cF0>tmpn->word</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l93"></a> st2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"\nWord(\"%Q\"):"</span><span class=cF0>, tmpn->word);
|
|
<a name="l94"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l95"></a> st2 = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"\nWord(\"\"):"</span><span class=cF0>);
|
|
<a name="l96"></a> </span><span class=cF5>DocBottom</span><span class=cF0>;
|
|
<a name="l97"></a> st = </span><span class=cF5>StrGet</span><span class=cF0>(st2);
|
|
<a name="l98"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l99"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpn->word);
|
|
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (*st)
|
|
<a name="l101"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l102"></a> tmpn->word = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%q"</span><span class=cF0>, st);
|
|
<a name="l103"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l104"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l105"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l106"></a> tmpn->word = </span><span class=cF5>StrNew</span><span class=cF0>(</span><span class=cF6>" "</span><span class=cF0>);
|
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l108"></a> </span><span class=cF5>DocPut</span><span class=cF0>->flags = </span><span class=cF5>DocPut</span><span class=cF0>->flags & ~</span><span class=cF3>DOCF_FORM</span><span class=cF0> | old_doc_flags & </span><span class=cF3>DOCF_FORM</span><span class=cF0>;
|
|
<a name="l109"></a> }
|
|
<a name="l110"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l111"></a>
|
|
<a name="l112"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_INS_NOTE:
|
|
<a name="l113"></a> tmpn1 = PsmNoteCopy(tmpn);
|
|
<a name="l114"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpn1, tmpn);
|
|
<a name="l115"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l116"></a>
|
|
<a name="l117"></a> </span><span class=cF1>case</span><span class=cF0> PSMR_DELETE_NOTE:
|
|
<a name="l118"></a> psm.cur_note = tmpn->next;
|
|
<a name="l119"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpn);
|
|
<a name="l120"></a> PsmNoteDel(tmpn);
|
|
<a name="l121"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l122"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l123"></a> }
|
|
<a name="l124"></a> PsmSetWidth(psm.cur_note);
|
|
<a name="l125"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> - </span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0> - </span><span class=cF3>WIF_FOCUS_TASK_MENU</span><span class=cF0> - </span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>;
|
|
<a name="l126"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l127"></a>}
|
|
<a name="l128"></a>
|
|
<a name="l129"></a></span><span class=cF1>U0</span><span class=cF0> PsmLeftClickPickNoteBox(</span><span class=cF9>I64</span><span class=cF0> duration)
|
|
<a name="l130"></a>{
|
|
<a name="l131"></a> </span><span class=cF9>I64</span><span class=cF0> o, n, message_code, arg1, arg2;
|
|
<a name="l132"></a> PsmNote *tmpn, *tmpn1;
|
|
<a name="l133"></a>
|
|
<a name="l134"></a> </span><span class=cF1>do</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l136"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>);
|
|
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>)
|
|
<a name="l138"></a> {
|
|
<a name="l139"></a> DrawDC2;
|
|
<a name="l140"></a> DrawNote(psm.dc2, arg1, arg2, duration);
|
|
<a name="l141"></a> }
|
|
<a name="l142"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l143"></a> </span><span class=cF1>while</span><span class=cF0> (message_code != </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>);
|
|
<a name="l144"></a>
|
|
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 < </span><span class=cFE>13</span><span class=cF0> * </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>)
|
|
<a name="l146"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (arg1 > psm.head.last->x)
|
|
<a name="l148"></a> tmpn1 = psm.head.last;
|
|
<a name="l149"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (arg1 < psm.head.next->x)
|
|
<a name="l150"></a> tmpn1 = &psm.head;
|
|
<a name="l151"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l152"></a> tmpn1 = PsmFindNote(arg1 - PSM_NOTE_SPACING / </span><span class=cFE>2</span><span class=cF0>, arg2);
|
|
<a name="l153"></a> tmpn = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>PsmNote</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l154"></a> tmpn->type = PSMT_NOTE;
|
|
<a name="l155"></a> arg2 = arg2 / </span><span class=cFE>4</span><span class=cF0> - </span><span class=cFE>15</span><span class=cF0>;
|
|
<a name="l156"></a> n = arg2 % </span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l157"></a> o = </span><span class=cFE>4</span><span class=cF0> + arg2 / -</span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l158"></a> </span><span class=cF1>if</span><span class=cF0> (n < </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l159"></a> {
|
|
<a name="l160"></a> n += </span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l161"></a> o++;
|
|
<a name="l162"></a> }
|
|
<a name="l163"></a> n = psm_note_inverse_map[n];
|
|
<a name="l164"></a> </span><span class=cF1>if</span><span class=cF0> (n < </span><span class=cFE>3</span><span class=cF0>)
|
|
<a name="l165"></a> o--;
|
|
<a name="l166"></a> tmpn->ona = </span><span class=cF5>Note2Ona</span><span class=cF0>(n, o);
|
|
<a name="l167"></a> tmpn->duration = duration;
|
|
<a name="l168"></a> PsmSetWidth(tmpn);
|
|
<a name="l169"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpn, tmpn1);
|
|
<a name="l170"></a> psm.cur_note = tmpn->next;
|
|
<a name="l171"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l172"></a> DrawDC2;
|
|
<a name="l173"></a>}
|
|
<a name="l174"></a>
|
|
<a name="l175"></a></span><span class=cF1>U0</span><span class=cF0> PsmLeftClickPickMeterBox(</span><span class=cF9>I64</span><span class=cF0> top, </span><span class=cF9>I64</span><span class=cF0> bottom)
|
|
<a name="l176"></a>{
|
|
<a name="l177"></a> </span><span class=cF9>I64</span><span class=cF0> message_code, arg1, arg2;
|
|
<a name="l178"></a> PsmNote *tmpn, *tmpn1;
|
|
<a name="l179"></a>
|
|
<a name="l180"></a> </span><span class=cF1>do</span><span class=cF0>
|
|
<a name="l181"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l182"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>);
|
|
<a name="l183"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>)
|
|
<a name="l184"></a> {
|
|
<a name="l185"></a> DrawDC2;
|
|
<a name="l186"></a> DrawTimeSignature(psm.dc2, arg1, arg2, top, bottom);
|
|
<a name="l187"></a> }
|
|
<a name="l188"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l189"></a> </span><span class=cF1>while</span><span class=cF0> (message_code != </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>);
|
|
<a name="l190"></a>
|
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 < </span><span class=cFE>13</span><span class=cF0> * </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>)
|
|
<a name="l192"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l193"></a> </span><span class=cF1>if</span><span class=cF0> (arg1 >= psm.head.x)
|
|
<a name="l194"></a> tmpn1 = psm.head.last;
|
|
<a name="l195"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (arg1 < psm.head.next->x)
|
|
<a name="l196"></a> tmpn1 = &psm.head;
|
|
<a name="l197"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l198"></a> tmpn1 = PsmFindNote(arg1 - PSM_NOTE_SPACING / </span><span class=cFE>2</span><span class=cF0>, arg2);
|
|
<a name="l199"></a> tmpn = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>PsmNote</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l200"></a> tmpn->type = PSMT_METER;
|
|
<a name="l201"></a> tmpn->meter_top = top;
|
|
<a name="l202"></a> tmpn->meter_bottom = bottom;
|
|
<a name="l203"></a> PsmSetWidth(tmpn);
|
|
<a name="l204"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpn, tmpn1);
|
|
<a name="l205"></a> psm.cur_note = tmpn->next;
|
|
<a name="l206"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l207"></a> DrawDC2;
|
|
<a name="l208"></a>}
|
|
<a name="l209"></a>
|
|
<a name="l210"></a></span><span class=cF1>U0</span><span class=cF0> PsmLeftClickStaffPtr(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l211"></a>{
|
|
<a name="l212"></a> PsmNote *tmpn, *tmpn1;
|
|
<a name="l213"></a> </span><span class=cF9>I64</span><span class=cF0> o, n, message_code, arg1, arg2, n_original, o_original;
|
|
<a name="l214"></a>
|
|
<a name="l215"></a> psm.cur_note = tmpn = PsmFindNote(x, y);
|
|
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn != &psm.head)
|
|
<a name="l217"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l218"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type == PSMT_NOTE)
|
|
<a name="l219"></a> {
|
|
<a name="l220"></a> o_original = </span><span class=cF5>Ona2Octave</span><span class=cF0>(tmpn->ona);
|
|
<a name="l221"></a> n_original = </span><span class=cF5>Ona2Note</span><span class=cF0>(tmpn->ona);
|
|
<a name="l222"></a> </span><span class=cF1>do</span><span class=cF0>
|
|
<a name="l223"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l224"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>);
|
|
<a name="l225"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>)
|
|
<a name="l226"></a> {
|
|
<a name="l227"></a> tmpn1 = PsmFindNote(arg1, arg2);
|
|
<a name="l228"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn1 == &psm.head || tmpn1 == tmpn)
|
|
<a name="l229"></a> </span><span class=cF1>goto</span><span class=cF0> move_note;
|
|
<a name="l230"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l231"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l232"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpn1->word);
|
|
<a name="l233"></a> tmpn1->word = tmpn->word;
|
|
<a name="l234"></a> tmpn->word = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l235"></a> tmpn->ona = </span><span class=cF5>Note2Ona</span><span class=cF0>(n_original, o_original);
|
|
<a name="l236"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l237"></a> }
|
|
<a name="l238"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l239"></a> {
|
|
<a name="l240"></a>move_note:
|
|
<a name="l241"></a> arg2 = arg2 / </span><span class=cFE>4</span><span class=cF0> - </span><span class=cFE>15</span><span class=cF0>;
|
|
<a name="l242"></a> n = arg2 % </span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l243"></a> o = </span><span class=cFE>4</span><span class=cF0> + arg2 / -</span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (n < </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l245"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l246"></a> n += </span><span class=cFE>7</span><span class=cF0>;
|
|
<a name="l247"></a> o++;
|
|
<a name="l248"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l249"></a> n = psm_note_inverse_map[n];
|
|
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (n < </span><span class=cFE>3</span><span class=cF0>)
|
|
<a name="l251"></a> o--;
|
|
<a name="l252"></a> tmpn->ona = </span><span class=cF5>Note2Ona</span><span class=cF0>(n, o);
|
|
<a name="l253"></a> }
|
|
<a name="l254"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l255"></a> </span><span class=cF1>while</span><span class=cF0> (message_code != </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>);
|
|
<a name="l256"></a>
|
|
<a name="l257"></a> PsmSetWidth(tmpn);
|
|
<a name="l258"></a> }
|
|
<a name="l259"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l260"></a>}
|
|
<a name="l261"></a>
|
|
<a name="l262"></a></span><span class=cF1>U0</span><span class=cF0> PsmLeftClickStaffBox(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l263"></a>{
|
|
<a name="l264"></a> </span><span class=cF9>I64</span><span class=cF0> message_code, arg1, arg2;
|
|
<a name="l265"></a>
|
|
<a name="l266"></a> </span><span class=cF1>do</span><span class=cF0>
|
|
<a name="l267"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l268"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>);
|
|
<a name="l269"></a> DrawDC2;
|
|
<a name="l270"></a> psm.dc2->color = </span><span class=cF3>ROPF_DITHER</span><span class=cF0> + </span><span class=cF3>WHITE</span><span class=cF0> << </span><span class=cFE>16</span><span class=cF0> + </span><span class=cF3>BLACK</span><span class=cF0>;
|
|
<a name="l271"></a> </span><span class=cF5>GrBorder</span><span class=cF0>(psm.dc2, x, y, arg1, arg2);
|
|
<a name="l272"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>)
|
|
<a name="l273"></a> {
|
|
<a name="l274"></a> </span><span class=cF1>if</span><span class=cF0> (x > arg1)
|
|
<a name="l275"></a> </span><span class=cF5>SwapI64</span><span class=cF0>(&x, &arg1);
|
|
<a name="l276"></a> PsmMarkSel(x, arg1, </span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l277"></a> }
|
|
<a name="l278"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l279"></a> </span><span class=cF1>while</span><span class=cF0> (message_code != </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>);
|
|
<a name="l280"></a>
|
|
<a name="l281"></a> DrawDC2;
|
|
<a name="l282"></a>}
|
|
<a name="l283"></a>
|
|
<a name="l284"></a></span><span class=cF1>U0</span><span class=cF0> PsmLeftClick(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l285"></a>{
|
|
<a name="l286"></a> </span><span class=cF9>I64</span><span class=cF0> duration, top, bottom;
|
|
<a name="l287"></a>
|
|
<a name="l288"></a> </span><span class=cF1>if</span><span class=cF0> (y < </span><span class=cFE>13</span><span class=cF0> * </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>)
|
|
<a name="l289"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (psm.tool == PSMTT_PTR_TOOL)
|
|
<a name="l291"></a> PsmLeftClickStaffPtr(x, y);
|
|
<a name="l292"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l293"></a> PsmLeftClickStaffBox(x, y);
|
|
<a name="l294"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l295"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l296"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l297"></a> duration = PsmGetPickNoteBoxDuration(x, y);
|
|
<a name="l298"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= duration < PSM_DURATIONS_NUM)
|
|
<a name="l299"></a> PsmLeftClickPickNoteBox(duration);
|
|
<a name="l300"></a>
|
|
<a name="l301"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (PsmGetPickMeterBox</span><span class=cF7>(</span><span class=cF0>x, y, &top, &bottom</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l302"></a> PsmLeftClickPickMeterBox(top, bottom);
|
|
<a name="l303"></a>
|
|
<a name="l304"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (PsmGetPickToolBox</span><span class=cF7>(</span><span class=cF0>x, y</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l305"></a> DrawDC2;
|
|
<a name="l306"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l307"></a>}
|
|
<a name="l308"></a>
|
|
<a name="l309"></a></span><span class=cF1>U8</span><span class=cF0> PsmConvertDuration(</span><span class=cF1>F64</span><span class=cF0> d)
|
|
<a name="l310"></a>{
|
|
<a name="l311"></a> </span><span class=cF1>F64</span><span class=cF0> d1, d2;
|
|
<a name="l312"></a> </span><span class=cF9>I64</span><span class=cF0> j;
|
|
<a name="l313"></a>
|
|
<a name="l314"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j < PSM_DURATIONS_NUM; j++)
|
|
<a name="l315"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l316"></a> d1 = psm_durations[j];
|
|
<a name="l317"></a> d2 = psm_durations[j + </span><span class=cFE>1</span><span class=cF0>];
|
|
<a name="l318"></a> </span><span class=cF1>if</span><span class=cF0> (d < d1 * d2 / </span><span class=cF7>(</span><span class=cF0>d1 + d2</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l319"></a> </span><span class=cF1>return</span><span class=cF0> j;
|
|
<a name="l320"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l321"></a>
|
|
<a name="l322"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l323"></a>}
|
|
<a name="l324"></a>
|
|
<a name="l325"></a>#</span><span class=cF1>define</span><span class=cF0> PSM_KEYS_NUM </span><span class=cFE>20</span><span class=cF0>
|
|
<a name="l326"></a></span><span class=cF1>class</span><span class=cF0> PsmKey
|
|
<a name="l327"></a>{
|
|
<a name="l328"></a> </span><span class=cF1>U8</span><span class=cF0> x, w, h, ascii;
|
|
<a name="l329"></a>};
|
|
<a name="l330"></a>
|
|
<a name="l331"></a>#</span><span class=cF1>define</span><span class=cF0> PSM_W_W </span><span class=cFE>16</span><span class=cF0>
|
|
<a name="l332"></a>#</span><span class=cF1>define</span><span class=cF0> PSM_W_H </span><span class=cFE>36</span><span class=cF0>
|
|
<a name="l333"></a>#</span><span class=cF1>define</span><span class=cF0> PSM_B_W </span><span class=cFE>8</span><span class=cF0>
|
|
<a name="l334"></a>#</span><span class=cF1>define</span><span class=cF0> PSM_B_H </span><span class=cFE>20</span><span class=cF0>
|
|
<a name="l335"></a>
|
|
<a name="l336"></a>PsmKey psm_kbd[PSM_KEYS_NUM] = {
|
|
<a name="l337"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'e'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l338"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>3</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'r'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l339"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>4</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'t'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l340"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>6</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'u'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l341"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>7</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'i'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l342"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>9</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'p'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l343"></a> </span><span class=cF7>{</span><span class=cFE>10</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>'['</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l344"></a> </span><span class=cF7>{</span><span class=cFE>11</span><span class=cF0> * PSM_W_W - </span><span class=cFE>4</span><span class=cF0>, PSM_B_W, PSM_B_H, </span><span class=cF6>']'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l345"></a>
|
|
<a name="l346"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'a'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l347"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>1</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'s'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l348"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>2</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'d'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l349"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>3</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'f'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l350"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>4</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'g'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l351"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>5</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'h'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l352"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>6</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'j'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l353"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>7</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'k'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l354"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>8</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'l'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l355"></a> </span><span class=cF7>{</span><span class=cF0> </span><span class=cFE>9</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>';'</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l356"></a> </span><span class=cF7>{</span><span class=cFE>10</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'\''</span><span class=cF0> </span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l357"></a> </span><span class=cF7>{</span><span class=cFE>11</span><span class=cF0> * PSM_W_W, PSM_W_W, PSM_W_H, </span><span class=cF6>'\n'</span><span class=cF7>}</span><span class=cF0>,
|
|
<a name="l358"></a>};
|
|
<a name="l359"></a>
|
|
<a name="l360"></a></span><span class=cF1>U0</span><span class=cF0> PsmDownKey(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l361"></a>{
|
|
<a name="l362"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l363"></a> PsmKey *o;
|
|
<a name="l364"></a>
|
|
<a name="l365"></a> y -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> * </span><span class=cFE>13</span><span class=cF0>;
|
|
<a name="l366"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= y < PSM_W_H)
|
|
<a name="l367"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l368"></a> x -= </span><span class=cFE>16</span><span class=cF0>;
|
|
<a name="l369"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < PSM_KEYS_NUM; i++)
|
|
<a name="l370"></a> {
|
|
<a name="l371"></a> o=&psm_kbd[i];
|
|
<a name="l372"></a> </span><span class=cF1>if</span><span class=cF0> (o->x <= x < o->x+o->w && y < o->h)
|
|
<a name="l373"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l374"></a> </span><span class=cF5>Message</span><span class=cF0>(</span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>, o->ascii, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l375"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l376"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l377"></a> }
|
|
<a name="l378"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l379"></a>}
|
|
<a name="l380"></a>
|
|
<a name="l381"></a></span><span class=cF1>U0</span><span class=cF0> PsmUpKey(</span><span class=cF9>I64</span><span class=cF0> x, </span><span class=cF9>I64</span><span class=cF0> y)
|
|
<a name="l382"></a>{
|
|
<a name="l383"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l384"></a> PsmKey *o;
|
|
<a name="l385"></a>
|
|
<a name="l386"></a> y -= </span><span class=cF3>FONT_HEIGHT</span><span class=cF0> * </span><span class=cFE>13</span><span class=cF0>;
|
|
<a name="l387"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= y < PSM_W_H)
|
|
<a name="l388"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l389"></a> x -= </span><span class=cFE>16</span><span class=cF0>;
|
|
<a name="l390"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < PSM_KEYS_NUM; i++)
|
|
<a name="l391"></a> {
|
|
<a name="l392"></a> o=&psm_kbd[i];
|
|
<a name="l393"></a> </span><span class=cF1>if</span><span class=cF0> (o->x <= x < o->x+o->w && y < o->h)
|
|
<a name="l394"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l395"></a> </span><span class=cF5>Message</span><span class=cF0>(</span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0>, o->ascii, </span><span class=cFE>0</span><span class=cF0>);
|
|
<a name="l396"></a> </span><span class=cF1>return</span><span class=cF0>;
|
|
<a name="l397"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l398"></a> }
|
|
<a name="l399"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l400"></a>}
|
|
<a name="l401"></a>
|
|
<a name="l402"></a></span><span class=cF1>U0</span><span class=cF0> PsmPushMode(</span><span class=cF9>I64</span><span class=cF0> psm_octave)
|
|
<a name="l403"></a>{
|
|
<a name="l404"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> - </span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0> - </span><span class=cF3>WIF_FOCUS_TASK_MENU</span><span class=cF0> - </span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>;
|
|
<a name="l405"></a> PsmMenu(psm_octave);
|
|
<a name="l406"></a>}
|
|
<a name="l407"></a>
|
|
<a name="l408"></a></span><span class=cF1>U0</span><span class=cF0> PsmPopMode()
|
|
<a name="l409"></a>{
|
|
<a name="l410"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_USER_TASK_DEFAULT</span><span class=cF0>;
|
|
<a name="l411"></a> </span><span class=cF5>DCFill</span><span class=cF0>;
|
|
<a name="l412"></a>}
|
|
<a name="l413"></a>
|
|
<a name="l414"></a>#</span><span class=cF1>define</span><span class=cF0> PSMF_CD </span><span class=cFE>1</span><span class=cF0>
|
|
<a name="l415"></a>#</span><span class=cF1>define</span><span class=cF0> PSMF_INCOMPLETE </span><span class=cFE>2</span><span class=cF0>
|
|
<a name="l416"></a>
|
|
<a name="l417"></a></span><span class=cF1>U0</span><span class=cF0> Psalmody(</span><span class=cF1>U8</span><span class=cF0> *dirname=</span><span class=cF6>"~/Psalmody"</span><span class=cF0>)
|
|
<a name="l418"></a>{
|
|
<a name="l419"></a> </span><span class=cF1>Bool</span><span class=cF0> was_playing, is_null = </span><span class=cF3>TRUE</span><span class=cF0>, was_null = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l420"></a> </span><span class=cF9>I64</span><span class=cF0> arg1, arg2, message_code = </span><span class=cFE>0</span><span class=cF0>, col, ona = </span><span class=cFE>0</span><span class=cF0>, last_ona = </span><span class=cFE>0</span><span class=cF0>,
|
|
<a name="l421"></a> psm_octave = </span><span class=cFE>4</span><span class=cF0>, timeout_val, timeout_val2, old_doc_flags;
|
|
<a name="l422"></a> </span><span class=cF1>U8</span><span class=cF0> *filename = </span><span class=cF3>NULL</span><span class=cF0>, *st, *st2;
|
|
<a name="l423"></a> PsmNote *tmpn;
|
|
<a name="l424"></a> </span><span class=cF1>F64</span><span class=cF0> psm_duration = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>, d, event_time = </span><span class=cF5>tS</span><span class=cF0>, note_down_time = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l425"></a> </span><span class=cF9>CCtrl</span><span class=cF0> *c = TempoNew;
|
|
<a name="l426"></a>
|
|
<a name="l427"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l428"></a> old_doc_flags = </span><span class=cF5>DocPut</span><span class=cF0>->flags;
|
|
<a name="l429"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="https://tomawezome.github.io/ZealOS/System/TaskSettings.CC.html#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
|
<a name="l430"></a>
|
|
<a name="l431"></a> </span><span class=cF5>MusicSettingsReset</span><span class=cF0>;
|
|
<a name="l432"></a> tempo_state.tempo = </span><span class=cF5>Round</span><span class=cF0>(TEMPO_RANGE * </span><span class=cF7>(</span><span class=cFB>music</span><span class=cF0>.tempo - </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>5</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>4</span><span class=cF0>.</span><span class=cFE>4</span><span class=cF0>);
|
|
<a name="l433"></a> tempo_state.stacatto = </span><span class=cF5>Round</span><span class=cF0>(TEMPO_RANGE * </span><span class=cF7>(</span><span class=cFB>music</span><span class=cF0>.stacatto_factor - </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>12</span><span class=cF7>)</span><span class=cF0> / </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>88</span><span class=cF0>);
|
|
<a name="l434"></a>
|
|
<a name="l435"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l436"></a> </span><span class=cF5>DocPut</span><span class=cF0>->flags |= </span><span class=cF3>DOCF_FORM</span><span class=cF0>;
|
|
<a name="l437"></a>
|
|
<a name="l438"></a> </span><span class=cF5>MemSet</span><span class=cF0>(&psm, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>PsmCtrl</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l439"></a> psm.screen_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l440"></a> psm.head.next = psm.head.last = &psm.head;
|
|
<a name="l441"></a> psm.clip.next = psm.clip.last = &psm.clip;
|
|
<a name="l442"></a> psm.cur_note = &psm.head;
|
|
<a name="l443"></a> psm.dc2 = </span><span class=cF5>DCAlias</span><span class=cF0>;
|
|
<a name="l444"></a>
|
|
<a name="l445"></a> </span><span class=cF5>MenuPush</span><span class=cF0>( </span><span class=cF6>"File {"</span><span class=cF0>
|
|
<a name="l446"></a> </span><span class=cF6>" New(,'.');"</span><span class=cF0>
|
|
<a name="l447"></a> </span><span class=cF6>" ChangeDir(MESSAGE_CMD,PSMF_CD);"</span><span class=cF0>
|
|
<a name="l448"></a> </span><span class=cF6>" Open(,CH_CTRLO);"</span><span class=cF0>
|
|
<a name="l449"></a> </span><span class=cF6>" SaveAs(,CH_CTRLA);"</span><span class=cF0>
|
|
<a name="l450"></a> </span><span class=cF6>" Abort(,CH_SHIFT_ESC);"</span><span class=cF0>
|
|
<a name="l451"></a> </span><span class=cF6>" Exit(,CH_ESC);"</span><span class=cF0>
|
|
<a name="l452"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l453"></a> </span><span class=cF6>"Edit {"</span><span class=cF0>
|
|
<a name="l454"></a> </span><span class=cF6>" Cut(,CH_CTRLX);"</span><span class=cF0>
|
|
<a name="l455"></a> </span><span class=cF6>" Copy(,CH_CTRLC);"</span><span class=cF0>
|
|
<a name="l456"></a> </span><span class=cF6>" Paste(,CH_CTRLV);"</span><span class=cF0>
|
|
<a name="l457"></a> </span><span class=cF6>" RightMenu(,'\n');"</span><span class=cF0>
|
|
<a name="l458"></a> </span><span class=cF6>" BackSpace(,CH_BACKSPACE);"</span><span class=cF0>
|
|
<a name="l459"></a> </span><span class=cF6>" DeleteNote(,,SC_DELETE);"</span><span class=cF0>
|
|
<a name="l460"></a> </span><span class=cF6>" ClearSong(,'.');"</span><span class=cF0>
|
|
<a name="l461"></a> </span><span class=cF6>" Left(,,SC_CURSOR_LEFT);"</span><span class=cF0>
|
|
<a name="l462"></a> </span><span class=cF6>" Right(,,SC_CURSOR_RIGHT);"</span><span class=cF0>
|
|
<a name="l463"></a> </span><span class=cF6>" GoBegin(,,0x4CB0000044B);"</span><span class=cF0>
|
|
<a name="l464"></a> </span><span class=cF6>" GoEnd(,,0x4CD0000044D);"</span><span class=cF0>
|
|
<a name="l465"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l466"></a> </span><span class=cF6>"Song {"</span><span class=cF0>
|
|
<a name="l467"></a> </span><span class=cF6>" Play(,'x');"</span><span class=cF0>
|
|
<a name="l468"></a> </span><span class=cF6>" Record(,'z');"</span><span class=cF0>
|
|
<a name="l469"></a> </span><span class=cF6>" Random(,',');"</span><span class=cF0>
|
|
<a name="l470"></a> </span><span class=cF6>" MarkIncomplete(MESSAGE_CMD,PSMF_INCOMPLETE);"</span><span class=cF0>
|
|
<a name="l471"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l472"></a> </span><span class=cF6>"Sound {"</span><span class=cF0>
|
|
<a name="l473"></a> </span><span class=cF6>" Octave1(,'1');"</span><span class=cF0>
|
|
<a name="l474"></a> </span><span class=cF6>" Octave2(,'2');"</span><span class=cF0>
|
|
<a name="l475"></a> </span><span class=cF6>" Octave3(,'3');"</span><span class=cF0>
|
|
<a name="l476"></a> </span><span class=cF6>" Octave4(,'4');"</span><span class=cF0>
|
|
<a name="l477"></a> </span><span class=cF6>" Octave5(,'5');"</span><span class=cF0>
|
|
<a name="l478"></a> </span><span class=cF6>" Octave6(,'6');"</span><span class=cF0>
|
|
<a name="l479"></a> </span><span class=cF6>" Octave7(,'7');"</span><span class=cF0>
|
|
<a name="l480"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l481"></a> </span><span class=cF6>"Help {"</span><span class=cF0>
|
|
<a name="l482"></a> </span><span class=cF6>" Help(,,SC_F1);"</span><span class=cF0>
|
|
<a name="l483"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
|
<a name="l484"></a> );
|
|
<a name="l485"></a> psm.incomplete_entry = </span><span class=cF5>MenuEntryFind</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu, </span><span class=cF6>"Song/MarkIncomplete"</span><span class=cF0>);
|
|
<a name="l486"></a> psm.record_entry = </span><span class=cF5>MenuEntryFind</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->cur_menu, </span><span class=cF6>"Song/Record"</span><span class=cF0>);
|
|
<a name="l487"></a>
|
|
<a name="l488"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
|
|
<a name="l489"></a> </span><span class=cF5>WinBorder</span><span class=cF0>;
|
|
<a name="l490"></a> </span><span class=cF5>WinMax</span><span class=cF0>;
|
|
<a name="l491"></a>
|
|
<a name="l492"></a> dirname = </span><span class=cF5>StrNew</span><span class=cF0>(dirname);
|
|
<a name="l493"></a> PsmPushMode(psm_octave);
|
|
<a name="l494"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l495"></a> </span><span class=cF5>Fs</span><span class=cF0>->draw_it = &</span><span class=cF5>DrawIt</span><span class=cF0>;
|
|
<a name="l496"></a>
|
|
<a name="l497"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l498"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l499"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l500"></a> {
|
|
<a name="l501"></a> was_playing=</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l502"></a>mo_start:
|
|
<a name="l503"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cF5>Fs</span><span class=cF0>->win_top < </span><span class=cFE>18</span><span class=cF0>)
|
|
<a name="l504"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0> |
|
|
<a name="l505"></a> </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0> |
|
|
<a name="l506"></a> </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_CMD</span><span class=cF0>);
|
|
<a name="l507"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l508"></a> message_code = </span><span class=cF5>MessageGet</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0> |
|
|
<a name="l509"></a> </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_CMD</span><span class=cF0>);
|
|
<a name="l510"></a>mo_got_message:
|
|
<a name="l511"></a> </span><span class=cF1>if</span><span class=cF0> (message_code == </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> && arg1 == </span><span class=cF3>CH_SPACE</span><span class=cF0> && !arg2)
|
|
<a name="l512"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l513"></a> </span><span class=cF2>//The Window Mgr sets the Doc cur_entry to a bttn</span><span class=cF0>
|
|
<a name="l514"></a> </span><span class=cF2>//and generates a <SPACE> when the Doc Bttns are clicked.</span><span class=cF0>
|
|
<a name="l515"></a> </span><span class=cF2>//This is so that kbd and mouse are the same for Doc's.</span><span class=cF0>
|
|
<a name="l516"></a> </span><span class=cF2>//We must now pass the <SPACE> onto the Doc handler.</span><span class=cF0>
|
|
<a name="l517"></a> </span><span class=cF5>PutKey</span><span class=cF0>(arg1, arg2);
|
|
<a name="l518"></a> </span><span class=cF1>goto</span><span class=cF0> mo_start;
|
|
<a name="l519"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l520"></a> </span><span class=cF1>if</span><span class=cF0> (message_code != </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>)
|
|
<a name="l521"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l522"></a> </span><span class=cF5>DocBottom</span><span class=cF0>;
|
|
<a name="l523"></a> </span><span class=cF1>if</span><span class=cF0> (was_playing || </span><span class=cF5>DocPut</span><span class=cF0>->cur_entry->y >= </span><span class=cF5>Fs</span><span class=cF0>->win_height - </span><span class=cFE>2</span><span class=cF0>)
|
|
<a name="l524"></a> {
|
|
<a name="l525"></a> PsmMenu(psm_octave);
|
|
<a name="l526"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l527"></a> }
|
|
<a name="l528"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l529"></a>
|
|
<a name="l530"></a> ona = </span><span class=cF5>Note2Ona</span><span class=cF0>(</span><span class=cFE>3</span><span class=cF0>, psm_octave + </span><span class=cFE>1</span><span class=cF0>); </span><span class=cF2>//C</span><span class=cF0>
|
|
<a name="l531"></a> is_null = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l532"></a> </span><span class=cF1>switch</span><span class=cF0> (message_code)
|
|
<a name="l533"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l534"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_CMD</span><span class=cF0>:
|
|
<a name="l535"></a> PsmPopMode;
|
|
<a name="l536"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1)
|
|
<a name="l537"></a> {
|
|
<a name="l538"></a> </span><span class=cF1>case</span><span class=cF0> PSMF_CD:
|
|
<a name="l539"></a> st2 = dirname;
|
|
<a name="l540"></a> </span><span class=cF1>if</span><span class=cF0> (dirname = </span><span class=cF5>PopUpPickDir</span><span class=cF0>)
|
|
<a name="l541"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l542"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l543"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
|
<a name="l544"></a> filename = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l545"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l546"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l547"></a> dirname = st2;
|
|
<a name="l548"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l549"></a>
|
|
<a name="l550"></a> </span><span class=cF1>case</span><span class=cF0> PSMF_INCOMPLETE:
|
|
<a name="l551"></a> psm.incomplete_entry->checked = !psm.incomplete_entry->checked;
|
|
<a name="l552"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l553"></a> }
|
|
<a name="l554"></a> PsmPushMode(psm_octave);
|
|
<a name="l555"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l556"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l557"></a>
|
|
<a name="l558"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0>:
|
|
<a name="l559"></a> event_time = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l560"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0> <= arg1 <= </span><span class=cF6>'9'</span><span class=cF0>)
|
|
<a name="l561"></a> {
|
|
<a name="l562"></a> psm_octave = arg1 - </span><span class=cF6>'0'</span><span class=cF0>;
|
|
<a name="l563"></a> PsmMenu(psm_octave);
|
|
<a name="l564"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l565"></a> }
|
|
<a name="l566"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l567"></a> {
|
|
<a name="l568"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1)
|
|
<a name="l569"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l570"></a> </span><span class=cF1>start</span><span class=cF0>:
|
|
<a name="l571"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'a'</span><span class=cF0>: ona -= </span><span class=cFE>8</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l572"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'s'</span><span class=cF0>: ona -= </span><span class=cFE>7</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l573"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'e'</span><span class=cF0>: ona -= </span><span class=cFE>6</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l574"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'d'</span><span class=cF0>: ona -= </span><span class=cFE>5</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l575"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'r'</span><span class=cF0>: ona -= </span><span class=cFE>4</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l576"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'f'</span><span class=cF0>: ona -= </span><span class=cFE>3</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l577"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>: ona -= </span><span class=cFE>2</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l578"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'g'</span><span class=cF0>: ona--; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l579"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'h'</span><span class=cF0>: </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l580"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'u'</span><span class=cF0>: ona++; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l581"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'j'</span><span class=cF0>: ona += </span><span class=cFE>2</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l582"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'i'</span><span class=cF0>: ona += </span><span class=cFE>3</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l583"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'k'</span><span class=cF0>: ona += </span><span class=cFE>4</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l584"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'l'</span><span class=cF0>: ona += </span><span class=cFE>5</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l585"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'p'</span><span class=cF0>: ona += </span><span class=cFE>6</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l586"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>';'</span><span class=cF0>: ona += </span><span class=cFE>7</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l587"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'['</span><span class=cF0>: ona += </span><span class=cFE>8</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l588"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\''</span><span class=cF0>: ona += </span><span class=cFE>9</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l589"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>']'</span><span class=cF0>: ona += </span><span class=cFE>10</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l590"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SPACE</span><span class=cF0>: ona = </span><span class=cFE>0</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l591"></a> </span><span class=cF1>end</span><span class=cF0>:
|
|
<a name="l592"></a> is_null = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l593"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l594"></a>
|
|
<a name="l595"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cFE>0</span><span class=cF0>:
|
|
<a name="l596"></a> </span><span class=cF1>switch</span><span class=cF0> (arg2.u8[</span><span class=cFE>0</span><span class=cF0>])
|
|
<a name="l597"></a> {
|
|
<a name="l598"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_CURSOR_LEFT</span><span class=cF0>:
|
|
<a name="l599"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 & </span><span class=cF3>SCF_CTRL</span><span class=cF0>)
|
|
<a name="l600"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l601"></a> </span><span class=cF1>while</span><span class=cF0> (psm.cur_note->last != &psm.head)
|
|
<a name="l602"></a> {
|
|
<a name="l603"></a> psm.cur_note = psm.cur_note->last;
|
|
<a name="l604"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l605"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&psm.cur_note->flags, PSMf_SEL, arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
|
<a name="l606"></a> }
|
|
<a name="l607"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l608"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l609"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l610"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note->last != &psm.head)
|
|
<a name="l611"></a> {
|
|
<a name="l612"></a> psm.cur_note = psm.cur_note->last;
|
|
<a name="l613"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l614"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&psm.cur_note->flags, PSMf_SEL, arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
|
<a name="l615"></a> }
|
|
<a name="l616"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l617"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l618"></a>
|
|
<a name="l619"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_CURSOR_RIGHT</span><span class=cF0>:
|
|
<a name="l620"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 & </span><span class=cF3>SCF_CTRL</span><span class=cF0>)
|
|
<a name="l621"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l622"></a> </span><span class=cF1>while</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l623"></a> {
|
|
<a name="l624"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l625"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&psm.cur_note->flags, PSMf_SEL, arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
|
<a name="l626"></a> psm.cur_note = psm.cur_note->next;
|
|
<a name="l627"></a> }
|
|
<a name="l628"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l629"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l630"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l631"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l632"></a> {
|
|
<a name="l633"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l634"></a> </span><span class=cF5>LBEqual</span><span class=cF0>(&psm.cur_note->flags, PSMf_SEL, arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
|
<a name="l635"></a> psm.cur_note = psm.cur_note->next;
|
|
<a name="l636"></a> }
|
|
<a name="l637"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l638"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l639"></a>
|
|
<a name="l640"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_DELETE</span><span class=cF0>:
|
|
<a name="l641"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
|
<a name="l642"></a> PsmCutToClip;
|
|
<a name="l643"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l644"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l645"></a> tmpn = psm.cur_note;
|
|
<a name="l646"></a> psm.cur_note = tmpn->next;
|
|
<a name="l647"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn != &psm.head)
|
|
<a name="l648"></a> {
|
|
<a name="l649"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpn);
|
|
<a name="l650"></a> PsmNoteDel(tmpn);
|
|
<a name="l651"></a> }
|
|
<a name="l652"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l653"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l654"></a>
|
|
<a name="l655"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_INS</span><span class=cF0>:
|
|
<a name="l656"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 & </span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
|
<a name="l657"></a> PsmPasteClip;
|
|
<a name="l658"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (arg2 &</span><span class=cF3>SCF_CTRL</span><span class=cF0>)
|
|
<a name="l659"></a> PsmCopyToClip;
|
|
<a name="l660"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l661"></a>
|
|
<a name="l662"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>SC_F1</span><span class=cF0>:
|
|
<a name="l663"></a> PsmPopMode;
|
|
<a name="l664"></a> </span><span class=cF5>PopUpEd</span><span class=cF0>(</span><span class=cF6>"::/Apps/Psalmody/Help.DD"</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>);
|
|
<a name="l665"></a> PsmPushMode(psm_octave);
|
|
<a name="l666"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l667"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l668"></a> }
|
|
<a name="l669"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l670"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>','</span><span class=cF0>:
|
|
<a name="l671"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
|
<a name="l672"></a> filename = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l673"></a> PsmPopMode;
|
|
<a name="l674"></a> </span><span class=cFB>music</span><span class=cF0>.octave = psm_octave;
|
|
<a name="l675"></a> </span><span class=cF1>if</span><span class=cF0> (st2 = </span><span class=cF5>GodSongStr</span><span class=cF0>) {
|
|
<a name="l676"></a> PsmLoadSongStr(st2, &psm_octave, &psm_duration);
|
|
<a name="l677"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l678"></a> }
|
|
<a name="l679"></a> PsmPushMode(psm_octave);
|
|
<a name="l680"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l681"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l682"></a>
|
|
<a name="l683"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLO</span><span class=cF0>:
|
|
<a name="l684"></a> PsmPopMode;
|
|
<a name="l685"></a> </span><span class=cF5>RegOneTimePopUp</span><span class=cF0>(</span><span class=cF3>ARf_PSALMODY_JUKEBOX</span><span class=cF0>,
|
|
<a name="l686"></a> </span><span class=cF6>"Sel a song and preview it.\n"</span><span class=cF0>
|
|
<a name="l687"></a> </span><span class=cF6>"$GREEN$<SHIFT-ESC>$FG$ to load it into Psalmody.\n\n"</span><span class=cF0>
|
|
<a name="l688"></a> </span><span class=cF3>ST_WARN_ST</span><span class=cF0> </span><span class=cF6>" Graphics and other embelishments\n"</span><span class=cF0>
|
|
<a name="l689"></a> </span><span class=cF6>"will be lost because Psalmody can't\n"</span><span class=cF0>
|
|
<a name="l690"></a> </span><span class=cF6>"parse CosmiC programs completely.\n"</span><span class=cF0>);
|
|
<a name="l691"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
|
<a name="l692"></a> filename = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l693"></a> JukeBox(dirname, &filename);
|
|
<a name="l694"></a> </span><span class=cF1>if</span><span class=cF0> (filename)
|
|
<a name="l695"></a> {
|
|
<a name="l696"></a> psm.screen_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l697"></a> psm_duration = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l698"></a> psm_octave = </span><span class=cFE>4</span><span class=cF0>;
|
|
<a name="l699"></a> PsmSongDel(&psm.head);
|
|
<a name="l700"></a> psm.cur_note = &psm.head;
|
|
<a name="l701"></a> PsmLoadSong(filename, &psm_octave, &psm_duration);
|
|
<a name="l702"></a> psm.record_entry->checked = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l703"></a> psm.cur_note = psm.head.next;
|
|
<a name="l704"></a> }
|
|
<a name="l705"></a> PsmPushMode(psm_octave);
|
|
<a name="l706"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l707"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l708"></a>
|
|
<a name="l709"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLA</span><span class=cF0>:
|
|
<a name="l710"></a> PsmPopMode;
|
|
<a name="l711"></a> filename = PsmSaveSong(dirname, filename);
|
|
<a name="l712"></a> PsmPushMode(psm_octave);
|
|
<a name="l713"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l714"></a>
|
|
<a name="l715"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLC</span><span class=cF0>:
|
|
<a name="l716"></a> PsmCopyToClip;
|
|
<a name="l717"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l718"></a>
|
|
<a name="l719"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLV</span><span class=cF0>:
|
|
<a name="l720"></a> PsmPasteClip;
|
|
<a name="l721"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l722"></a>
|
|
<a name="l723"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_CTRLX</span><span class=cF0>:
|
|
<a name="l724"></a> PsmCutToClip;
|
|
<a name="l725"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l726"></a>
|
|
<a name="l727"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'.'</span><span class=cF0>:
|
|
<a name="l728"></a> PsmMenu(psm_octave);
|
|
<a name="l729"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l730"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
|
|
<a name="l731"></a> filename = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l732"></a> psm_duration = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l733"></a> psm_octave = </span><span class=cFE>4</span><span class=cF0>;
|
|
<a name="l734"></a> PsmSongDel(&psm.head);
|
|
<a name="l735"></a> psm.cur_note = &psm.head;
|
|
<a name="l736"></a> psm.screen_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l737"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l738"></a>
|
|
<a name="l739"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\n'</span><span class=cF0>:
|
|
<a name="l740"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note != &psm.head)
|
|
<a name="l741"></a> PsmRightClick(psm.cur_note->x, psm.cur_note->y);
|
|
<a name="l742"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l743"></a>
|
|
<a name="l744"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'x'</span><span class=cF0>:
|
|
<a name="l745"></a> </span><span class=cF1>if</span><span class=cF0> (was_playing)
|
|
<a name="l746"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l747"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l748"></a> psm.playing = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l749"></a> PsmMenu(psm_octave);
|
|
<a name="l750"></a> tmpn = psm.cur_note;
|
|
<a name="l751"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn != &psm.head)
|
|
<a name="l752"></a> {
|
|
<a name="l753"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type != PSMT_METER)
|
|
<a name="l754"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l755"></a> timeout_val =</span><span class=cFB>counts</span><span class=cF0>.jiffies;
|
|
<a name="l756"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cF5>Fs</span><span class=cF0>->win_top < </span><span class=cFE>18</span><span class=cF0>)
|
|
<a name="l757"></a> message_code = </span><span class=cF5>MessageScan</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> |
|
|
<a name="l758"></a> </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_R_UP</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_CMD</span><span class=cF0>);
|
|
<a name="l759"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l760"></a> message_code = </span><span class=cF5>MessageScan</span><span class=cF0>(&arg1, &arg2, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_DOWN</span><span class=cF0> |
|
|
<a name="l761"></a> </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_CMD</span><span class=cF0>);
|
|
<a name="l762"></a> </span><span class=cF1>if</span><span class=cF0> (message_code)
|
|
<a name="l763"></a> {
|
|
<a name="l764"></a> </span><span class=cF5>Sound</span><span class=cF0>;
|
|
<a name="l765"></a> psm.playing = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l766"></a> was_playing = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l767"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mouse</span><span class=cF0>.pos_text.y - </span><span class=cF5>Fs</span><span class=cF0>->win_top >= </span><span class=cFE>18</span><span class=cF0> && message_code == </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>)
|
|
<a name="l768"></a> </span><span class=cF1>goto</span><span class=cF0> mo_start;
|
|
<a name="l769"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l770"></a> </span><span class=cF1>goto</span><span class=cF0> mo_got_message;
|
|
<a name="l771"></a> }
|
|
<a name="l772"></a> psm.cur_note = tmpn;
|
|
<a name="l773"></a> psm.screen_x += tmpn->x - </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>33</span><span class=cF0> * </span><span class=cF3>GR_WIDTH</span><span class=cF0>;
|
|
<a name="l774"></a> </span><span class=cF1>if</span><span class=cF0> (PsmHasWords</span><span class=cF7>(</span><span class=cF0>tmpn->word</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l775"></a> </span><span class=cF6>"%s"</span><span class=cF0>, tmpn->word;
|
|
<a name="l776"></a> </span><span class=cF5>Sound</span><span class=cF0>(tmpn->ona);
|
|
<a name="l777"></a>
|
|
<a name="l778"></a> </span><span class=cFB>music</span><span class=cF0>.tempo = </span><span class=cFE>4</span><span class=cF0>.</span><span class=cFE>4</span><span class=cF0> * tempo_state.tempo / TEMPO_RANGE + </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>5</span><span class=cF0>;
|
|
<a name="l779"></a> </span><span class=cFB>music</span><span class=cF0>.stacatto_factor = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>88</span><span class=cF0> * tempo_state.stacatto / TEMPO_RANGE + </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>12</span><span class=cF0>;
|
|
<a name="l780"></a> d = </span><span class=cF3>JIFFY_FREQ</span><span class=cF0> * psm_durations[tmpn->duration] / </span><span class=cFB>music</span><span class=cF0>.tempo;
|
|
<a name="l781"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&tmpn->flags, PSMf_TIE</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l782"></a> {
|
|
<a name="l783"></a> timeout_val += d;
|
|
<a name="l784"></a> timeout_val2 = timeout_val;
|
|
<a name="l785"></a> }
|
|
<a name="l786"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l787"></a> {
|
|
<a name="l788"></a> timeout_val += d * </span><span class=cFB>music</span><span class=cF0>.stacatto_factor;
|
|
<a name="l789"></a> timeout_val2 = timeout_val + d * (</span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0> - </span><span class=cFB>music</span><span class=cF0>.stacatto_factor);
|
|
<a name="l790"></a> }
|
|
<a name="l791"></a> </span><span class=cF5>SleepUntil</span><span class=cF0>(timeout_val);
|
|
<a name="l792"></a> </span><span class=cF5>Sound</span><span class=cF0>;
|
|
<a name="l793"></a> </span><span class=cF5>SleepUntil</span><span class=cF0>(timeout_val2);
|
|
<a name="l794"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l795"></a> tmpn = tmpn->next;
|
|
<a name="l796"></a> }
|
|
<a name="l797"></a> psm.cur_note = &psm.head;
|
|
<a name="l798"></a> psm.screen_x += psm.cur_note->x - </span><span class=cF3>GR_WIDTH</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l799"></a> psm.playing = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l800"></a> PsmMenu(psm_octave);
|
|
<a name="l801"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l802"></a> </span><span class=cF5>Sound</span><span class=cF0>;
|
|
<a name="l803"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l804"></a>
|
|
<a name="l805"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_BACKSPACE</span><span class=cF0>:
|
|
<a name="l806"></a> tmpn=psm.cur_note->last;
|
|
<a name="l807"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn != &psm.head)
|
|
<a name="l808"></a> {
|
|
<a name="l809"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpn);
|
|
<a name="l810"></a> PsmNoteDel(tmpn);
|
|
<a name="l811"></a> }
|
|
<a name="l812"></a> </span><span class=cF1>if</span><span class=cF0> (col)
|
|
<a name="l813"></a> {
|
|
<a name="l814"></a> </span><span class=cF6>''</span><span class=cF0> </span><span class=cF3>CH_BACKSPACE</span><span class=cF0>;
|
|
<a name="l815"></a> col--;
|
|
<a name="l816"></a> }
|
|
<a name="l817"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l818"></a>
|
|
<a name="l819"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'z'</span><span class=cF0>:
|
|
<a name="l820"></a> </span><span class=cF1>if</span><span class=cF0> (psm.record_entry->checked)
|
|
<a name="l821"></a> psm.record_entry->checked = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l822"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l823"></a> {
|
|
<a name="l824"></a> psm.record_entry->checked = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l825"></a> psm_duration = </span><span class=cFE>1</span><span class=cF0>.</span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l826"></a> psm_octave = </span><span class=cFE>4</span><span class=cF0>;
|
|
<a name="l827"></a> psm.screen_x = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l828"></a> }
|
|
<a name="l829"></a> PsmMenu(psm_octave);
|
|
<a name="l830"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l831"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l832"></a>
|
|
<a name="l833"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_ESC</span><span class=cF0>:
|
|
<a name="l834"></a> PsmPopMode;
|
|
<a name="l835"></a> filename = PsmSaveSong(dirname, filename);
|
|
<a name="l836"></a> PsmPushMode(psm_octave);
|
|
<a name="l837"></a>
|
|
<a name="l838"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>:
|
|
<a name="l839"></a> </span><span class=cF1>goto</span><span class=cF0> mo_done;
|
|
<a name="l840"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l841"></a> }
|
|
<a name="l842"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l843"></a>
|
|
<a name="l844"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0>:
|
|
<a name="l845"></a> event_time = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l846"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l847"></a>
|
|
<a name="l848"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_MS_MOVE</span><span class=cF0>:
|
|
<a name="l849"></a> </span><span class=cF1>if</span><span class=cF0> (arg2 > </span><span class=cFE>18</span><span class=cF0> * </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>)
|
|
<a name="l850"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_USER_TASK_DEFAULT</span><span class=cF0>;
|
|
<a name="l851"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l852"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit = </span><span class=cF3>WIG_TASK_DEFAULT</span><span class=cF0> -
|
|
<a name="l853"></a> </span><span class=cF3>WIF_SELF_FOCUS</span><span class=cF0> - </span><span class=cF3>WIF_SELF_BORDER</span><span class=cF0> - </span><span class=cF3>WIF_FOCUS_TASK_MENU</span><span class=cF0> - </span><span class=cF3>WIF_SELF_CTRLS</span><span class=cF0>;
|
|
<a name="l854"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l855"></a>
|
|
<a name="l856"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_MS_L_DOWN</span><span class=cF0>:
|
|
<a name="l857"></a> PsmDownKey(arg1, arg2);
|
|
<a name="l858"></a> PsmLeftClick(arg1, arg2);
|
|
<a name="l859"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l860"></a>
|
|
<a name="l861"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MESSAGE_MS_L_UP</span><span class=cF0>:
|
|
<a name="l862"></a> PsmUpKey(arg1, arg2);
|
|
<a name="l863"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l864"></a>
|
|
<a name="l865"></a> </span><span class=cF1>default</span><span class=cF0>:
|
|
<a name="l866"></a> PsmRightClick(arg1, arg2);
|
|
<a name="l867"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l868"></a> </span><span class=cF1>if</span><span class=cF0> (is_null)
|
|
<a name="l869"></a> ona = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l870"></a> </span><span class=cF1>if</span><span class=cF0> (ona != last_ona || is_null != was_null)
|
|
<a name="l871"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l872"></a> </span><span class=cF1>if</span><span class=cF0> (!ona)
|
|
<a name="l873"></a> {
|
|
<a name="l874"></a> </span><span class=cF1>if</span><span class=cF0> (is_null)
|
|
<a name="l875"></a> st = </span><span class=cF6>""</span><span class=cF0>;
|
|
<a name="l876"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l877"></a> st = </span><span class=cF6>"R"</span><span class=cF0>;
|
|
<a name="l878"></a> }
|
|
<a name="l879"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l880"></a> st = </span><span class=cF5>ListSub</span><span class=cF0>(</span><span class=cF5>Ona2Note</span><span class=cF7>(</span><span class=cF0>ona</span><span class=cF7>)</span><span class=cF0>, psm_note_list);
|
|
<a name="l881"></a> </span><span class=cF5>Sound</span><span class=cF0>(ona);
|
|
<a name="l882"></a> </span><span class=cF1>if</span><span class=cF0> (psm.record_entry->checked)
|
|
<a name="l883"></a> {
|
|
<a name="l884"></a> </span><span class=cF1>if</span><span class=cF0> (!was_null)
|
|
<a name="l885"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l886"></a> </span><span class=cFB>music</span><span class=cF0>.tempo = </span><span class=cFE>4</span><span class=cF0>.</span><span class=cFE>4</span><span class=cF0> * tempo_state.tempo / TEMPO_RANGE + </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>5</span><span class=cF0>;
|
|
<a name="l887"></a> </span><span class=cFB>music</span><span class=cF0>.stacatto_factor = </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>88</span><span class=cF0> * tempo_state.stacatto / TEMPO_RANGE + </span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>12</span><span class=cF0>;
|
|
<a name="l888"></a> tmpn->duration = PsmConvertDuration(</span><span class=cFB>music</span><span class=cF0>.tempo * </span><span class=cF7>(</span><span class=cF0>event_time-note_down_time</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l889"></a> PsmSetWidth(tmpn);
|
|
<a name="l890"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(tmpn, psm.cur_note->last);
|
|
<a name="l891"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l892"></a> </span><span class=cF1>if</span><span class=cF0> (!is_null)
|
|
<a name="l893"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l894"></a> note_down_time = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l895"></a> tmpn = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>PsmNote</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l896"></a> tmpn->type = PSMT_NOTE;
|
|
<a name="l897"></a> tmpn->ona = ona;
|
|
<a name="l898"></a> </span><span class=cF1>if</span><span class=cF0> (st[</span><span class=cFE>1</span><span class=cF0>] == </span><span class=cF6>'#'</span><span class=cF0>)
|
|
<a name="l899"></a> </span><span class=cF5>Bts</span><span class=cF0>(&tmpn->flags, PSMf_SHARP);
|
|
<a name="l900"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l901"></a> }
|
|
<a name="l902"></a> last_ona = ona;
|
|
<a name="l903"></a> was_null = is_null;
|
|
<a name="l904"></a> </span><span class=cF6>"%s"</span><span class=cF0>, st;
|
|
<a name="l905"></a> col += </span><span class=cF5>StrLen</span><span class=cF0>(st);
|
|
<a name="l906"></a> </span><span class=cF1>if</span><span class=cF0> (col >= </span><span class=cF5>Fs</span><span class=cF0>->win_width-</span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l907"></a> {
|
|
<a name="l908"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
|
<a name="l909"></a> col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l910"></a> }
|
|
<a name="l911"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l912"></a> }
|
|
<a name="l913"></a>mo_done:
|
|
<a name="l914"></a> </span><span class=cF5>MessageGet</span><span class=cF0>(,, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>MESSAGE_KEY_UP</span><span class=cF0>);
|
|
<a name="l915"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l916"></a> </span><span class=cF1>catch</span><span class=cF0>
|
|
<a name="l917"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l918"></a> PsmPopMode;
|
|
<a name="l919"></a> PsmSongDel(&psm.head);
|
|
<a name="l920"></a> PsmSongDel(&psm.clip);
|
|
<a name="l921"></a> TempoDel(c);
|
|
<a name="l922"></a> </span><span class=cF5>DCFill</span><span class=cF0>;
|
|
<a name="l923"></a> </span><span class=cF5>DCDel</span><span class=cF0>(psm.dc2);
|
|
<a name="l924"></a> </span><span class=cF5>DocClear</span><span class=cF0>;
|
|
<a name="l925"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
|
<a name="l926"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocPut</span><span class=cF0>)
|
|
<a name="l927"></a> </span><span class=cF5>DocPut</span><span class=cF0>->flags = </span><span class=cF5>DocPut</span><span class=cF0>->flags & ~</span><span class=cF3>DOCF_FORM</span><span class=cF0> | old_doc_flags & </span><span class=cF3>DOCF_FORM</span><span class=cF0>;
|
|
<a name="l928"></a> </span><span class=cF5>Free</span><span class=cF0>(dirname);
|
|
<a name="l929"></a> </span><span class=cF5>MenuPop</span><span class=cF0>;
|
|
<a name="l930"></a>}
|
|
</span></pre></body>
|
|
</html>
|