#help_index "TOS" public U0 CursorRemFile(U8 *filename) { CDoc *doc; doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); DocWrite(doc); DocDel(doc); } public U0 CursorRem(U8 *files_find_mask="*") { I64 fuf_flags=0; ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O"); CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; while (tempde) { CursorRemFile(tempde->full_name); Touch(tempde->full_name,"",,tempde->datetime); tempde=tempde->next; } DirTreeDel(tempde1); } U0 UncollapseFile(U8 *filename,I64 *) { CDoc *doc=DocRead(filename,DOCF_NO_CURSOR); DocCollapse(FALSE,doc); DocWrite(doc); DocDel(doc); } public U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL) { I64 fuf_flags=0; ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O"); ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) { UncollapseFile(tempde->full_name,&fuf_flags); Touch(tempde->full_name,"",,tempde->datetime); tempde=tempde->next; } DirTreeDel(tempde1); } #define VIDEO_FRAME_RATE 8 #define FG_JUST_AUDIO 0 #define FG_BOOT_DRV 1 #define FG_RAM_DRV 2 I64 fg_mode=FG_RAM_DRV; Bool fg_on =FALSE; U0 FrameGrabberTask(I64) {//#!/bin/bash //for f in ./ScreenShots/*.Z; do ./Bin/TOSZ $$f; done //ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi I64 frame_num=0; U8 buf[STR_LEN],buf2[STR_LEN],*st_dir; F64 end_time=tS; Silent; //no output to screen if (fg_mode==FG_RAM_DRV) st_dir="B:/Temp/ScreenShots"; else st_dir="::/Temp/ScreenShots"; MkDir(st_dir); while (fg_on) { StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++); StrCpy(buf2,buf); BMPScreenCapture(buf); while (TRUE) { end_time+=1.0/VIDEO_FRAME_RATE; if (end_time3.0) { last_time=tS; if (fg_on) { fg_on=FALSE; Snd(0); wall->record=snd.record=FALSE; Sleep(1000); User("CopyVideo;Exit;\n"); } else { fg_on=TRUE; if (fg_mode!=FG_JUST_AUDIO) Spawn(&FrameGrabberTask,NULL,"Frame Grabber"); wall->record=snd.record=TRUE; Snd(0); } } } public U0 JukeSong(I64 num) { AutoComplete; if (!fg_on) FrameGrabberToggle; JukeSongsPuppet("::/Home/Downloads/Psalmody",,num,num+1); if (fg_on) FrameGrabberToggle; } public U0 JukeLines(I64 start_line,I64 end_line) { AutoComplete; if (!fg_on) FrameGrabberToggle; JukeSongsPuppet("::/Home/Downloads/Psalmody",,start_line*5,end_line*5); if (fg_on) FrameGrabberToggle; } public U0 ChkAll() { U8 *ptr=TOS_HDS; while (*ptr) ChkDsk(*ptr++); } public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL) { U8 byte_bit_cnts[256]; I64 i,j,*ptr,row,col,ch,best_ch,score,best_score, cur_char_image,diff_image,total_score=0; CDoc *doc=DocNew; MemSet(byte_bit_cnts,0,sizeof(byte_bit_cnts)); for (i=0;i<256;i++) for (j=0;j<7;j++) if (Bt(&i,j)) byte_bit_cnts[i]++; for (row=0;rowheight/FONT_HEIGHT;row++) { for (col=0;colwidth/FONT_WIDTH;col++) { cur_char_image=0; for (i=0;ifilename.name,out_name); DocWrite(doc); } DocDel(doc); } } Free(in_name); Free(out_name); } RegSetDftEntry("TempleOS/TOS", "I64 tos_code_walk_thru=1,tos_after_egypt_in_action=1;\n"); RegExeBranch("TempleOS/TOS"); U0 TOSRegInit() { DefinePrint("DD_CODE_WALK_THRU","Episode #%d",tos_code_walk_thru); DefinePrint("DD_AFTER_EGYPT_IN_ACTION","Episode #%d", tos_after_egypt_in_action); } TOSRegInit; U0 TOSRegWrite() { RegWriteBranch("TempleOS/TOS", "I64 tos_code_walk_thru=%d,tos_after_egypt_in_action=%d;\n", tos_code_walk_thru,tos_after_egypt_in_action); TOSRegInit; } class CYouTubeForm2 { U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n"; }; U8 *TOSYouTube() { U8 *result; CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2)); if (DocForm(url(CYouTubeForm2 *)) && *url->special) result=MStrPrint("$$HC,\"" "\"$$", url->special,url->special); else result=NULL; Free(url); return result; } U0 AfterEgyptInAction() { SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ Adam("GodInit(\"/Adam/God/Vocab.TXT*\");"); AutoComplete; WinBorder; WinMax; if (!fg_on) PopUp("Sleep(50);FrameGrabberToggle;"); Ed("::/Home/Videos/AfterEgypt.TXT.Z"); Msg(MSG_KEY_DOWN_UP,CH_SPACE,0x3900000039); // ExeFile("::/Apps/AfterEgypt/Run"); SettingsPop; tos_after_egypt_in_action++; TOSRegWrite; } U0 CodeWalkThru() { SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ AutoComplete; WinBorder; WinMax; if (!fg_on) PopUp("Sleep(50);FrameGrabberToggle;"); Ed("::/Home/Videos/RandomCode.TXT.Z"); SettingsPop; Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); // tos_code_walk_thru++; TOSRegWrite; } U0 TempleOSTheme() { if (!fg_on) PopUp("Sleep(50);FrameGrabberToggle;"); ExeFile("::/Home/Downloads/Graphics/TempleOSTheme.CPP"); DocClear; } U0 TOSJukeVideo(I64 start=0,I64 end=10) { U8 *buf=FileRead("::/Misc/Bible.TXT.Z"); //Put in cache Free(buf); AutoComplete; FrameGrabberToggle; JukeSongsPuppet("::/Home/Downloads/Psalmody",,start,end); FrameGrabberToggle; }