128 lines
11 KiB
Plaintext
128 lines
11 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"ScrnCast;Graphics/Device Contexts;Graphics/GR Files"</span><span class=cF0>
|
||
|
<a name="l2"></a>
|
||
|
<a name="l3"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>MV_FILE_MAX</span><span class=cF0> 0x007FF000
|
||
|
<a name="l4"></a>
|
||
|
<a name="l5"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>GR2MV</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *print_fmt=</span><span class=cF6>"VID%03d.MV"</span><span class=cF0>,
|
||
|
<a name="l6"></a> </span><span class=cF1>U8</span><span class=cF0> *files_find_mask,</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l7"></a>{</span><span class=cF2>/*Merge GR lst to MV file.</span><span class=cF0>
|
||
|
<a name="l8"></a></span><span class=cF2>"+d" will delete GR list files.</span><span class=cF0>
|
||
|
<a name="l9"></a></span><span class=cF2>*/</span><span class=cF0>
|
||
|
<a name="l10"></a> </span><span class=cF9>I64</span><span class=cF0> fuf_flags=0,file_num=0,size;
|
||
|
<a name="l11"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,*tmpde1;
|
||
|
<a name="l12"></a> </span><span class=cF1>U8</span><span class=cF0> *base,*dst,*src,*st;
|
||
|
<a name="l13"></a> </span><span class=cF9>CDC</span><span class=cF0> *dc,*dc_base=</span><span class=cF5>DCNew</span><span class=cF0>(</span><span class=cF3>GR_WIDTH</span><span class=cF0>,</span><span class=cF3>GR_HEIGHT</span><span class=cF0>);
|
||
|
<a name="l14"></a> </span><span class=cF9>CDate</span><span class=cF0> cdt;
|
||
|
<a name="l15"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent;
|
||
|
<a name="l16"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF6>"+f+F"</span><span class=cF0>);
|
||
|
<a name="l17"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,fu_flags);
|
||
|
<a name="l18"></a> tmpde=tmpde1=</span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask,fuf_flags&</span><span class=cF3>FUG_FILES_FIND</span><span class=cF0>);
|
||
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>progress1_max</span><span class=cF0>=</span><span class=cF5>LinkedLstCnt</span><span class=cF7>(</span><span class=cF0>tmpde1</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l20"></a> dst=base=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF3>MV_FILE_MAX</span><span class=cF0>);
|
||
|
<a name="l21"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) {
|
||
|
<a name="l22"></a> dc=</span><span class=cF5>GRRead</span><span class=cF0>(tmpde->full_name);
|
||
|
<a name="l23"></a> </span><span class=cF5>GrBlot</span><span class=cF0>(dc_base,dc->x0,dc->y0,dc);
|
||
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (dst+</span><span class=cF3>GR_FILE_MAX</span><span class=cF0>>base+</span><span class=cF3>MV_FILE_MAX</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l25"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(print_fmt,file_num++);
|
||
|
<a name="l26"></a> </span><span class=cF5>FileWrite</span><span class=cF0>(st,base,dst-base);
|
||
|
<a name="l27"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l28"></a> dst=base;
|
||
|
<a name="l29"></a>
|
||
|
<a name="l30"></a> cdt=dc->cdt;
|
||
|
<a name="l31"></a> dc=</span><span class=cF5>DCCopy</span><span class=cF0>(dc_base);
|
||
|
<a name="l32"></a> dc->cdt=cdt;
|
||
|
<a name="l33"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l34"></a> src=</span><span class=cF5>DCSave</span><span class=cF0>(dc,&size);
|
||
|
<a name="l35"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc);
|
||
|
<a name="l36"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,src,size);
|
||
|
<a name="l37"></a> dst+=size;
|
||
|
<a name="l38"></a> </span><span class=cF5>Free</span><span class=cF0>(src);
|
||
|
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (fuf_flags&</span><span class=cF3>FUF_DEL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l40"></a> old_silent=</span><span class=cF5>Silent</span><span class=cF0>;
|
||
|
<a name="l41"></a> </span><span class=cF5>Del</span><span class=cF0>(tmpde->full_name);
|
||
|
<a name="l42"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
|
||
|
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l44"></a> </span><span class=cFB>progress1</span><span class=cF0>++;
|
||
|
<a name="l45"></a> tmpde=tmpde->next;
|
||
|
<a name="l46"></a> }
|
||
|
<a name="l47"></a> </span><span class=cF1>if</span><span class=cF0> (dst>base) {
|
||
|
<a name="l48"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(print_fmt,file_num++);
|
||
|
<a name="l49"></a> </span><span class=cF5>FileWrite</span><span class=cF0>(st,base,dst-base);
|
||
|
<a name="l50"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l51"></a> }
|
||
|
<a name="l52"></a> </span><span class=cF5>Free</span><span class=cF0>(base);
|
||
|
<a name="l53"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l54"></a> </span><span class=cFB>progress1</span><span class=cF0>=</span><span class=cFB>progress1_max</span><span class=cF0>=0;
|
||
|
<a name="l55"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
||
|
<a name="l56"></a> </span><span class=cF5>DCDel</span><span class=cF0>(dc_base);
|
||
|
<a name="l57"></a> </span><span class=cF1>return</span><span class=cF0> file_num;
|
||
|
<a name="l58"></a>}
|
||
|
<a name="l59"></a>
|
||
|
<a name="l60"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"ScrnCast;Snd/AU Files"</span><span class=cF0>
|
||
|
<a name="l61"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>SndShift</span><span class=cF0>(</span><span class=cF9>CSndData</span><span class=cF0> *head,</span><span class=cF1>F64</span><span class=cF0> dt=0)
|
||
|
<a name="l62"></a>{</span><span class=cF2>//Shift CSndData in time.</span><span class=cF0>
|
||
|
<a name="l63"></a> </span><span class=cF9>CSndData</span><span class=cF0> *tmpsd,*tmpsd1;
|
||
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (dt) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l65"></a> tmpsd=head->next;
|
||
|
<a name="l66"></a> </span><span class=cF1>while</span><span class=cF0> (tmpsd!=head) {
|
||
|
<a name="l67"></a> tmpsd1=tmpsd->next;
|
||
|
<a name="l68"></a> tmpsd-></span><span class=cF5>tS</span><span class=cF0>-=dt;
|
||
|
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (tmpsd-></span><span class=cF5>tS</span><span class=cF0><tmpsd->last-></span><span class=cF5>tS</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l70"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpsd);
|
||
|
<a name="l71"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpsd);
|
||
|
<a name="l72"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l73"></a> tmpsd=tmpsd1;
|
||
|
<a name="l74"></a> }
|
||
|
<a name="l75"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l76"></a>}
|
||
|
<a name="l77"></a>
|
||
|
<a name="l78"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>AUWrite</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename,</span><span class=cF9>CSndData</span><span class=cF0> *head,</span><span class=cF9>CDate</span><span class=cF0> *t0_now,</span><span class=cF1>F64</span><span class=cF0> t0_tS)
|
||
|
<a name="l79"></a>{</span><span class=cF2>//Write AU file.</span><span class=cF0>
|
||
|
<a name="l80"></a> </span><span class=cF9>CSndData</span><span class=cF0> *tmpsd;
|
||
|
<a name="l81"></a> </span><span class=cF9>CAUData</span><span class=cF0> *base,*dst;
|
||
|
<a name="l82"></a> </span><span class=cF9>I64</span><span class=cF0> size=(1+</span><span class=cF5>QueCnt</span><span class=cF7>(</span><span class=cF0>head</span><span class=cF7>)</span><span class=cF0>)*</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CAUData</span><span class=cF0>);
|
||
|
<a name="l83"></a> </span><span class=cF1>U8</span><span class=cF0> *st=</span><span class=cF5>ExtDft</span><span class=cF0>(filename,</span><span class=cF6>"AU"</span><span class=cF0>);
|
||
|
<a name="l84"></a> base=dst=</span><span class=cF5>MAlloc</span><span class=cF0>(size);
|
||
|
<a name="l85"></a> tmpsd=head;
|
||
|
<a name="l86"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l87"></a> dst->cdt=t0_now(</span><span class=cF9>I64</span><span class=cF0>)+</span><span class=cF5>ToI64</span><span class=cF0>(</span><span class=cF3>CDATE_FREQ</span><span class=cF0>*</span><span class=cF7>(</span><span class=cF0>tmpsd-></span><span class=cF5>tS</span><span class=cF0>-t0_tS</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l88"></a> dst->ona=tmpsd->ona;
|
||
|
<a name="l89"></a> dst++;
|
||
|
<a name="l90"></a> tmpsd=tmpsd->next;
|
||
|
<a name="l91"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (tmpsd!=head);
|
||
|
<a name="l92"></a> </span><span class=cF5>FileWrite</span><span class=cF0>(st,base,dst</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-base</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l93"></a> </span><span class=cF5>Free</span><span class=cF0>(base);
|
||
|
<a name="l94"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l95"></a> </span><span class=cF1>return</span><span class=cF0> size;
|
||
|
<a name="l96"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|