Nightly update (ISO SHA-1 ac7be1d)

This commit is contained in:
TempleOS-bot committed 2017-01-25 01:27:25 -05:00
1 parent cfe353a381
commit 2b13eca096
18 files changed
+1182 -1127

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ $WW,1$$FG,5$$TX+CX,"Psalmody Help"$$FG$
* $FG,2$Psalmody$FG$ uses $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ files as the song format! See $LK,"::/Apps/Psalmody/Examples/prosper.HC"$. The $FG,2$Psalmody$FG$ program does not fully parse the songs when loading them back in, so changes made outside $FG,2$Psalmody$FG$ will be lost, like if you add graphics.
* The first line of the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$<DELETE>$FG$ to delete songs.
* The first line of the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can request your reward from God by pressing $FG,2$r$FG$. You can press $FG,2$<DEL>$FG$ to delete songs.
* You can take the $LK,"Play",A="MN:Play"$() stmts out of a song file and place them in your programs. You can also add a song to a document with $FG,2$<CTRL-l>$FG$, but you should do it after pressing $FG,2$<CTRL-t>$FG$ because the clipboard-insert in $FG,2$<CTRL-l>$FG$ is screwy. See this $SO,"<Song>",A="4qG5EC4BeGG5qCeFD4sB5G4B5G4qG5EC4BeGG5qCeFD4sB5G4B5GqEeEFqE4BeG5FetC4A5GqFCEeEFqE4BeG5FetC4A5GqFC"$ after pressing $FG,2$<CTRL-t>$FG$, now.
+142 -80
View File
@@ -1,3 +1,30 @@
CTask *JukeReward(U8 *msg)
{
U8 *buf;
CDoc *doc;
CTask *res=Spawn(&SrvCmdLine,NULL,"Reward",,Fs);
StrCpy(res->task_title,"Reward");
res->title_src=TTS_LOCKED_CONST;
doc=DocNew(,res);
DocPrint(doc,"$$WW+H,1$$%s",msg);
buf=MStrPrint("DocEd(0x%X);",doc);
TaskExe(res,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
Free(buf);
TaskWait(res);
res->border_src =BDS_CONST;
res->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15;
res->text_attr =LTGRAY<<4+BLUE;
res->win_inhibit=WIG_NO_FOCUS_TASK_DFT;
WinHorz(Fs->win_right+2,TEXT_COLS-2,res);
WinVert(2,TEXT_ROWS-2,res);
WinFocus(Fs->parent_task);
return res;
}
CTask *SingleSong(U8 *msg,U8 *name)
{
CTask *task=Spawn(&SrvCmdLine,NULL,name,,Fs);
@@ -6,6 +33,7 @@ CTask *SingleSong(U8 *msg,U8 *name)
TaskExe(task,Fs,";",1<<JOBf_WAKE_MASTER|1<<JOBf_FREE_ON_COMPLETE);
WinHorz(task->win_left,task->win_left+50,task);
WinVert(2,2+8,task);
task->win_inhibit=WIG_NO_FOCUS_TASK_DFT;
TaskExe(task,NULL,msg,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
DocPut(task)->max_entries=100;
return task;
@@ -19,7 +47,9 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
{//ch=ASCII; sc=scan_code
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
CDirEntry *tmpde;
CDoc *s;
I64 i;
U8 *st;
CDoc *doc2;
if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT))
&& doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) {
tmpde=doc_ce->left_exp;
@@ -31,20 +61,45 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
} else if ('0'<=ch<='9') {
if (StrLen(doc_ce->tag)>1)
doc_ce->tag[0]=ch;
s=DocRead(tmpde->full_name);
doc_e=s->head.next;
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
doc_e=doc_e->next;
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
doc2=DocRead(tmpde->full_name);
DocLineNumGoTo(doc2,1);
doc_e=doc2->cur_entry;
if (doc_e!=doc2 && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
doc_e->tag[2]=ch;
DocWrite(s);
DocWrite(doc2);
}
DocDel(doc2);
return TRUE;
} else if (ch=='r') {
if (!DocTreeFFind(tmpde->full_name,"Reward1")) {
doc2=DocRead(tmpde->full_name);
DocLineNumGoTo(doc2,2);
DocPrint(doc2,
"\n$$TR,\"Reward1\"$$\n"
"$$ID,2$$CallExtStr(\"JukeReward\",\"\"\n"
"$$TR,\"Reward2\"$$\n"
"$$ID,2$$\n"
"$$ID,-2$$\n"
");\n$$ID,-2$$\n"
);
DocWrite(doc2);
DocDel(doc2);
}
if (DocTreeFFind(tmpde->full_name,"Reward1/Reward2")) {
for (i=0;i<5;i++) {
st=MStrPrint("%s %s %s %s ",
GodWordStr,GodWordStr,GodWordStr,GodWordStr);
DocTreeFAppend(tmpde->full_name,"Reward1/Reward2",
"\"%s\"\n",st);
Free(st);
}
In(" ");
}
DocDel(s);
return TRUE;
} else if (ch==CH_SPACE||ch==CH_ESC)
tmpde->user_data++; //JB_RUN_LEVEL++
//<SPACE> is followed by <ESC> --> JB_RUN_LEVEL_TWO
//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE
//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE
}
return FALSE;
}
@@ -59,80 +114,87 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
CTask *task=NULL;
if (_filename)
*_filename=NULL;
dirname=StrNew(dirname);
st=MStrPrint("%s/*.HC.Z",dirname);
tmpde=tmpde1=FilesFind(st);
Free(st);
Free(dirname);
doc->user_put_key=&JBPutKey;
DocPrint(doc,
"Key: $$GREEN$$Graphics $$BLUE$$Words $$RED$$No Nothing "
"$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n"
"$$GREEN$$<DELETE>$$FG$$ to delete a song.\n"
"Press a number to rate a song.\n");
while (tmpde) {
if (!(i++%5))
DocPrint(doc,"\n");
if (FileOcc("Play(",tmpde->full_name,"")) {
st=StrNew(tmpde->name);
FileExtRem(st);
s=DocRead(tmpde->full_name);
doc_e=s->head.next;
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
doc_e=doc_e->next;
rating='0';
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT) {
if ('0'<=doc_e->tag[2]<='9')
rating=doc_e->tag[2];
if (StrMatch("incomplete",doc_e->tag))
DocPrint(doc,"$$BLACK$$");
else if (StrMatch("has graphics",doc_e->tag))
DocPrint(doc,"$$GREEN$$");
else if (StrMatch("has words",doc_e->tag))
DocPrint(doc,"$$BLUE$$");
else if (StrMatch("special",doc_e->tag))
DocPrint(doc,"$$CYAN$$");
else if (StrMatch("no nothing",doc_e->tag)) {
DocPrint(doc,"$$RED$$");
if (FileOcc("\\0",tmpde->full_name,"")) {
s->cur_entry=doc_e->next;
s->cur_col=0;
DocEntryDel(s,doc_e);
DocPrint(s,"//0 has words\n");
DocWrite(s);
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
AutoComplete;
try {
dirname=StrNew(dirname);
st=MStrPrint("%s/*.HC.Z",dirname);
tmpde=tmpde1=FilesFind(st);
Free(st);
Free(dirname);
doc->user_put_key=&JBPutKey;
DocPrint(doc,
"Key: $$GREEN$$Graphics $$BLUE$$Words $$RED$$No Nothing "
"$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n"
"$$GREEN$$<DEL>$$FG$$\tto delete a song.\n"
"'$$GREEN$$0$$FG$$'-'$$GREEN$$9$$FG$$'\tto rate a song.\n"
"'$$GREEN$$r$$FG$$'\tto get your reward from God.\n");
while (tmpde) {
if (!(i++%5))
DocPrint(doc,"\n");
if (FileOcc("Play(",tmpde->full_name,"")) {
st=StrNew(tmpde->name);
FileExtRem(st);
s=DocRead(tmpde->full_name);
doc_e=s->head.next;
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
doc_e=doc_e->next;
rating='0';
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT) {
if ('0'<=doc_e->tag[2]<='9')
rating=doc_e->tag[2];
if (StrMatch("incomplete",doc_e->tag))
DocPrint(doc,"$$BLACK$$");
else if (StrMatch("has graphics",doc_e->tag))
DocPrint(doc,"$$GREEN$$");
else if (StrMatch("has words",doc_e->tag))
DocPrint(doc,"$$BLUE$$");
else if (StrMatch("special",doc_e->tag))
DocPrint(doc,"$$CYAN$$");
else if (StrMatch("no nothing",doc_e->tag)) {
DocPrint(doc,"$$RED$$");
if (FileOcc("\\0",tmpde->full_name,"")) {
s->cur_entry=doc_e->next;
s->cur_col=0;
DocEntryDel(s,doc_e);
DocPrint(s,"//0 has words\n");
DocWrite(s);
}
}
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tmpde);
tmpde->user_data=JB_RUN_LEVEL_NULL;
}
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tmpde);
tmpde->user_data=JB_RUN_LEVEL_NULL;
DocDel(s);
Free(st);
}
DocDel(s);
tmpde=tmpde->next;
}
DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL);
while (TRUE) {
if (_filename)
tmpde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
else
tmpde=PopUpMenu(doc);
if (task)
Kill(task);
if (tmpde<=0) break;
st2=StrNew(tmpde->name);
if (_filename) {
Free(*_filename);
*_filename=StrNew(tmpde->full_name);
}
if (tmpde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
tmpde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
FileExtRem(st2);
st=MStrPrint("ExeFile(\"%s\");",tmpde->full_name);
MusicSettingsRst;
task=SingleSong(st,st2);
Free(st2);
Free(st);
}
tmpde=tmpde->next;
}
DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL);
while (TRUE) {
if (_filename)
tmpde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
else
tmpde=PopUpMenu(doc);
if (task)
Kill(task);
if (tmpde<=0) break;
st2=StrNew(tmpde->name);
if (_filename) {
Free(*_filename);
*_filename=StrNew(tmpde->full_name);
}
if (tmpde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
tmpde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
FileExtRem(st2);
st=MStrPrint("ExeFile(\"%s\");",tmpde->full_name);
MusicSettingsRst;
task=SingleSong(st,st2);
Free(st2);
Free(st);
}
DocDel(doc);
DirTreeDel(tmpde1);
DocDel(doc);
DirTreeDel(tmpde1);
} catch
PutExcept;
SettingsPop;
}