mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 16:26:35 +00:00
255 lines
29 KiB
HTML
Executable file
255 lines
29 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.00">
|
|
<style type="text/css">
|
|
body {background-color:#fef1f0;}
|
|
.cF0{color:#000000;background-color:#fef1f0;}
|
|
.cF1{color:#0148a4;background-color:#fef1f0;}
|
|
.cF2{color:#3b7901;background-color:#fef1f0;}
|
|
.cF3{color:#057c7e;background-color:#fef1f0;}
|
|
.cF4{color:#bb2020;background-color:#fef1f0;}
|
|
.cF5{color:#9e42ae;background-color:#fef1f0;}
|
|
.cF6{color:#b57901;background-color:#fef1f0;}
|
|
.cF7{color:#b2b6af;background-color:#fef1f0;}
|
|
.cF8{color:#555753;background-color:#fef1f0;}
|
|
.cF9{color:#678fbb;background-color:#fef1f0;}
|
|
.cFA{color:#82bc49;background-color:#fef1f0;}
|
|
.cFB{color:#0097a2;background-color:#fef1f0;}
|
|
.cFC{color:#e26a6a;background-color:#fef1f0;}
|
|
.cFD{color:#c671bc;background-color:#fef1f0;}
|
|
.cFE{color:#c7ab00;background-color:#fef1f0;}
|
|
.cFF{color:#fef1f0;background-color:#fef1f0;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF9>CTask</span><span class=cF0> *JukeReward(</span><span class=cF1>U8</span><span class=cF0> *message)
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> </span><span class=cF1>U8</span><span class=cF0> *buf;
|
|
<a name="l4"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
|
|
<a name="l5"></a> </span><span class=cF9>CTask</span><span class=cF0> *res = </span><span class=cF5>Spawn</span><span class=cF0>(&</span><span class=cF5>ServerCmdLine</span><span class=cF0>, </span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF6>"Reward"</span><span class=cF0>,, </span><span class=cF5>Fs</span><span class=cF0>);
|
|
<a name="l6"></a>
|
|
<a name="l7"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(res->task_title, </span><span class=cF6>"Reward"</span><span class=cF0>);
|
|
<a name="l8"></a> res->title_src = </span><span class=cF3>TTS_LOCKED_CONST</span><span class=cF0>;
|
|
<a name="l9"></a>
|
|
<a name="l10"></a> doc = </span><span class=cF5>DocNew</span><span class=cF0>(, res);
|
|
<a name="l11"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$WW+H,1$$RED$%s"</span><span class=cF0>, message);
|
|
<a name="l12"></a>
|
|
<a name="l13"></a> buf = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"DocEd(0x%X);"</span><span class=cF0>, doc);
|
|
<a name="l14"></a> </span><span class=cF5>TaskExe</span><span class=cF0>(res, </span><span class=cF3>NULL</span><span class=cF0>, buf, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_EXIT_ON_COMPLETE</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_FREE_ON_COMPLETE</span><span class=cF0>);
|
|
<a name="l15"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l16"></a> </span><span class=cF5>TaskWait</span><span class=cF0>(res);
|
|
<a name="l17"></a>
|
|
<a name="l18"></a> res->border_src = </span><span class=cF3>BDS_CONST</span><span class=cF0>;
|
|
<a name="l19"></a> res->border_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> << </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF5>DriveTextAttrGet</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>) & </span><span class=cFE>15</span><span class=cF0>;
|
|
<a name="l20"></a> res->text_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> << </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF3>BLUE</span><span class=cF0>;
|
|
<a name="l21"></a> res->win_inhibit = </span><span class=cF3>WIG_NO_FOCUS_TASK_DEFAULT</span><span class=cF0>;
|
|
<a name="l22"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->win_right + </span><span class=cFE>2</span><span class=cF0>, </span><span class=cF3>TEXT_COLS</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>, res);
|
|
<a name="l23"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFE>2</span><span class=cF0>, </span><span class=cF3>TEXT_ROWS</span><span class=cF0> - </span><span class=cFE>2</span><span class=cF0>, res);
|
|
<a name="l24"></a>
|
|
<a name="l25"></a> </span><span class=cF5>WinFocus</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->parent_task);
|
|
<a name="l26"></a>
|
|
<a name="l27"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l28"></a>}
|
|
<a name="l29"></a>
|
|
<a name="l30"></a></span><span class=cF9>CTask</span><span class=cF0> *SingleSong(</span><span class=cF1>U8</span><span class=cF0> *message, </span><span class=cF1>U8</span><span class=cF0> *name)
|
|
<a name="l31"></a>{
|
|
<a name="l32"></a> </span><span class=cF9>CTask</span><span class=cF0> *task = </span><span class=cF5>Spawn</span><span class=cF0>(&</span><span class=cF5>ServerCmdLine</span><span class=cF0>, </span><span class=cF3>NULL</span><span class=cF0>, name,, </span><span class=cF5>Fs</span><span class=cF0>);
|
|
<a name="l33"></a>
|
|
<a name="l34"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(task->task_title, name);
|
|
<a name="l35"></a> task->title_src = </span><span class=cF3>TTS_LOCKED_CONST</span><span class=cF0>;
|
|
<a name="l36"></a> </span><span class=cF5>TaskExe</span><span class=cF0>(task, </span><span class=cF5>Fs</span><span class=cF0>, </span><span class=cF6>";"</span><span class=cF0>, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_WAKE_MASTER</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_FREE_ON_COMPLETE</span><span class=cF0>);
|
|
<a name="l37"></a> </span><span class=cF5>WinHorz</span><span class=cF0>(task->win_left, task->win_left + </span><span class=cFE>50</span><span class=cF0>, task);
|
|
<a name="l38"></a> </span><span class=cF5>WinVert</span><span class=cF0>(</span><span class=cFE>2</span><span class=cF0>, </span><span class=cFE>2</span><span class=cF0> + </span><span class=cFE>8</span><span class=cF0>, task);
|
|
<a name="l39"></a> task->win_inhibit = </span><span class=cF3>WIG_NO_FOCUS_TASK_DEFAULT</span><span class=cF0>;
|
|
<a name="l40"></a> </span><span class=cF5>TaskExe</span><span class=cF0>(task, </span><span class=cF3>NULL</span><span class=cF0>, message, </span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_EXIT_ON_COMPLETE</span><span class=cF0> |</span><span class=cFE>1</span><span class=cF0> << </span><span class=cF3>JOBf_FREE_ON_COMPLETE</span><span class=cF0>);
|
|
<a name="l41"></a> </span><span class=cF5>DocPut</span><span class=cF0>(task)->max_entries = </span><span class=cFE>100</span><span class=cF0>;
|
|
<a name="l42"></a>
|
|
<a name="l43"></a> </span><span class=cF1>return</span><span class=cF0> task;
|
|
<a name="l44"></a>}
|
|
<a name="l45"></a>
|
|
<a name="l46"></a>#</span><span class=cF1>define</span><span class=cF0> JB_RUN_LEVEL_NULL </span><span class=cFE>0</span><span class=cF0>
|
|
<a name="l47"></a>#</span><span class=cF1>define</span><span class=cF0> JB_RUN_LEVEL_ONE </span><span class=cFE>1</span><span class=cF0>
|
|
<a name="l48"></a>#</span><span class=cF1>define</span><span class=cF0> JB_RUN_LEVEL_TWO </span><span class=cFE>2</span><span class=cF0>
|
|
<a name="l49"></a>
|
|
<a name="l50"></a></span><span class=cF1>Bool</span><span class=cF0> JBPutKey(</span><span class=cF9>CDoc</span><span class=cF0> *doc, </span><span class=cF1>U8</span><span class=cF0> *, </span><span class=cF9>I64</span><span class=cF0> ch, </span><span class=cF9>I64</span><span class=cF0> sc)
|
|
<a name="l51"></a>{</span><span class=cF2>//ch=ASCII; sc=scan_code</span><span class=cF0>
|
|
<a name="l52"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce = doc->cur_entry, *doc_e;
|
|
<a name="l53"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde;
|
|
<a name="l54"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l55"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
|
<a name="l56"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc2;
|
|
<a name="l57"></a>
|
|
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>sc & (</span><span class=cF3>SCF_ALT</span><span class=cF0> | </span><span class=cF3>SCF_CTRL</span><span class=cF0> | </span><span class=cF3>SCF_SHIFT</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> && doc_ce->type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0> && doc_ce->left_exp >= </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l59"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l60"></a> tmpde = doc_ce->left_exp;
|
|
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (sc.u8[</span><span class=cFE>0</span><span class=cF0>] == </span><span class=cF3>SC_DELETE</span><span class=cF0>)
|
|
<a name="l62"></a> {
|
|
<a name="l63"></a> </span><span class=cF5>Beep</span><span class=cF0>;
|
|
<a name="l64"></a> </span><span class=cF5>Silent</span><span class=cF0>;
|
|
<a name="l65"></a> </span><span class=cF5>Del</span><span class=cF0>(tmpde->full_name);
|
|
<a name="l66"></a> </span><span class=cF5>Silent</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l67"></a> }
|
|
<a name="l68"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0> <= ch <= </span><span class=cF6>'9'</span><span class=cF0>)
|
|
<a name="l69"></a> {
|
|
<a name="l70"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_ce->tag</span><span class=cF7>)</span><span class=cF0> > </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l71"></a> doc_ce->tag[</span><span class=cFE>0</span><span class=cF0>] = ch;
|
|
<a name="l72"></a> doc2 = </span><span class=cF5>DocRead</span><span class=cF0>(tmpde->full_name);
|
|
<a name="l73"></a> </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc2, </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l74"></a> doc_e = doc2->cur_entry;
|
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc2 && doc_e->type_u8 == </span><span class=cF3>DOCT_TEXT</span><span class=cF0> && </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e->tag</span><span class=cF7>)</span><span class=cF0> >= </span><span class=cFE>3</span><span class=cF0>)
|
|
<a name="l76"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l77"></a> doc_e->tag[</span><span class=cFE>2</span><span class=cF0>] = ch;
|
|
<a name="l78"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(doc2);
|
|
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l80"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc2);
|
|
<a name="l81"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l82"></a> }
|
|
<a name="l83"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF6>'r'</span><span class=cF0>)
|
|
<a name="l84"></a> {
|
|
<a name="l85"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>DocTreeFFind</span><span class=cF7>(</span><span class=cF0>tmpde->full_name, </span><span class=cF6>"Reward1"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l86"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l87"></a> doc2 = </span><span class=cF5>DocRead</span><span class=cF0>(tmpde->full_name);
|
|
<a name="l88"></a> </span><span class=cF5>DocGoToLine</span><span class=cF0>(doc2, </span><span class=cFE>2</span><span class=cF0>);
|
|
<a name="l89"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc2,
|
|
<a name="l90"></a> </span><span class=cF6>"\n$TR,\"Reward1\"$\n"</span><span class=cF0>
|
|
<a name="l91"></a> </span><span class=cF6>"$ID,2$CallExtStr(\"JukeReward\",\"\"\n"</span><span class=cF0>
|
|
<a name="l92"></a> </span><span class=cF6>"$TR,\"Reward2\"$\n"</span><span class=cF0>
|
|
<a name="l93"></a> </span><span class=cF6>"$ID,2$\n"</span><span class=cF0>
|
|
<a name="l94"></a> </span><span class=cF6>"$ID,-2$\n"</span><span class=cF0>
|
|
<a name="l95"></a> </span><span class=cF6>");\n$ID,-2$\n"</span><span class=cF0>
|
|
<a name="l96"></a> );
|
|
<a name="l97"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(doc2);
|
|
<a name="l98"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc2);
|
|
<a name="l99"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocTreeFFind</span><span class=cF7>(</span><span class=cF0>tmpde->full_name, </span><span class=cF6>"Reward1/Reward2"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l101"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l102"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFE>5</span><span class=cF0>; i++)
|
|
<a name="l103"></a> {
|
|
<a name="l104"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s %s %s %s "</span><span class=cF0>, </span><span class=cF5>GodWordStr</span><span class=cF0>, </span><span class=cF5>GodWordStr</span><span class=cF0>, </span><span class=cF5>GodWordStr</span><span class=cF0>, </span><span class=cF5>GodWordStr</span><span class=cF0>);
|
|
<a name="l105"></a> </span><span class=cF5>DocTreeFAppend</span><span class=cF0>(tmpde->full_name, </span><span class=cF6>"Reward1/Reward2"</span><span class=cF0>, </span><span class=cF6>"\"%s\"\n"</span><span class=cF0>, st);
|
|
<a name="l106"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l107"></a> }
|
|
<a name="l108"></a> </span><span class=cF5>In</span><span class=cF0>(</span><span class=cF6>" "</span><span class=cF0>);
|
|
<a name="l109"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l110"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l111"></a> }
|
|
<a name="l112"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch == </span><span class=cF3>CH_SPACE</span><span class=cF0> || ch == </span><span class=cF3>CH_ESC</span><span class=cF0>)
|
|
<a name="l113"></a> tmpde->user_data++; </span><span class=cF2>//JB_RUN_LEVEL++</span><span class=cF0>
|
|
<a name="l114"></a> </span><span class=cF2>//<SPACE> is followed by <ESC> --> JB_RUN_LEVEL_TWO</span><span class=cF0>
|
|
<a name="l115"></a> </span><span class=cF2>//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE</span><span class=cF0>
|
|
<a name="l116"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l117"></a>
|
|
<a name="l118"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l119"></a>}
|
|
<a name="l120"></a>
|
|
<a name="l121"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> JukeBox(</span><span class=cF1>U8</span><span class=cF0> *dirname=</span><span class=cF6>"~/Psalmody"</span><span class=cF0>, </span><span class=cF1>U8</span><span class=cF0> **_filename=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l122"></a>{</span><span class=cF2>//_filename is for using this as a song-chooser program.</span><span class=cF0>
|
|
<a name="l123"></a> </span><span class=cF9>I64</span><span class=cF0> i = </span><span class=cFE>0</span><span class=cF0>, rating;
|
|
<a name="l124"></a> </span><span class=cF1>U8</span><span class=cF0> *st, *st2;
|
|
<a name="l125"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde, *tmpde1;
|
|
<a name="l126"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc = </span><span class=cF5>DocNew</span><span class=cF0>, *s;
|
|
<a name="l127"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
|
<a name="l128"></a> </span><span class=cF9>CTask</span><span class=cF0> *task = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l129"></a>
|
|
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (_filename)
|
|
<a name="l131"></a> *_filename = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l132"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/System/TaskSettings.CC.html#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
|
<a name="l133"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
|
|
<a name="l134"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l136"></a> dirname = </span><span class=cF5>StrNew</span><span class=cF0>(dirname);
|
|
<a name="l137"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s/*.CC"</span><span class=cF0>, dirname);
|
|
<a name="l138"></a> tmpde = tmpde1 = </span><span class=cF5>FilesFind</span><span class=cF0>(st);
|
|
<a name="l139"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l140"></a> </span><span class=cF5>Free</span><span class=cF0>(dirname);
|
|
<a name="l141"></a> doc->user_put_key = &JBPutKey;
|
|
<a name="l142"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,
|
|
<a name="l143"></a> </span><span class=cF6>"Key: $GREEN$Graphics $BLUE$Words $RED$No Nothing "</span><span class=cF0>
|
|
<a name="l144"></a> </span><span class=cF6>"$BLACK$Incomplete $CYAN$Special$FG$\n\n"</span><span class=cF0>
|
|
<a name="l145"></a> </span><span class=cF6>"$GREEN$<DEL>$FG$\tto delete a song.\n"</span><span class=cF0>
|
|
<a name="l146"></a> </span><span class=cF6>"'$GREEN$0$FG$'-'$GREEN$9$FG$'\tto rate a song.\n"</span><span class=cF0>
|
|
<a name="l147"></a> </span><span class=cF6>"'$GREEN$r$FG$'\tto get your reward from God.\n"</span><span class=cF0>);
|
|
<a name="l148"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde)
|
|
<a name="l149"></a> {
|
|
<a name="l150"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>i++ % </span><span class=cFE>5</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l151"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"\n"</span><span class=cF0>);
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>FileOcc</span><span class=cF7>(</span><span class=cF6>"Play("</span><span class=cF0>, tmpde->full_name, </span><span class=cF6>""</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l153"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l154"></a> st = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde->name);
|
|
<a name="l155"></a> </span><span class=cF5>FileExtRemove</span><span class=cF0>(st);
|
|
<a name="l156"></a> s = </span><span class=cF5>DocRead</span><span class=cF0>(tmpde->full_name);
|
|
<a name="l157"></a> doc_e = s->head.next;
|
|
<a name="l158"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != s && doc_e->type_u8 != </span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
|
|
<a name="l159"></a> doc_e = doc_e->next;
|
|
<a name="l160"></a> rating = </span><span class=cF6>'0'</span><span class=cF0>;
|
|
<a name="l161"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != s && doc_e->type_u8 == </span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
|
|
<a name="l162"></a> {
|
|
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0> <= doc_e->tag[</span><span class=cFE>2</span><span class=cF0>] <= </span><span class=cF6>'9'</span><span class=cF0>)
|
|
<a name="l164"></a> rating = doc_e->tag[</span><span class=cFE>2</span><span class=cF0>];
|
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>"incomplete"</span><span class=cF0>, doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l166"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$BLACK$"</span><span class=cF0>);
|
|
<a name="l167"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>"has graphics"</span><span class=cF0>, doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l168"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$GREEN$"</span><span class=cF0>);
|
|
<a name="l169"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>"has words"</span><span class=cF0>, doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l170"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$BLUE$"</span><span class=cF0>);
|
|
<a name="l171"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>"special"</span><span class=cF0>, doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l172"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$CYAN$"</span><span class=cF0>);
|
|
<a name="l173"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>StrMatch</span><span class=cF7>(</span><span class=cF6>"no nothing"</span><span class=cF0>, doc_e->tag</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l174"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l175"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$RED$"</span><span class=cF0>);
|
|
<a name="l176"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>FileOcc</span><span class=cF7>(</span><span class=cF6>"\\0"</span><span class=cF0>, tmpde->full_name, </span><span class=cF6>""</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l177"></a> {
|
|
<a name="l178"></a> s->cur_entry = doc_e->next;
|
|
<a name="l179"></a> s->cur_col = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l180"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(s, doc_e);
|
|
<a name="l181"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(s, </span><span class=cF6>"//0 has words\n"</span><span class=cF0>);
|
|
<a name="l182"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(s);
|
|
<a name="l183"></a> }
|
|
<a name="l184"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l185"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"$MU-UL,\"%c%-8ts\",LE=%d$ "</span><span class=cF0>, rating, st, tmpde);
|
|
<a name="l186"></a> tmpde->user_data = JB_RUN_LEVEL_NULL;
|
|
<a name="l187"></a> }
|
|
<a name="l188"></a> </span><span class=cF5>DocDel</span><span class=cF0>(s);
|
|
<a name="l189"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l190"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l191"></a> tmpde = tmpde->next;
|
|
<a name="l192"></a> }
|
|
<a name="l193"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>"\n$CYAN$$MU-UL,\"DONE\",LE=%d$\n"</span><span class=cF0>, </span><span class=cF3>DOCM_CANCEL</span><span class=cF0>);
|
|
<a name="l194"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l195"></a> {
|
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (_filename)
|
|
<a name="l197"></a> tmpde = </span><span class=cF5>PopUpMenu</span><span class=cF0>(doc, </span><span class=cF3>DOF_INTERCEPT_TASK_END</span><span class=cF0>);
|
|
<a name="l198"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l199"></a> tmpde = </span><span class=cF5>PopUpMenu</span><span class=cF0>(doc);
|
|
<a name="l200"></a> </span><span class=cF1>if</span><span class=cF0> (task)
|
|
<a name="l201"></a> </span><span class=cF5>Kill</span><span class=cF0>(task);
|
|
<a name="l202"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde <= </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l203"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l204"></a> st2 = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde->name);
|
|
<a name="l205"></a> </span><span class=cF1>if</span><span class=cF0> (_filename)
|
|
<a name="l206"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l207"></a> </span><span class=cF5>Free</span><span class=cF0>(*_filename);
|
|
<a name="l208"></a> *_filename = </span><span class=cF5>StrNew</span><span class=cF0>(tmpde->full_name);
|
|
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->user_data == JB_RUN_LEVEL_ONE)
|
|
<a name="l211"></a> </span><span class=cF1>break</span><span class=cF0>; </span><span class=cF2>//<ESC></span><span class=cF0>
|
|
<a name="l212"></a> tmpde->user_data = JB_RUN_LEVEL_NULL; </span><span class=cF2>//Reset from <SPACE></span><span class=cF0>
|
|
<a name="l213"></a> </span><span class=cF5>FileExtRemove</span><span class=cF0>(st2);
|
|
<a name="l214"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"ExeFile(\"%s\");"</span><span class=cF0>, tmpde->full_name);
|
|
<a name="l215"></a> </span><span class=cF5>MusicSettingsReset</span><span class=cF0>;
|
|
<a name="l216"></a> task = SingleSong(st, st2);
|
|
<a name="l217"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l218"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
|
<a name="l219"></a> }
|
|
<a name="l220"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
|
<a name="l221"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
|
<a name="l222"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l223"></a> </span><span class=cF1>catch</span><span class=cF0>
|
|
<a name="l224"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l225"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
|
<a name="l226"></a>}
|
|
</span></pre></body>
|
|
</html>
|