ZealOS/docs/Apps/Psalmody/JukeBox.CC.html
TomAwezome 1b75d91002 Fix Mount AHCI Port selection.
Add arg to SATARep to specify drive types to show.
Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
2021-08-02 16:40:05 -04:00

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 V0.13">
<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>(&amp;</span><span class=cF5>ServerCmdLine</span><span class=cF0>, </span><span class=cF3>NULL</span><span class=cF0>, </span><span class=cF6>&quot;Reward&quot;</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-&gt;task_title, </span><span class=cF6>&quot;Reward&quot;</span><span class=cF0>);
<a name="l8"></a> res-&gt;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>&quot;$WW+H,1$$RED$%s&quot;</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>&quot;DocEd(0x%X);&quot;</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> &lt;&lt; </span><span class=cF3>JOBf_EXIT_ON_COMPLETE</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </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-&gt;border_src = </span><span class=cF3>BDS_CONST</span><span class=cF0>;
<a name="l19"></a> res-&gt;border_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </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>) &amp; </span><span class=cFE>15</span><span class=cF0>;
<a name="l20"></a> res-&gt;text_attr = </span><span class=cF3>LTGRAY</span><span class=cF0> &lt;&lt; </span><span class=cFE>4</span><span class=cF0> + </span><span class=cF3>BLUE</span><span class=cF0>;
<a name="l21"></a> res-&gt;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>-&gt;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>-&gt;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>(&amp;</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-&gt;task_title, name);
<a name="l35"></a> task-&gt;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>&quot;;&quot;</span><span class=cF0>, </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </span><span class=cF3>JOBf_WAKE_MASTER</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0> &lt;&lt; </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-&gt;win_left, task-&gt;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-&gt;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> &lt;&lt; </span><span class=cF3>JOBf_EXIT_ON_COMPLETE</span><span class=cF0> |</span><span class=cFE>1</span><span class=cF0> &lt;&lt; </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)-&gt;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-&gt;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 &amp; (</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> &amp;&amp; doc_ce-&gt;type_u8 == </span><span class=cF3>DOCT_MENU_VAL</span><span class=cF0> &amp;&amp; doc_ce-&gt;left_exp &gt;= </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-&gt;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-&gt;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> &lt;= ch &lt;= </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-&gt;tag</span><span class=cF7>)</span><span class=cF0> &gt; </span><span class=cFE>1</span><span class=cF0>)
<a name="l71"></a> doc_ce-&gt;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-&gt;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-&gt;cur_entry;
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e != doc2 &amp;&amp; doc_e-&gt;type_u8 == </span><span class=cF3>DOCT_TEXT</span><span class=cF0> &amp;&amp; </span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>doc_e-&gt;tag</span><span class=cF7>)</span><span class=cF0> &gt;= </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-&gt;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-&gt;full_name, </span><span class=cF6>&quot;Reward1&quot;</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-&gt;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>&quot;\n$TR,\&quot;Reward1\&quot;$\n&quot;</span><span class=cF0>
<a name="l91"></a> </span><span class=cF6>&quot;$ID,2$CallExtStr(\&quot;JukeReward\&quot;,\&quot;\&quot;\n&quot;</span><span class=cF0>
<a name="l92"></a> </span><span class=cF6>&quot;$TR,\&quot;Reward2\&quot;$\n&quot;</span><span class=cF0>
<a name="l93"></a> </span><span class=cF6>&quot;$ID,2$\n&quot;</span><span class=cF0>
<a name="l94"></a> </span><span class=cF6>&quot;$ID,-2$\n&quot;</span><span class=cF0>
<a name="l95"></a> </span><span class=cF6>&quot;);\n$ID,-2$\n&quot;</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-&gt;full_name, </span><span class=cF6>&quot;Reward1/Reward2&quot;</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 &lt; </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>&quot;%s %s %s %s &quot;</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-&gt;full_name, </span><span class=cF6>&quot;Reward1/Reward2&quot;</span><span class=cF0>, </span><span class=cF6>&quot;\&quot;%s\&quot;\n&quot;</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>&quot; &quot;</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-&gt;user_data++; </span><span class=cF2>//JB_RUN_LEVEL++</span><span class=cF0>
<a name="l114"></a> </span><span class=cF2>//&lt;SPACE&gt; is followed by &lt;ESC&gt; --&gt; JB_RUN_LEVEL_TWO</span><span class=cF0>
<a name="l115"></a> </span><span class=cF2>//Actual &lt;ESC&gt; just exits --&gt; 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>&quot;~/Psalmody&quot;</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>&quot;%s/*.CC&quot;</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-&gt;user_put_key = &amp;JBPutKey;
<a name="l142"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,
<a name="l143"></a> </span><span class=cF6>&quot;Key: $GREEN$Graphics $BLUE$Words $RED$No Nothing &quot;</span><span class=cF0>
<a name="l144"></a> </span><span class=cF6>&quot;$BLACK$Incomplete $CYAN$Special$FG$\n\n&quot;</span><span class=cF0>
<a name="l145"></a> </span><span class=cF6>&quot;$GREEN$&lt;DEL&gt;$FG$\tto delete a song.\n&quot;</span><span class=cF0>
<a name="l146"></a> </span><span class=cF6>&quot;'$GREEN$0$FG$'-'$GREEN$9$FG$'\tto rate a song.\n&quot;</span><span class=cF0>
<a name="l147"></a> </span><span class=cF6>&quot;'$GREEN$r$FG$'\tto get your reward from God.\n&quot;</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>&quot;\n&quot;</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>&quot;Play(&quot;</span><span class=cF0>, tmpde-&gt;full_name, </span><span class=cF6>&quot;&quot;</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-&gt;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-&gt;full_name);
<a name="l157"></a> doc_e = s-&gt;head.next;
<a name="l158"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e != s &amp;&amp; doc_e-&gt;type_u8 != </span><span class=cF3>DOCT_TEXT</span><span class=cF0>)
<a name="l159"></a> doc_e = doc_e-&gt;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 &amp;&amp; doc_e-&gt;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> &lt;= doc_e-&gt;tag[</span><span class=cFE>2</span><span class=cF0>] &lt;= </span><span class=cF6>'9'</span><span class=cF0>)
<a name="l164"></a> rating = doc_e-&gt;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>&quot;incomplete&quot;</span><span class=cF0>, doc_e-&gt;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>&quot;$BLACK$&quot;</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>&quot;has graphics&quot;</span><span class=cF0>, doc_e-&gt;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>&quot;$GREEN$&quot;</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>&quot;has words&quot;</span><span class=cF0>, doc_e-&gt;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>&quot;$BLUE$&quot;</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>&quot;special&quot;</span><span class=cF0>, doc_e-&gt;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>&quot;$CYAN$&quot;</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>&quot;no nothing&quot;</span><span class=cF0>, doc_e-&gt;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>&quot;$RED$&quot;</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>&quot;\\0&quot;</span><span class=cF0>, tmpde-&gt;full_name, </span><span class=cF6>&quot;&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l177"></a> {
<a name="l178"></a> s-&gt;cur_entry = doc_e-&gt;next;
<a name="l179"></a> s-&gt;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>&quot;//0 has words\n&quot;</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>&quot;$MU-UL,\&quot;%c%-8ts\&quot;,LE=%d$ &quot;</span><span class=cF0>, rating, st, tmpde);
<a name="l186"></a> tmpde-&gt;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-&gt;next;
<a name="l192"></a> }
<a name="l193"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc, </span><span class=cF6>&quot;\n$CYAN$$MU-UL,\&quot;DONE\&quot;,LE=%d$\n&quot;</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 &lt;= </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-&gt;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-&gt;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-&gt;user_data == JB_RUN_LEVEL_ONE)
<a name="l211"></a> </span><span class=cF1>break</span><span class=cF0>; </span><span class=cF2>//&lt;ESC&gt;</span><span class=cF0>
<a name="l212"></a> tmpde-&gt;user_data = JB_RUN_LEVEL_NULL; </span><span class=cF2>//Reset from &lt;SPACE&gt;</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>&quot;ExeFile(\&quot;%s\&quot;);&quot;</span><span class=cF0>, tmpde-&gt;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>