459 lines
41 KiB
Plaintext
459 lines
41 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=cF1>U0</span><span class=cF0> PsmNoteDel(PsmNote *tmpn)
|
||
|
<a name="l2"></a>{
|
||
|
<a name="l3"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpn->word);
|
||
|
<a name="l4"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpn);
|
||
|
<a name="l5"></a>}
|
||
|
<a name="l6"></a>
|
||
|
<a name="l7"></a>PsmNote *PsmNoteCopy(PsmNote *tmpn)
|
||
|
<a name="l8"></a>{
|
||
|
<a name="l9"></a> PsmNote *tmpn1=</span><span class=cF5>MAllocIdent</span><span class=cF0>(tmpn);
|
||
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->word)
|
||
|
<a name="l11"></a> tmpn1->word=</span><span class=cF5>StrNew</span><span class=cF0>(tmpn->word);
|
||
|
<a name="l12"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l13"></a> tmpn1->word=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l14"></a> </span><span class=cF1>return</span><span class=cF0> tmpn1;
|
||
|
<a name="l15"></a>}
|
||
|
<a name="l16"></a>
|
||
|
<a name="l17"></a></span><span class=cF1>U0</span><span class=cF0> PsmSongDel(PsmNote *head)
|
||
|
<a name="l18"></a>{
|
||
|
<a name="l19"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l20"></a> tmpn=head->next;
|
||
|
<a name="l21"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l22"></a> tmpn1=tmpn->next;
|
||
|
<a name="l23"></a> PsmNoteDel(tmpn);
|
||
|
<a name="l24"></a> tmpn=tmpn1;
|
||
|
<a name="l25"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l26"></a> </span><span class=cF5>QueInit</span><span class=cF0>(head);
|
||
|
<a name="l27"></a>}
|
||
|
<a name="l28"></a>
|
||
|
<a name="l29"></a></span><span class=cF1>U0</span><span class=cF0> PsmCutToClip()
|
||
|
<a name="l30"></a>{
|
||
|
<a name="l31"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l32"></a> PsmSongDel(&psm.clip);
|
||
|
<a name="l33"></a> tmpn=psm.head.next;
|
||
|
<a name="l34"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l35"></a> tmpn1=tmpn->next;
|
||
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->flags&PSMF_SEL) {
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (psm.cur_note==tmpn)
|
||
|
<a name="l38"></a> psm.cur_note=tmpn->next;
|
||
|
<a name="l39"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpn);
|
||
|
<a name="l40"></a> tmpn->flags&=~PSMF_SEL;
|
||
|
<a name="l41"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpn,psm.clip.last);
|
||
|
<a name="l42"></a> }
|
||
|
<a name="l43"></a> tmpn=tmpn1;
|
||
|
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l45"></a>}
|
||
|
<a name="l46"></a>
|
||
|
<a name="l47"></a></span><span class=cF1>U0</span><span class=cF0> PsmPasteClip()
|
||
|
<a name="l48"></a>{
|
||
|
<a name="l49"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l50"></a> tmpn=psm.clip.next;
|
||
|
<a name="l51"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.clip) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l52"></a> tmpn1=PsmNoteCopy(tmpn);
|
||
|
<a name="l53"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpn1,psm.cur_note->last);
|
||
|
<a name="l54"></a> tmpn=tmpn->next;
|
||
|
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l56"></a>}
|
||
|
<a name="l57"></a>
|
||
|
<a name="l58"></a></span><span class=cF1>U0</span><span class=cF0> PsmCopyToClip()
|
||
|
<a name="l59"></a>{
|
||
|
<a name="l60"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l61"></a> PsmSongDel(&psm.clip);
|
||
|
<a name="l62"></a> tmpn=psm.head.next;
|
||
|
<a name="l63"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->flags&PSMF_SEL) {
|
||
|
<a name="l65"></a> tmpn->flags&=~PSMF_SEL;
|
||
|
<a name="l66"></a> tmpn1=PsmNoteCopy(tmpn);
|
||
|
<a name="l67"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpn1,psm.clip.last);
|
||
|
<a name="l68"></a> }
|
||
|
<a name="l69"></a> tmpn=tmpn->next;
|
||
|
<a name="l70"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l71"></a>}
|
||
|
<a name="l72"></a>
|
||
|
<a name="l73"></a>PsmNote *PsmFindNote(</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0>)
|
||
|
<a name="l74"></a>{
|
||
|
<a name="l75"></a> PsmNote *tmpn=psm.head.next;
|
||
|
<a name="l76"></a> PsmRecalcNoteXY;
|
||
|
<a name="l77"></a> x+=PSM_NOTE_SPACING/2;
|
||
|
<a name="l78"></a> </span><span class=cF1>while</span><span class=cF0> (x>tmpn->next->x && tmpn!=&psm.head)
|
||
|
<a name="l79"></a> tmpn=tmpn->next;
|
||
|
<a name="l80"></a> </span><span class=cF1>return</span><span class=cF0> tmpn;
|
||
|
<a name="l81"></a>}
|
||
|
<a name="l82"></a>
|
||
|
<a name="l83"></a></span><span class=cF1>U8</span><span class=cF0> *PsmMusicSetOctave(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> *psm_octave)
|
||
|
<a name="l84"></a>{
|
||
|
<a name="l85"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0><=*st<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l86"></a> *psm_octave=*st++ -</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l87"></a> </span><span class=cF1>return</span><span class=cF0> st;
|
||
|
<a name="l88"></a>}
|
||
|
<a name="l89"></a>
|
||
|
<a name="l90"></a></span><span class=cF1>U8</span><span class=cF0> *PsmMusicSetNoteLen(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF1>F64</span><span class=cF0> *psm_duration)
|
||
|
<a name="l91"></a>{
|
||
|
<a name="l92"></a> </span><span class=cF1>Bool</span><span class=cF0> cont=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l93"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l94"></a> </span><span class=cF1>switch</span><span class=cF0> (*st++) {
|
||
|
<a name="l95"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'w'</span><span class=cF0>: *psm_duration=4.0; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l96"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'h'</span><span class=cF0>: *psm_duration=2.0; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l97"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'q'</span><span class=cF0>: *psm_duration=1.0; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l98"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'e'</span><span class=cF0>: *psm_duration=0.5; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l99"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'s'</span><span class=cF0>: *psm_duration=0.25; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l100"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'t'</span><span class=cF0>: *psm_duration=2.0* *psm_duration/3.0; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l101"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'.'</span><span class=cF0>: *psm_duration=1.5* *psm_duration; </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l102"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l103"></a> st--;
|
||
|
<a name="l104"></a> cont=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l105"></a> }
|
||
|
<a name="l106"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (cont);
|
||
|
<a name="l107"></a> </span><span class=cF1>return</span><span class=cF0> st;
|
||
|
<a name="l108"></a>}
|
||
|
<a name="l109"></a>
|
||
|
<a name="l110"></a></span><span class=cF1>U0</span><span class=cF0> PsmLoadSongStr(</span><span class=cF1>U8</span><span class=cF0> *st,</span><span class=cF9>I64</span><span class=cF0> *psm_octave,</span><span class=cF1>F64</span><span class=cF0> *psm_duration)
|
||
|
<a name="l111"></a>{
|
||
|
<a name="l112"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l113"></a> </span><span class=cF9>I64</span><span class=cF0> note,i=0;
|
||
|
<a name="l114"></a> </span><span class=cF1>while</span><span class=cF0> (*st) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l115"></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="l116"></a> </span><span class=cF1>while</span><span class=cF0> (*st && !</span><span class=cF7>(</span><span class=cF6>'A'</span><span class=cF0><=*st<=</span><span class=cF6>'G'</span><span class=cF7>)</span><span class=cF0> && *st!=</span><span class=cF6>'R'</span><span class=cF0>) {
|
||
|
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (*st==</span><span class=cF6>'M'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l118"></a> tmpn1=</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="l119"></a> tmpn1->type=PSMT_METER;
|
||
|
<a name="l120"></a> st++;
|
||
|
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'1'</span><span class=cF0><=*st<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l122"></a> tmpn1->meter_top=*st++-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l123"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l124"></a> tmpn1->meter_top=4;
|
||
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (*st==</span><span class=cF6>'/'</span><span class=cF0>)
|
||
|
<a name="l126"></a> st++;
|
||
|
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'1'</span><span class=cF0><=*st<=</span><span class=cF6>'9'</span><span class=cF0>)
|
||
|
<a name="l128"></a> tmpn1->meter_bottom=*st++-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l129"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l130"></a> tmpn1->meter_bottom=4;
|
||
|
<a name="l131"></a> PsmSetWidth(tmpn1);
|
||
|
<a name="l132"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpn1,psm.head.last);
|
||
|
<a name="l133"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l134"></a> </span><span class=cF1>while</span><span class=cF0> (*st==</span><span class=cF6>'('</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l135"></a> </span><span class=cF5>Bts</span><span class=cF0>(&tmpn->flags,PSMf_TIE);
|
||
|
<a name="l136"></a> st++;
|
||
|
<a name="l137"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l138"></a> st=PsmMusicSetOctave(st,psm_octave);
|
||
|
<a name="l139"></a> st=PsmMusicSetNoteLen(st,psm_duration);
|
||
|
<a name="l140"></a> }
|
||
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (!*st) {
|
||
|
<a name="l142"></a> PsmNoteDel(tmpn);
|
||
|
<a name="l143"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l144"></a> }
|
||
|
<a name="l145"></a> note=*st++-</span><span class=cF6>'A'</span><span class=cF0>;
|
||
|
<a name="l146"></a> </span><span class=cF1>if</span><span class=cF0> (note<7) {
|
||
|
<a name="l147"></a> note=</span><span class=cFB>music</span><span class=cF0>.note_map[note];
|
||
|
<a name="l148"></a> </span><span class=cF1>if</span><span class=cF0> (*st==</span><span class=cF6>'b'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l149"></a> </span><span class=cF5>Bts</span><span class=cF0>(&tmpn->flags,PSMf_FLAT);
|
||
|
<a name="l150"></a> note--;
|
||
|
<a name="l151"></a> st++;
|
||
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (note<0) </span><span class=cF2>//Ab</span><span class=cF0>
|
||
|
<a name="l153"></a> note=11;
|
||
|
<a name="l154"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (note==2) </span><span class=cF2>//Cb</span><span class=cF0>
|
||
|
<a name="l155"></a> *psm_octave-=1;
|
||
|
<a name="l156"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*st==</span><span class=cF6>'#'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l157"></a> </span><span class=cF5>Bts</span><span class=cF0>(&tmpn->flags,PSMf_SHARP);
|
||
|
<a name="l158"></a> note++;
|
||
|
<a name="l159"></a> st++;
|
||
|
<a name="l160"></a> </span><span class=cF1>if</span><span class=cF0> (note>11) </span><span class=cF2>//G#</span><span class=cF0>
|
||
|
<a name="l161"></a> note=0;
|
||
|
<a name="l162"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (note==3) </span><span class=cF2>//B#</span><span class=cF0>
|
||
|
<a name="l163"></a> *psm_octave+=1;
|
||
|
<a name="l164"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l165"></a> tmpn->ona=</span><span class=cF5>Note2Ona</span><span class=cF0>(note,*psm_octave);
|
||
|
<a name="l166"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l167"></a> tmpn->ona=0;
|
||
|
<a name="l168"></a> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=2*.25/3)
|
||
|
<a name="l169"></a> i=0;
|
||
|
<a name="l170"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=.25)
|
||
|
<a name="l171"></a> i=1;
|
||
|
<a name="l172"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=2*.5/3)
|
||
|
<a name="l173"></a> i=2;
|
||
|
<a name="l174"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=.5)
|
||
|
<a name="l175"></a> i=3;
|
||
|
<a name="l176"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=2.0/3)
|
||
|
<a name="l177"></a> i=4;
|
||
|
<a name="l178"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=.5*1.5)
|
||
|
<a name="l179"></a> i=5;
|
||
|
<a name="l180"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=1.0)
|
||
|
<a name="l181"></a> i=6;
|
||
|
<a name="l182"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=1.5)
|
||
|
<a name="l183"></a> i=7;
|
||
|
<a name="l184"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=2.0)
|
||
|
<a name="l185"></a> i=8;
|
||
|
<a name="l186"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=3.0)
|
||
|
<a name="l187"></a> i=9;
|
||
|
<a name="l188"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*psm_duration<=4.0)
|
||
|
<a name="l189"></a> i=10;
|
||
|
<a name="l190"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l191"></a> i=11;
|
||
|
<a name="l192"></a> tmpn->duration=i;
|
||
|
<a name="l193"></a> tmpn->type=PSMT_NOTE;
|
||
|
<a name="l194"></a> PsmSetWidth(tmpn);
|
||
|
<a name="l195"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpn,psm.cur_note->last);
|
||
|
<a name="l196"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l197"></a>}
|
||
|
<a name="l198"></a>
|
||
|
<a name="l199"></a></span><span class=cF1>U0</span><span class=cF0> PsmLoadSong(</span><span class=cF1>U8</span><span class=cF0> *filename,</span><span class=cF9>I64</span><span class=cF0> *psm_octave,</span><span class=cF1>F64</span><span class=cF0> *psm_duration)
|
||
|
<a name="l200"></a>{
|
||
|
<a name="l201"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
||
|
<a name="l202"></a> PsmNote *tmpn;
|
||
|
<a name="l203"></a> </span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc=</span><span class=cF5>CmpCtrlNew</span><span class=cF0>(</span><span class=cF5>MStrPrint</span><span class=cF7>(</span><span class=cF6>"#include \"%s\""</span><span class=cF0>,filename</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>FileOcc</span><span class=cF7>(</span><span class=cF6>"incomplete"</span><span class=cF0>,filename,</span><span class=cF6>""</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l205"></a> psm.incomplete_entry->checked=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l206"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l207"></a> psm.incomplete_entry->checked=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l208"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l209"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF3>TK_IDENT</span><span class=cF0>)
|
||
|
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>cc->cur_str,</span><span class=cF6>"Play"</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'('</span><span class=cF0>)
|
||
|
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l213"></a> tmpn=psm.head.last;
|
||
|
<a name="l214"></a> st=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l215"></a> PsmLoadSongStr(st,psm_octave,psm_duration);
|
||
|
<a name="l216"></a> </span><span class=cF1>if</span><span class=cF0> (cc->token==</span><span class=cF6>','</span><span class=cF0>) {
|
||
|
<a name="l217"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_STR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l218"></a> st=</span><span class=cF5>LexExtStr</span><span class=cF0>(cc);
|
||
|
<a name="l219"></a> </span><span class=cF1>do</span><span class=cF0> {
|
||
|
<a name="l220"></a> </span><span class=cF1>do</span><span class=cF0> tmpn=tmpn->next;
|
||
|
<a name="l221"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head && tmpn->type==PSMT_METER);
|
||
|
<a name="l222"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn!=&psm.head)
|
||
|
<a name="l223"></a> tmpn->word=</span><span class=cF5>StrNew</span><span class=cF0>(st);
|
||
|
<a name="l224"></a> st+=</span><span class=cF5>StrLen</span><span class=cF0>(st)+1;
|
||
|
<a name="l225"></a> } </span><span class=cF1>while</span><span class=cF0> (*st);
|
||
|
<a name="l226"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l227"></a> }
|
||
|
<a name="l228"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l229"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>cc->cur_str,</span><span class=cF6>"music"</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l230"></a> </span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'.'</span><span class=cF0> && </span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_IDENT</span><span class=cF0>) {
|
||
|
<a name="l231"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>cc->cur_str,</span><span class=cF6>"tempo"</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l232"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'='</span><span class=cF0> && </span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_F64</span><span class=cF0>) {
|
||
|
<a name="l233"></a> </span><span class=cFB>music</span><span class=cF0>.tempo=cc->cur_f64-0.0005;
|
||
|
<a name="l234"></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-0.5</span><span class=cF7>)</span><span class=cF0>/4.4);
|
||
|
<a name="l235"></a> }
|
||
|
<a name="l236"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCmp</span><span class=cF7>(</span><span class=cF0>cc->cur_str,</span><span class=cF6>"stacatto_factor"</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l237"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF6>'='</span><span class=cF0> && </span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0>==</span><span class=cF3>TK_F64</span><span class=cF0>) {
|
||
|
<a name="l238"></a> </span><span class=cFB>music</span><span class=cF0>.stacatto_factor=cc->cur_f64-0.0005;
|
||
|
<a name="l239"></a> tempo_state.stacatto=
|
||
|
<a name="l240"></a> </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-0.12</span><span class=cF7>)</span><span class=cF0>/0.88);
|
||
|
<a name="l241"></a> }
|
||
|
<a name="l242"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l243"></a> }
|
||
|
<a name="l244"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l245"></a> </span><span class=cF5>CmpCtrlDel</span><span class=cF0>(cc);
|
||
|
<a name="l246"></a>}
|
||
|
<a name="l247"></a>
|
||
|
<a name="l248"></a></span><span class=cF1>U8</span><span class=cF0> *PsmCvtSong()
|
||
|
<a name="l249"></a>{
|
||
|
<a name="l250"></a> PsmNote *tmpn;
|
||
|
<a name="l251"></a> </span><span class=cF1>U8</span><span class=cF0> *st,*src,*dst;
|
||
|
<a name="l252"></a> </span><span class=cF9>I64</span><span class=cF0> i,ona,note,octave,last_octave,last_duration;
|
||
|
<a name="l253"></a>
|
||
|
<a name="l254"></a> i=0;
|
||
|
<a name="l255"></a> tmpn=psm.head.next;
|
||
|
<a name="l256"></a> last_octave=</span><span class=cF3>I64_MIN</span><span class=cF0>;
|
||
|
<a name="l257"></a> last_duration=-1;
|
||
|
<a name="l258"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l259"></a> dst=&tmpn->ascii;
|
||
|
<a name="l260"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type==PSMT_METER) {
|
||
|
<a name="l261"></a> *dst++=</span><span class=cF6>'M'</span><span class=cF0>;
|
||
|
<a name="l262"></a> *dst++=tmpn->meter_top+</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l263"></a> *dst++=</span><span class=cF6>'/'</span><span class=cF0>;
|
||
|
<a name="l264"></a> *dst++=tmpn->meter_bottom+</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l265"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->ona) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l267"></a> ona=tmpn->ona;
|
||
|
<a name="l268"></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_SHARP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l269"></a> ona--;
|
||
|
<a name="l270"></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_FLAT</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l271"></a> ona++;
|
||
|
<a name="l272"></a> octave=</span><span class=cF5>Ona2Octave</span><span class=cF0>(ona);
|
||
|
<a name="l273"></a> note =</span><span class=cF5>Ona2Note</span><span class=cF0> (ona);
|
||
|
<a name="l274"></a> note=</span><span class=cFB>music</span><span class=cF0>.note_map[*</span><span class=cF5>LstSub</span><span class=cF0>(note,psm_note_lst)-</span><span class=cF6>'A'</span><span class=cF0>];
|
||
|
<a name="l275"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l276"></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="l277"></a> *dst++=</span><span class=cF6>'('</span><span class=cF0>;
|
||
|
<a name="l278"></a> </span><span class=cF1>if</span><span class=cF0> (octave!=last_octave && tmpn->ona) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l279"></a> *dst++=octave+</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l280"></a> last_octave=octave;
|
||
|
<a name="l281"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l282"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->duration!=last_duration) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l283"></a> src=</span><span class=cF5>LstSub</span><span class=cF0>(tmpn->duration,psm_duration_lst);
|
||
|
<a name="l284"></a> *dst++=src[0];
|
||
|
<a name="l285"></a> </span><span class=cF1>if</span><span class=cF0> (src[1])
|
||
|
<a name="l286"></a> *dst++=src[1];
|
||
|
<a name="l287"></a> last_duration=tmpn->duration;
|
||
|
<a name="l288"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l289"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->ona) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l290"></a> src=</span><span class=cF5>LstSub</span><span class=cF0>(note,psm_note_lst);
|
||
|
<a name="l291"></a> *dst++=src[0];
|
||
|
<a name="l292"></a> </span><span class=cF1>if</span><span class=cF0> (src[1])
|
||
|
<a name="l293"></a> *dst++=src[1];
|
||
|
<a name="l294"></a> </span><span class=cF1>else</span><span class=cF0> </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_FLAT</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l295"></a> *dst++=</span><span class=cF6>'b'</span><span class=cF0>;
|
||
|
<a name="l296"></a> </span><span class=cF1>else</span><span class=cF0> </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_SHARP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l297"></a> *dst++=</span><span class=cF6>'#'</span><span class=cF0>;
|
||
|
<a name="l298"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l299"></a> *dst++=</span><span class=cF6>'R'</span><span class=cF0>;
|
||
|
<a name="l300"></a> }
|
||
|
<a name="l301"></a> *dst++=0;
|
||
|
<a name="l302"></a> i+=</span><span class=cF5>StrLen</span><span class=cF0>(tmpn->ascii);
|
||
|
<a name="l303"></a> tmpn=tmpn->next;
|
||
|
<a name="l304"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l305"></a>
|
||
|
<a name="l306"></a> st=</span><span class=cF5>MAlloc</span><span class=cF0>(i+1);
|
||
|
<a name="l307"></a> dst=st;
|
||
|
<a name="l308"></a> tmpn=psm.head.next;
|
||
|
<a name="l309"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l310"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(dst,tmpn->ascii);
|
||
|
<a name="l311"></a> dst+=</span><span class=cF5>StrLen</span><span class=cF0>(tmpn->ascii);
|
||
|
<a name="l312"></a> tmpn=tmpn->next;
|
||
|
<a name="l313"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l314"></a> *dst++=0;
|
||
|
<a name="l315"></a> </span><span class=cF1>return</span><span class=cF0> st;
|
||
|
<a name="l316"></a>}
|
||
|
<a name="l317"></a>
|
||
|
<a name="l318"></a></span><span class=cF1>U8</span><span class=cF0> *PsmSaveSong(</span><span class=cF1>U8</span><span class=cF0> *dirname,</span><span class=cF1>U8</span><span class=cF0> *full_filename)
|
||
|
<a name="l319"></a>{
|
||
|
<a name="l320"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>(full_filename);
|
||
|
<a name="l321"></a> </span><span class=cF1>Bool</span><span class=cF0> has_words;
|
||
|
<a name="l322"></a> PsmNote *tmpn,*tmpn1;
|
||
|
<a name="l323"></a> </span><span class=cF1>F64</span><span class=cF0> measure_len=4,two_measure_left=2*measure_len;
|
||
|
<a name="l324"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
|
||
|
<a name="l325"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr;
|
||
|
<a name="l326"></a>
|
||
|
<a name="l327"></a> </span><span class=cF5>Free</span><span class=cF0>(PsmCvtSong); </span><span class=cF2>//set tmpn->ascii;</span><span class=cF0>
|
||
|
<a name="l328"></a>
|
||
|
<a name="l329"></a> </span><span class=cFB>music</span><span class=cF0>.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5;
|
||
|
<a name="l330"></a> </span><span class=cFB>music</span><span class=cF0>.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12;
|
||
|
<a name="l331"></a>
|
||
|
<a name="l332"></a> has_words=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l333"></a> tmpn=psm.head.next;
|
||
|
<a name="l334"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l335"></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>) has_words=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l336"></a> tmpn=tmpn->next;
|
||
|
<a name="l337"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l338"></a> </span><span class=cF1>if</span><span class=cF0> (psm.incomplete_entry->checked)
|
||
|
<a name="l339"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"//0 incomplete\n"</span><span class=cF0>);
|
||
|
<a name="l340"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (has_words)
|
||
|
<a name="l341"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"//0 has words\n"</span><span class=cF0>);
|
||
|
<a name="l342"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l343"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"//0 no nothing\n"</span><span class=cF0>);
|
||
|
<a name="l344"></a>
|
||
|
<a name="l345"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,
|
||
|
<a name="l346"></a> </span><span class=cF6>"U0 Song()\n"</span><span class=cF0>
|
||
|
<a name="l347"></a> </span><span class=cF6>"{\n"</span><span class=cF0>
|
||
|
<a name="l348"></a> </span><span class=cF6>" Fs->task_end_cb=&SndTaskEndCB;\n"</span><span class=cF0>
|
||
|
<a name="l349"></a> </span><span class=cF6>" MusicSettingsRst;\n"</span><span class=cF0>
|
||
|
<a name="l350"></a> </span><span class=cF6>" music.tempo=%6.3f;\n"</span><span class=cF0>
|
||
|
<a name="l351"></a> </span><span class=cF6>" music.stacatto_factor=%6.3f;\n"</span><span class=cF0>
|
||
|
<a name="l352"></a> </span><span class=cF6>" try {\n"</span><span class=cF0>
|
||
|
<a name="l353"></a> </span><span class=cF6>" while (!ScanKey) {\n"</span><span class=cF0>
|
||
|
<a name="l354"></a> </span><span class=cF6>"\tPlay(\""</span><span class=cF0>,</span><span class=cFB>music</span><span class=cF0>.tempo+0.0005,</span><span class=cFB>music</span><span class=cF0>.stacatto_factor+0.0005);
|
||
|
<a name="l355"></a>
|
||
|
<a name="l356"></a> tmpn=psm.head.next;
|
||
|
<a name="l357"></a> tmpn1=tmpn;
|
||
|
<a name="l358"></a> has_words=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l359"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn!=&psm.head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l360"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%s"</span><span class=cF0>,tmpn->ascii);
|
||
|
<a name="l361"></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>) has_words=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l362"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn->type==PSMT_METER) {
|
||
|
<a name="l363"></a> measure_len=tmpn->meter_top*4.0/tmpn->meter_bottom;
|
||
|
<a name="l364"></a> two_measure_left=0;
|
||
|
<a name="l365"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l366"></a> two_measure_left-=psm_durations[tmpn->duration];
|
||
|
<a name="l367"></a> tmpn=tmpn->next;
|
||
|
<a name="l368"></a> </span><span class=cF1>if</span><span class=cF0> (two_measure_left<0.001 && tmpn!=&psm.head) {
|
||
|
<a name="l369"></a> </span><span class=cF1>if</span><span class=cF0> (has_words) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l370"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\",\n\t\t\""</span><span class=cF0>);
|
||
|
<a name="l371"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn1!=tmpn) {
|
||
|
<a name="l372"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn1->type!=PSMT_METER) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (ptr=tmpn1->word) {
|
||
|
<a name="l374"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*ptr) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l375"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>CH_SPACE</span><span class=cF0>)
|
||
|
<a name="l376"></a> *ptr=</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>;
|
||
|
<a name="l377"></a> ptr++;
|
||
|
<a name="l378"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l379"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%Q\\0"</span><span class=cF0>,tmpn1->word);
|
||
|
<a name="l380"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l381"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%c\\0"</span><span class=cF0>,</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>);
|
||
|
<a name="l382"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l383"></a> tmpn1=tmpn1->next;
|
||
|
<a name="l384"></a> }
|
||
|
<a name="l385"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l386"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\");\n"</span><span class=cF0>
|
||
|
<a name="l387"></a> </span><span class=cF6>"\tPlay(\""</span><span class=cF0>);
|
||
|
<a name="l388"></a> two_measure_left=2*measure_len;
|
||
|
<a name="l389"></a> tmpn1=tmpn;
|
||
|
<a name="l390"></a> has_words=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l391"></a> }
|
||
|
<a name="l392"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l393"></a> </span><span class=cF1>if</span><span class=cF0> (has_words) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l394"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\",\n\t\t\""</span><span class=cF0>);
|
||
|
<a name="l395"></a> </span><span class=cF1>while</span><span class=cF0> (tmpn1!=tmpn) {
|
||
|
<a name="l396"></a> </span><span class=cF1>if</span><span class=cF0> (tmpn1->type!=PSMT_METER) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l397"></a> </span><span class=cF1>if</span><span class=cF0> (ptr=tmpn1->word) {
|
||
|
<a name="l398"></a> </span><span class=cF1>while</span><span class=cF0> (ch=*ptr) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l399"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF3>CH_SPACE</span><span class=cF0>)
|
||
|
<a name="l400"></a> *ptr=</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>;
|
||
|
<a name="l401"></a> ptr++;
|
||
|
<a name="l402"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l403"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%Q\\0"</span><span class=cF0>,tmpn1->word);
|
||
|
<a name="l404"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l405"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%c\\0"</span><span class=cF0>,</span><span class=cF3>CH_SHIFT_SPACE</span><span class=cF0>);
|
||
|
<a name="l406"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l407"></a> tmpn1=tmpn1->next;
|
||
|
<a name="l408"></a> }
|
||
|
<a name="l409"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l410"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\");\n"</span><span class=cF0>
|
||
|
<a name="l411"></a> </span><span class=cF6>" }\n"</span><span class=cF0>
|
||
|
<a name="l412"></a> </span><span class=cF6>" } catch\n"</span><span class=cF0>
|
||
|
<a name="l413"></a> </span><span class=cF6>" PutExcept;\n"</span><span class=cF0>
|
||
|
<a name="l414"></a> </span><span class=cF6>" Snd;\n"</span><span class=cF0>
|
||
|
<a name="l415"></a> </span><span class=cF6>"}\n"</span><span class=cF0>
|
||
|
<a name="l416"></a> </span><span class=cF6>"\n"</span><span class=cF0>
|
||
|
<a name="l417"></a> </span><span class=cF6>"Song;\n"</span><span class=cF0>);
|
||
|
<a name="l418"></a> </span><span class=cF5>DocRecalc</span><span class=cF0>(doc);
|
||
|
<a name="l419"></a> </span><span class=cF1>if</span><span class=cF0> (full_filename)
|
||
|
<a name="l420"></a> </span><span class=cF5>Free</span><span class=cF0>(full_filename);
|
||
|
<a name="l421"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l422"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(doc->filename.name,</span><span class=cF6>"%s/Tmp.HC.Z"</span><span class=cF0>,dirname);
|
||
|
<a name="l423"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(doc,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l424"></a> full_filename=</span><span class=cF5>StrNew</span><span class=cF0>(doc->filename.name);
|
||
|
<a name="l425"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
||
|
<a name="l426"></a> </span><span class=cF1>return</span><span class=cF0> full_filename;
|
||
|
<a name="l427"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|