home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-25 | 44.0 KB | 1,202 lines |
- /******************(E)(D)evelopment(S)ystem***************
- ** FileName: mpegplayer_3.e
- ** Author: Mahdi/Sauron
- ** Company: GUILT
- ** Date: 10-26-95 Time: 18:24:20
- ** $VER: 2.3
- ***************************************©Sauron***********/
- /*********[Revision History]****[Last Update: 10-26-95]**/
- /*
- ** Version: 2.3
- ** Comment: N/A
- **
- ** THAT IS TEST VERSION OF v2.3 !!!!!
- **
- **
- ** This Amiga E source is only an example of E programing.
- ** You can use part of it in your own programe (Place me on your thx.
- ** list :) but you CAN'T create any other Intuition by changing names
- ** only !!!!
- **
- **
- **
- */
-
- OPT OSVERSION=37
-
- MODULE 'gadtools', 'libraries/gadtools', 'intuition/intuition','intuition/gadgetclass',
- 'intuition/screens','wb',
- 'graphics/text','ReqTools',
- 'exec/types','exec/ports','exec/memory','dos/dos','devices/inputevent',
- 'libraries/ReqTools','exec/lists', 'exec/nodes', 'utility/tagitem',
- 'workbench/startup','workbench/workbench','icon'
-
- /*-- Function return values. --*/
- ENUM NONE,NOCONTEXT, NOGADGET, NOWB, NOVISUAL, OPENGT, NOWINDOW,NO_MP,
- NO_ICONLIB,NO_GADTOOLS,NO_REQTOOLS,NO_ICON
-
- /*-- Gadget IDs. --*/
- ENUM DELETEBUTTON_ID, STRING_ID, LISTVIEW_ID,
- INFOBUTTON_ID, PLAYBUTTON_ID ,LOADBUTTON_ID, LOADBUTTON2_ID
-
- RAISE "MEM" IF New()=NIL,
- "MEM" IF String()=NIL
-
- CONST FILEREQ=0
-
- DEF id_xsize[3]: STRING,
- id_ysize[3]: STRING,
- id_time[13]: STRING,
- id_framess[9]: STRING,
- id_framesb[9]: STRING,
- id_compress[7]: STRING,
- id_kb[4]: STRING,
- id_frames[4]: STRING
-
- /*-- Standard SrcGen stuff. --*/
- DEF win=NIL:PTR TO window,dither[20]:STRING,
- scr=NIL:PTR TO screen,prr,x,y,levelid,
- glist=NIL,dir[100]:STRING,dirs[100]:STRING,buf[50]:STRING,
- visual=NIL,count,gattext[100]:STRING,
- gatsampl[100]:STRING,
- infos:PTR TO gadget,prio,phii,
- messageClass,rodzajDit,plik[100]:STRING,class,
- offx, offy, tattr:PTR TO textattr ,mainfile[200]:STRING,mppath[100]:STRING,
- smpath[100]:STRING,smform[100]:STRING,
- appath[100]:STRING,noap=FALSE,shit=FALSE,wsize,poOOOOmitazmienna,
- robot[200]:STRING,req:PTR TO rtfilerequester,f
-
- /*-- Listview and supporting gadgets. --*/
- DEF list=NIL:PTR TO mlh, /* Exec list holds listview items */
- listView=NIL:PTR TO gadget, /* Listview gadget */
- infoButton=NIL:PTR TO gadget,
- loadButton=NIL:PTR TO gadget,
- loadSButton=NIL:PTR TO gadget,
- playButton=NIL:PTR TO gadget,
- deleteButton=NIL:PTR TO gadget,
- textX=NIL:PTR TO gadget,
- textY=NIL:PTR TO gadget,
- textSize=NIL:PTR TO gadget,
- textKB=NIL:PTR TO gadget,
- textComp=NIL:PTR TO gadget,
- textFrames=NIL:PTR TO gadget,
- textTime=NIL:PTR TO gadget,
- textKlata=NIL:PTR TO gadget,
- scrolButton=NIL:PTR TO gadget,
- checkRAM=NIL:PTR TO gadget,
- checkLoop=NIL:PTR TO gadget,
- checkNOP=NIL:PTR TO gadget,
- checkNOB=NIL:PTR TO gadget,
- checkPLAY=NIL:PTR TO gadget,
- saveButton=NIL:PTR TO gadget, /* Button gadget TO delete an item */
- stringGadget=NIL:PTR TO gadget, /* String gadget, value added to listview */
- stringGadgetValue:PTR TO CHAR, /* Pointer to string gadget buffer */
- stringSampl:PTR TO gadget,
- stringSamplValue:PTR TO CHAR,
- check=FALSE,ch1=TRUE,ch2=TRUE,ch3=TRUE,ch4=TRUE,chs=TRUE,
- lue,player=1,font
-
- PROC initList(l:PTR TO mlh)
- /*-- Initialize an exec list. --*/
- l.head:=l+4
- l.tail:=NIL
- l.tailpred:=l
- ENDPROC
-
- CHAR '$VER: MPEGInt. v2.3 by MAHDI/SAURON (c) 1995',0
-
- PROC setupScreen()
- /*-- Open libraries and get screen info. --*/
- IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=NIL THEN RETURN OPENGT
- IF (scr:=LockPubScreen('Workbench'))=NIL THEN RETURN NOWB
- IF (visual:=GetVisualInfoA(scr,NIL))=NIL THEN RETURN NOVISUAL
- offy:=scr.wbortop+Int(scr.rastport+58)-10
- IF font=0
- tattr:=['topaz.font',8,0,0]:textattr
- ELSE
- tattr:=NIL
- ENDIF
- ENDPROC NONE
-
- PROC closeScreen()
- /*-- Free resources, close screen and libraries. --*/
- IF glist THEN FreeGadgets(glist)
- IF visual THEN FreeVisualInfo(visual)
- IF scr THEN UnlockPubScreen(NIL,scr)
- IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
- ENDPROC
-
- PROC createGadgets()
- /*-- Initialize gadget structures and create 'em. --*/
- DEF g, stringInfo:PTR TO stringinfo , stringInfo2:PTR TO stringinfo
- /*-- Init exec list to hold listview items. Starts out empty. --*/
- list:=New(SIZEOF mlh)
- initList(list)
- IF (g:=CreateContext({glist}))=NIL THEN RETURN NOCONTEXT
- IF (g:=listView:=CreateGadgetA(LISTVIEW_KIND,g,
- [offx+179,offy+26,130,104,'Dither type',tattr,LISTVIEW_ID,0,visual,0]:newgadget,
- [GTLV_LABELS,list,
- GTLV_SHOWSELECTED,NIL,
- TAG_DONE]))=NIL THEN RETURN NOGADGET
- IF (g:=textX:=CreateGadgetA(TEXT_KIND,g,
- [offx+17,offy+31,32,12,'X',tattr,1,2,visual,0]:newgadget,
- [GTTX_TEXT,'000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textY:=CreateGadgetA(TEXT_KIND,g,
- [offx+131,offy+31,32,12,'SIZE Y',tattr,2,1,visual,0]:newgadget,
- [GTTX_TEXT,'000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textTime:=CreateGadgetA(TEXT_KIND,g,
- [offx+59,offy+46,104,12,'Time',tattr,3,1,visual,0]:newgadget,
- [GTTX_TEXT,'00000.000000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textFrames:=CreateGadgetA(TEXT_KIND,g,
- [offx+83,offy+61,80,12,'Frame/s',tattr,4,1,visual,0]:newgadget,
- [GTTX_TEXT,'00.000000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textSize:=CreateGadgetA(TEXT_KIND,g,
- [offx+83,offy+77,80,12,'Frame/B',tattr,5,1,visual,0]:newgadget,
- [GTTX_TEXT,'000.00000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textComp:=CreateGadgetA(TEXT_KIND,g,
- [offx+98,offy+92,65,12,'Compress.',tattr,6,1,visual,0]:newgadget,
- [GTTX_TEXT,'00:00.0',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textKB:=CreateGadgetA(TEXT_KIND,g,
- [offx+42,offy+108,41,12,'KB',tattr,7,1,visual,0]:newgadget,
- [GTTX_TEXT,'000000000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=textKlata:=CreateGadgetA(TEXT_KIND,g,
- [offx+122,offy+108,41,12,'Fr.',tattr,7,1,visual,0]:newgadget,
- [GTTX_TEXT,'0000',
- GTTX_BORDER,1,
- NIL]))=NIL THEN RETURN NOGADGET
- IF ch1=0
- IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
- [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
- ELSE
- IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- ENDIF
- IF ch4=0
- IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
- [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
- ELSE
- IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- ENDIF
- IF ch2=0
- IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
- [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
- ELSE
- IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- ENDIF
- IF ch3=0
- IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
- [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
- ELSE
- IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- ENDIF
- IF (g:=loadButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+11,offy+179,24,12,'L',tattr,12,0,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=deleteButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+280,offy+179,26,12,'D',tattr,12,0,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=stringGadget:=CreateGadgetA(STRING_KIND,g,
- [offx+35,offy+179,245,12,'Files',tattr,13,4,visual,0]:newgadget,
- [GTST_STRING,gattext,
- GTST_MAXCHARS,256,
- NIL]))=NIL THEN RETURN NOGADGET
- stringInfo:=stringGadget.specialinfo
- stringGadgetValue:=stringInfo.buffer
-
- IF (g:=loadSButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+11,offy+194,24,12,'L',tattr,12,0,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=checkPLAY:=CreateGadgetA(CHECKBOX_KIND,g,
- [offx+280,offy+194,22,12,NIL,tattr,10,1,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
-
- IF (g:=stringSampl:=CreateGadgetA(STRING_KIND,g,
- [offx+35,offy+194,245,12,NIL,tattr,0,8,visual,0]:newgadget,
- [GTST_STRING,gatsampl,
- GTST_MAXCHARS,256,
- NIL]))=NIL THEN RETURN NOGADGET
- stringInfo2:=stringSampl.specialinfo
- stringSamplValue:=stringInfo2.buffer
-
- IF (g:=playButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+15,offy+131,66,29,'PLAY',tattr,14,16,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=infoButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+244,offy+131,58,14,'About',tattr,15,16,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=saveButton:=CreateGadgetA(BUTTON_KIND,g,
- [offx+244,offy+147,58,13,'SAVE',tattr,16,16,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
-
- IF (g:=scrolButton:=CreateGadgetA(SCROLLER_KIND,g,
- [offx+13,offy+210,238,10,NIL,tattr,0,1,visual,0]:newgadget,
- [GA_RELVERIFY,1,
- GA_IMMEDIATE,1,
- GTSC_TOTAL,52,
- GTSC_ARROWS,16,
- NIL]))=NIL THEN RETURN NOGADGET
-
- ENDPROC NONE
-
- PROC openWindow()
- IF createGadgets()<>NONE THEN RETURN NOGADGET
- /*-- Note WA_IDCMP to get messages from the listview gadget: --*/
- IF (win:=OpenWindowTagList(NIL,
- [WA_LEFT, x,
- WA_TOP, y,
- WA_WIDTH, offx+316,
- WA_HEIGHT, offy+229,
- WA_MINWIDTH, 316, WA_MINHEIGHT, 11,
- WA_IDCMP, (IDCMP_REFRESHWINDOW OR IDCMP_CLOSEWINDOW OR IDCMP_GADGETUP OR
- IDCMP_MOUSEMOVE OR LISTVIEWIDCMP OR SCROLLERIDCMP
- OR IDCMP_NEWSIZE),
- WA_FLAGS, (WFLG_DRAGBAR OR WFLG_DEPTHGADGET OR WFLG_CLOSEGADGET OR
- WFLG_SMART_REFRESH OR WFLG_ACTIVATE OR WFLG_HASZOOM),
- WA_TITLE,'MPEG Intuition V2.3',
- WA_SCREENTITLE,'MPEGIntuition v2.3 by Mahdi/Sauron',
- WA_CUSTOMSCREEN, scr,
- WA_AUTOADJUST, 1,
- WA_GADGETS, glist,
- TAG_DONE]))=NIL THEN RETURN NOWINDOW
- PrintIText(win.rport,
- [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
- DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
- [GT_VISUALINFO,visual,NIL])
- DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
- [GT_VISUALINFO,visual,NIL])
- DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
- [GT_VISUALINFO,visual,NIL])
- Gt_RefreshWindow(win, NIL)
- SetStdRast(win.rport)
- Colour(1,0)
- TextF(offx+251,offy+217,' 0.0 s')
- ENDPROC NONE
-
- PROC closeWindow()
- IF win THEN CloseWindow(win)
- ENDPROC
-
- PROC wait4message(win:PTR TO window)
- DEF mes:PTR TO intuimessage,type
- REPEAT
- type:=0
- IF mes:=Gt_GetIMsg(win.userport)
- type:=mes.class
- SELECT type
- CASE IDCMP_NEWSIZE
- /* IF wsize=1
- ->wsize:=0
-
- ELSEIF wsize=0
- wsize:=1
- ENDIF*/
- CASE IDCMP_GADGETUP
- /*-- Any old gadget will do. The address is used --*/
- /*-- to identify which one sent the message. --*/
- infos:=mes.iaddress
- infos.gadgetid:=mes.code
- SELECT infos
- CASE listView
- rodzajDit:=mes.code
- ENDSELECT
- IF mes.code THEN check:=TRUE ELSE check:=FALSE
- CASE IDCMP_REFRESHWINDOW
- name()
- IF wsize=1
- IF poOOOOmitazmienna=1
- /*
- ** wpis()
- */
- Gt_SetGadgetAttrsA (textTime, win, NIL,
- [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textX, win, NIL,
- [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textY, win, NIL,
- [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textSize, win, NIL,
- [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textFrames, win, NIL,
- [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textComp, win, NIL,
- [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textKB,win ,NIL,
- [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textKlata,win ,NIL,
- [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
-
- Gt_SetGadgetAttrsA (listView, win, NIL,
- [GTLV_LABELS, list,
- GTLV_TOP, 0,
- TAG_DONE])
- ELSE
- Gt_BeginRefresh(win)
- Gt_EndRefresh(win,TRUE)
- ENDIF
- PrintIText(win.rport,
- [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
- DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
- [GT_VISUALINFO,visual,NIL])
- DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
- [GT_VISUALINFO,visual,NIL])
- DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
- [GT_VISUALINFO,visual,NIL])
- scrol()
- wsize:=0
- ELSEIF wsize=0
- wsize:=1
- ENDIF
- type:=0
- ENDSELECT
- Gt_ReplyIMsg(mes)
- ELSE
- WaitPort(win.userport)
- ENDIF
- UNTIL type
- ENDPROC type
-
- PROC addToList()
- DEF newNode=NIL:PTR TO ln, node:PTR TO ln,
- len, itemPosition=0
- newNode:=New(SIZEOF ln)
- len:=StrLen(lue)
- newNode.name:=String(len)
- StrCopy(newNode.name, lue, ALL)
- /*-- Detach the exec LIST from the listview gadget. --*/
- Gt_SetGadgetAttrsA (listView, win, NIL, [GTLV_LABELS, -1, TAG_DONE])
- /*-- Decide where TO insert the new item. Sorted on first character. --*/
- node:=list.head
- Insert(list, newNode, node.pred)
- /* ENDIF*/
- /*-- Reattach the exec list to the listview gadget. --*/
- Gt_SetGadgetAttrsA (listView, win, NIL,
- [GTLV_LABELS, list,
- GTLV_TOP, itemPosition,
- TAG_DONE])
- ENDPROC
-
- PROC main() HANDLE
- DEF listItemPosition=0,mp_Task,pentla,brom,prob[2]:STRING
- IF reqtoolsbase:=OpenLibrary('reqtools.library',37)
- font:=1
- ikona()
- levelid:=0
- wsize:=0
- RightStr(prob,mppath,1)
- IF (FileLength(mppath)<=0) OR (StrCmp(prob,':'))
- Raise(NO_MP)
- WriteF('No MP:\d\n', FileLength(mppath))
- ENDIF
- pentla:=1
- poOOOOmitazmienna:=0
- IF setupScreen()=NONE
- IF openWindow()=NONE
- lue:='AMP-hiresham'
- addToList()
- lue:='AMP-ham6'
- addToList()
- lue:='AMP-color'
- addToList()
- lue:='Opal15'
- addToList()
- lue:='Opal24'
- addToList()
- lue:='Village24'
- addToList()
- lue:='EGS24'
- addToList()
- lue:='Retina24'
- addToList()
- lue:='Mono'
- addToList()
- lue:='FS4'
- addToList()
- lue:='FS2 Fast'
- addToList()
- lue:='FS2'
- addToList()
- lue:='Ordered2'
- addToList()
- lue:='Ordered'
- addToList()
- lue:='Hybrid2'
- addToList()
- lue:='Hybrid'
- addToList()
- lue:='Threshold'
- addToList()
- lue:='MBordered'
- addToList()
- lue:='2x2'
- addToList()
- lue:='Color'
- addToList()
- lue:='HAM6'
- addToList()
- lue:='HAM8'
- addToList()
- lue:='Gray'
- addToList()
- lue:='Gray8'
- addToList()
- rodzajDit:=prr
- -> inform()
- REPEAT
- messageClass:=wait4message(win)
- SELECT messageClass
- CASE IDCMP_GADGETUP
- SELECT infos /* pointer to gadget */
- CASE scrolButton
- levelid:=infos.gadgetid
- scrol()
- CASE infoButton
- inform()
- ->play()
- CASE saveButton
- IF req:=RtAllocRequestA(FILEREQ,0)
- phii:=RtLockWindow(win)
- RtEZRequestA('Prg. MP needs(?!?!?!??) path < 31 chars.',
- 'BI-LA KAIFA !!!!',0,0,0)
- RtChangeReqAttrA(req,[RTFI_DIR,dir])
- IF RtFileRequestA(req,NIL,'Pick a drawer TO save !!!'
- ,[RTFI_FLAGS,(FREQF_NOFILES OR FREQF_SAVE)])
- StrCopy(robot,req.dir)
- StrCopy(plik,robot)
- StringF(robot,'IFF24.%%%%')
- IF RtGetStringA(robot,100,'Enter a file pattern !!!',0,0)
- StrCopy(mainfile,req.dir,ALL)
- IF StrCmp(req.dir[StrLen(mainfile)-1],':')
- StrCopy(plik,mainfile)
- ELSEIF StrCmp(req.dir[StrLen(mainfile)-1],'/')
- StrCopy(plik,mainfile)
- ELSEIF StrLen(mainfile)<1
- StrCopy(plik,mainfile)
- ELSE
- StrCopy(plik,mainfile)
- StrAdd(plik,'/')
- ENDIF
- StrCopy(mainfile,plik,ALL)
- StringF(plik,'"\s\s"',mainfile,robot)
- IF StrLen(plik)>31
- RtEZRequestA('It must be under 31 chars !!!!.',
- 'Doup !!! Sorry I''ll try again !!',0,0,0)
- ELSE
- StringF(robot,'\s -saveiff \s "\s"',mppath,plik,gattext)
- Execute(robot,NIL,0)
- robot[]:=0
- ENDIF
- ENDIF
- ENDIF
- RtUnlockWindow(win,phii)
- RtFreeRequest(req)
- ENDIF
- CASE playButton
- IF (noap=1) AND (rodzajDit>20)
- shit:=1
- ENDIF
- IF shit=0
- IF mp_Task:=Open('ram:pracfile',NEWFILE)
- IF FileLength(stringGadgetValue)<>0
- /*
- ** Button OFF
- */
- Gt_SetGadgetAttrsA (loadButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (deleteButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (playButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (saveButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (infoButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (loadSButton, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
- Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
- [GA_DISABLED,1,TAG_DONE])
-
- IF rodzajDit=0 THEN StrCopy(dither,' -dither gray8 ',ALL)
- IF rodzajDit=1 THEN StrCopy(dither,' -dither gray ',ALL)
- IF rodzajDit=2 THEN StrCopy(dither,' -dither ham8 ',ALL)
- IF rodzajDit=3 THEN StrCopy(dither,' -dither ham6 ',ALL)
- IF rodzajDit=4 THEN StrCopy(dither,' -dither color ',ALL)
- IF rodzajDit=5 THEN StrCopy(dither,' -dither 2x2 ',ALL)
- IF rodzajDit=6 THEN StrCopy(dither,' -dither mbordered ',ALL)
- IF rodzajDit=7 THEN StrCopy(dither,' -dither threshold ',ALL)
- IF rodzajDit=8 THEN StrCopy(dither,' -dither hybrid ',ALL)
- IF rodzajDit=9 THEN StrCopy(dither,' -dither hybrid2 ',ALL)
- IF rodzajDit=10 THEN StrCopy(dither,' -dither ordered ',ALL)
- IF rodzajDit=11 THEN StrCopy(dither,' -dither ordered2 ',ALL)
- IF rodzajDit=12 THEN StrCopy(dither,' -dither fs2 ',ALL)
- IF rodzajDit=13 THEN StrCopy(dither,' -dither fs2fast ',ALL)
- IF rodzajDit=14 THEN StrCopy(dither,' -dither fs4 ',ALL)
- IF rodzajDit=15 THEN StrCopy(dither,' -dither mono ',ALL)
- IF rodzajDit=16 THEN StrCopy(dither,' -dither retina24 ',ALL)
- IF rodzajDit=17 THEN StrCopy(dither,' -dither egs24 ',ALL)
- IF rodzajDit=18 THEN StrCopy(dither,' -dither village24 ',ALL)
- IF rodzajDit=19 THEN StrCopy(dither,' -dither opal24 ',ALL)
- IF rodzajDit=20 THEN StrCopy(dither,' -dither opal15 ',ALL)
- IF rodzajDit=21 THEN StrCopy(dither,' -dither color ',ALL)
- IF rodzajDit=22 THEN StrCopy(dither,' -dither ham6 ',ALL)
- IF rodzajDit=23 THEN StrCopy(dither,' -dither hiresham ',ALL)
- StringF(mainfile,'')
- IF rodzajDit>20
- StrAdd(mainfile,appath,ALL)
- player:=2
- ELSE
- StrAdd(mainfile,mppath,ALL)
- player:=1
- ENDIF
- IF chs=0 THEN play()
- IF ch3=0 THEN StrAdd(mainfile,' -nob',ALL)
- IF ch4=0 THEN StrAdd(mainfile,' -nob',ALL)
- StrAdd(mainfile,dither,ALL)
- count:=0
- IF ch2=0
- pentla:=1
- IF RtGetLongA({pentla},'Write LOOP number:',0,0)
- ELSE
- pentla:=-1
- ENDIF
- ENDIF
- IF pentla>0
- IF pentla=0 THEN pentla:=1
- IF ch1=0
- cop(stringGadgetValue,'ram:mpeg.tmp')
- StrAdd(mainfile,'RAM:')
- StrAdd(mainfile,'mpeg.tmp')
- count:=1
- REPEAT
- Execute(mainfile,0,mp_Task)
- count:=count+1
- UNTIL count>=pentla
- pentla:=1
- DeleteFile('ram:mpeg.tmp')
- ELSE
- StringF(robot,'"\s"',stringGadgetValue)
- StrAdd(mainfile,robot,ALL)
- REPEAT
- Execute(mainfile,0,mp_Task)
- count:=count+1
- UNTIL count=pentla
- pentla:=1
- ENDIF
- ENDIF
- IF pentla=-1 THEN pentla:=1
- /*
- ** Button's OK
- */
- poOOOOmitazmienna:=1
- Gt_SetGadgetAttrsA (loadButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (deleteButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (playButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (saveButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (infoButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (loadSButton, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
- [GA_DISABLED,0,TAG_DONE])
- ENDIF
- ENDIF
- Close(mp_Task)
- IF (FileLength('RAM:pracfile')>10) AND (FileLength
- ('RAM:pracfile')<175)
- wpis()
- ELSE
- ENDIF
- ENDIF
- /* ENDIF*/
- shit:=0
- CASE loadSButton
- loadsmp()
- CASE loadButton
- IF req:=RtAllocRequestA(FILEREQ,0)
- phii:=RtLockWindow(win)
- RtChangeReqAttrA(req,[RTFI_DIR,dir,RTFI_MATCHPAT,
- '#?.(MPEG|MP|MPG)'])
- IF RtFileRequestA(req,buf,'Pick an mpeg anim !!!'
- ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
- RTFI_OKTEXT,('SURE')])
- StrCopy(plik,buf)
- StrCopy(dir,req.dir)
- IF StrCmp(req.dir[StrLen(dir)-1],':')
- StrCopy(gattext,dir)
- StrAdd(gattext,plik)
- ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
- StrCopy(gattext,dir)
- StrAdd(gattext,plik)
- ELSEIF StrLen(dir)<1
- StrCopy(gattext,dir)
- StrAdd(gattext,plik)
- ELSE
- StrCopy(gattext,dir)
- StrAdd(gattext,'/')
- StrAdd(gattext,plik)
- ENDIF
- Gt_SetGadgetAttrsA (stringGadget, win, NIL,
- [GTST_STRING,gattext,TAG_DONE])
- StrCopy(dir,req.dir)
- RtFreeRequest(req)
- ENDIF
- RtUnlockWindow(win,phii)
- ENDIF
- CASE listView
- listItemPosition:=infos.gadgetid /* note the use of this field! */
- CASE checkRAM
- ch1:=check+1
- CASE checkLoop
- ch2:=check+1
- CASE checkNOP
- ch3:=check+1
- CASE checkNOB
- ch4:=check+1
- CASE checkPLAY
- chs:=check+1
- CASE deleteButton
- phii:=RtLockWindow(win)
- brom:=RtEZRequestA('Shall I delete that file ?\n\s',
- 'Delete|Nope leave it',0,[stringGadgetValue],0)
- IF brom=1
- DeleteFile(stringGadgetValue)
- ELSE
- ENDIF
- RtUnlockWindow(win,phii)
- ENDSELECT
- CASE IDCMP_INTUITICKS
- NOP/* these are being sent FOR some shitty reason }:-( */
- ENDSELECT
- UNTIL messageClass=IDCMP_CLOSEWINDOW
- closeWindow()
- IF FileLength('ram:pracfile')>0
- DeleteFile('ram:pracfile')
- ENDIF
- ENDIF
- ENDIF
- CloseLibrary(reqtoolsbase)
- ELSE
- Raise(NO_REQTOOLS)
- ENDIF
- closeScreen()
- CleanUp(0)
- EXCEPT
- SELECT exception
- IF reqtoolsbase THEN CloseLibrary(reqtoolsbase)
- CASE NO_MP
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- ' I can''t find MP program \n check path in icon prefs',
- 'OK :(']:easystruct,
- NIL,NIL)
- CASE NO_ICONLIB
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- ' Sorry no icon.library\nin your''s LIBS: dir',
- 'OK I''ll copy it']:easystruct,
- NIL,NIL)
- CASE NO_ICON
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- 'Sorry, you need TO run\n this program from WB',
- 'OK (I understand)']:easystruct,
- NIL,NIL)
- CASE NO_REQTOOLS
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- ' Sorry no ReqTools.library\n in your''s LIBS: dir',
- 'OK I''ll copy it']:easystruct,
- NIL,NIL)
- DEFAULT
- WriteF('Well there is some error ( >:-< ) blââââdddd np.\n')
- WriteF('Excident nr: "\s"\n', [exception, 0])
- closeWindow()
- closeScreen()
- CleanUp(0)
- ENDSELECT
- ENDPROC
-
- PROC scrol()
- SetStdRast(win.rport)
- Colour(1,0)
- IF levelid < 10
- StringF(mainfile,' 0.\d s',levelid)
- ELSEIF levelid = 10
- StringF(mainfile,' 1.0 s')
- ELSEIF (levelid < 20) AND (levelid > 10)
- StringF(mainfile,' 1.\d s',levelid-10)
- ELSEIF levelid = 20
- StringF(mainfile,' 2.0 s')
- ELSEIF (levelid < 30) AND (levelid > 20)
- StringF(mainfile,' 2.\d s',levelid-20)
- ELSEIF levelid = 30
- StringF(mainfile,' 3.0 s')
- ELSEIF (levelid < 40) AND (levelid > 30)
- StringF(mainfile,' 3.\d s',levelid-30)
- ELSEIF levelid = 40
- StringF(mainfile,' 4.0 s')
- ELSEIF (levelid < 50) AND (levelid > 40)
- StringF(mainfile,' 4.\d s',levelid-40)
- ELSEIF levelid = 50
- StringF(mainfile,' 5.0 s')
- ENDIF
- TextF(offx+251,offy+217,mainfile)
-
- ENDPROC
-
- PROC loadsmp()
- DEF dir[100]:STRING
-
- IF req:=RtAllocRequestA(FILEREQ,0)
- phii:=RtLockWindow(win)
- RtChangeReqAttrA(req,[RTFI_DIR,dirs,RTFI_MATCHPAT,
- '#?.#?'])
- IF RtFileRequestA(req,buf,'Pick a sample file !!!'
- ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
- RTFI_OKTEXT,('SURE')])
- StrCopy(plik,buf)
- StrCopy(dirs,req.dir)
- IF StrCmp(req.dir[StrLen(dir)-1],':')
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,plik)
- ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,plik)
- ELSEIF StrLen(dirs)<1
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,plik)
- ELSE
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,'/')
- StrAdd(gatsampl,plik)
- ENDIF
- Gt_SetGadgetAttrsA (stringSampl, win, NIL,
- [GTST_STRING,gatsampl,TAG_DONE])
- StrCopy(dirs,req.dir)
- RtFreeRequest(req)
- ENDIF
- RtUnlockWindow(win,phii)
- ENDIF
- ENDPROC
-
- PROC name()
- SetWindowTitles(win,'MPEG Intuition V2.3', Not(0))
- ENDPROC
-
- PROC inform()
-
- DEF w=NIL:PTR TO window
- phii:=RtLockWindow(win)
- IF w:=OpenWindowTagList(NIL,[WA_FLAGS,$E,WA_IDCMP,$268,IDCMP_MOUSEBUTTONS,0,
- WA_TOP,win.topedge+40,WA_LEFT,win.leftedge+8,
- WA_WIDTH,300,WA_HEIGHT,140,WA_TITLE,'About MPEG intuition V2.3',0])
- SetStdRast(w.rport)
- SetTopaz(8)
- Colour(2,0)
- TextF(55,30,' MPEG Intuition v2.3')
- TextF(52,45,'by Mahdi/Sauron (c) 1995')
- Colour(1,0)
- TextF(55,65,'Bugs & Develope send TO:')
- TextF(45,75,'Adrian (SAURON) Siemieniak')
- TextF(45,85,'sauron@sco.zsi.pwr.wroc.pl')
- TextF(35,95,'sauron@sun1000.ci.pwr.wroc.pl')
- TextF(75,105,'tel.(071) 24-10-20')
- TextF(10,125,'-----------------------------------')
- ->WaitLeftMouse(w)
- REPEAT
- class:=WaitIMessage(w)
- UNTIL (class=IDCMP_CLOSEWINDOW) OR (class=8)
- CloseWindow(w)
- name()
- ENDIF
- RtUnlockWindow(win,phii)
- ENDPROC
-
- PROC wpis()
- DEF inputstring[80]:STRING,work[20]:STRING,work2[14]:STRING,mp_Task,x,y,a,b
- IF FileLength('ram:pracfile')>0
- IF mp_Task:=Open('ram:pracfile',OLDFILE)
- ReadStr(mp_Task,inputstring)
- StrCopy(work2,'')
- IF player=1
- ReadStr(mp_Task,inputstring)
- MidStr(work,inputstring,41,StrLen(inputstring)-46)
- FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
- x:= RealVal(work)
- StrAdd(work2,work)
- StrCopy(id_time,work2)
- Gt_SetGadgetAttrsA (textTime, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- ReadStr(mp_Task,inputstring)
- a:= InStr(inputstring,' x',10)
- MidStr(work,inputstring,11,a-11)
- StrCopy(id_xsize,work)
- Gt_SetGadgetAttrsA (textX, win, NIL,
- [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
- a:= InStr(inputstring,'x ',10)
- b:= InStr(inputstring,' Pi',10)
- b:= b-2-a
- IF b=2
- a:=a-1
- b:=3
- ENDIF
- MidStr(work,inputstring,a+2,b)
- StrCopy(id_ysize,work)
- Gt_SetGadgetAttrsA (textY, win, NIL,
- [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
-
- ReadStr(mp_Task,inputstring)
- StrCopy(work2,'')
- MidStr(work,inputstring,17,StrLen(inputstring)-6)
- FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
- y:= RealVal(work)
- StrAdd(work2,work)
- StrCopy(id_framess,work2)
- Gt_SetGadgetAttrsA (textFrames, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- ReadStr(mp_Task,inputstring)
- UpperStr(inputstring)
- StrCopy(work2,'')
- a:= InStr(inputstring,' BYTES',13)
- MidStr(work,inputstring,16,a-16)
- FOR a:=1 TO 9- StrLen(work) DO StrAdd(work2,' ')
- StrAdd(work2,work)
- StrCopy(id_framesb,work2)
- Gt_SetGadgetAttrsA (textSize, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
- a:= InStr(inputstring,'TE ',42)
- MidStr(work,inputstring,a+2,7)
- StrCopy(id_compress,work)
- Gt_SetGadgetAttrsA (textComp, win, NIL,
- [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
- ELSE
- ReadStr(mp_Task,inputstring)
- MidStr(work,inputstring,41,StrLen(inputstring)-46)
- FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
- x:= RealVal(work)
- StrAdd(work2,work)
- StrCopy(id_time,work2)
- Gt_SetGadgetAttrsA (textTime, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- ReadStr(mp_Task,inputstring)
- StrCopy(work2,'')
- MidStr(work,inputstring,17,StrLen(inputstring)-6)
- FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
- y:= RealVal(work)
- StrAdd(work2,work)
- StrCopy(id_framess,work2)
- Gt_SetGadgetAttrsA (textFrames, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- ReadStr(mp_Task,inputstring)
- a:= InStr(inputstring,'*',10)
- MidStr(work,inputstring,12,a-12)
- StrCopy(id_xsize,work)
- Gt_SetGadgetAttrsA (textX, win, NIL,
- [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
- a:= InStr(inputstring,'*',10)
- b:= InStr(inputstring,' pi',10)
- b:= b-2-a
- IF b=1
- b:=2
- MidStr(work2,inputstring,a+1,b)
- StringF(work,' \s',work2)
- ELSEIF
- MidStr(work,inputstring,a+1,b+2)
- ENDIF
- StrCopy(id_ysize,work)
- Gt_SetGadgetAttrsA (textY, win, NIL,
- [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
-
- StrCopy(work2,'')
- b:= !x*y
- a:= FileLength(gattext)/(!b!)
- StringF(work,'\d.2',a)
- FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
- StrAdd(work2,work)
- StrCopy(id_framesb,work2)
- Gt_SetGadgetAttrsA (textSize, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- ENDIF
-
- /* File length procedure*/
- StrCopy(work2,'')
- StringF(work,'\d',FileLength(gattext))
- a:= Val(work)
- b:=Div(a,1024)
- StringF(work,'\d',b)
- FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
- StrAdd(work2,work)
- StrCopy(id_kb,work2)
- Gt_SetGadgetAttrsA (textKB,win ,NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
-
- /* Frames counter procedure */
- b:=!x*y
- StringF(work,'\d',!b!)
- StrCopy(work2,'')
- FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
- StrAdd(work2,work)
- StrCopy(id_frames,work2)
- Gt_SetGadgetAttrsA (textKlata,win ,NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
- Close(mp_Task)
- ENDIF
- ELSE
- Gt_SetGadgetAttrsA (textTime, win, NIL,
- [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textX, win, NIL,
- [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textY, win, NIL,
- [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textSize, win, NIL,
- [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textFrames, win, NIL,
- [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textComp, win, NIL,
- [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textKB,win ,NIL,
- [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
- Gt_SetGadgetAttrsA (textKlata,win ,NIL,
- [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
- ENDIF
- ENDPROC
-
- PROC ikona()
- DEF wb:PTR TO wbstartup,wba:PTR TO wbarg,dobj:PTR TO diskobject,toolarray,
- str,olddir=0,pri=0,read=0
- IF (iconbase:=OpenLibrary('icon.library',37))
- ELSE
- Raise(NO_ICONLIB)
- ENDIF
- IF wbmessage
- wb:=wbmessage ; wba:=wb.arglist
- IF (wba.lock>0) AND (wba.name>0)
- olddir:=CurrentDir(wba.lock)
- ENDIF
- IF (dobj:=GetDiskObject(wba.name))>0
- toolarray:=dobj.tooltypes
- IF (str:=FindToolType(toolarray,'MP_PATH'))>0
- StrCopy(mppath,str,ALL)
- ENDIF
- IF (str:=FindToolType(toolarray,'AP_PATH'))>0
- StrCopy(appath,str,ALL)
- IF FileLength(appath)<=0
- noap:=1
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- ' I can''t find Amipeg program \n check path in icon prefs',
- 'OK :(']:easystruct,
- NIL,NIL)
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_PRIO'))>0
- pri:=Val(str,read)
- IF read=0
- prio:=pri
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'SM_PATH'))>0
- StrCopy(smpath,str,ALL)
- IF FileLength(smpath)>0
- ELSE
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
- ' I can''t find program TO Play Sample \n check path in icon prefs',
- 'OK :(']:easystruct,
- NIL,NIL)
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'SM_FORM'))>0
- StrCopy(smform,str,ALL)
- ENDIF
- IF (str:=FindToolType(toolarray,'SM_SAMPLEPATH'))>0
- StrCopy(dirs,str,ALL)
- ENDIF
- IF (str:=FindToolType(toolarray,'SM_SAMPLENAME'))>0
- IF StrCmp(req.dir[StrLen(dir)-1],':')
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,str)
- ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,str)
- ELSEIF StrLen(dirs)<1
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,str)
- ELSE
- StrCopy(gatsampl,dirs)
- StrAdd(gatsampl,'/')
- StrAdd(gatsampl,str)
- ENDIF
- ENDIF
-
- IF (str:=FindToolType(toolarray,'MP_ANIMPATH'))>0
- StrCopy(dir,str,ALL)
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_ANIMNAME'))>0
- IF StrCmp(req.dir[StrLen(dir)-1],':')
- StrCopy(gattext,dir)
- StrAdd(gattext,str)
- ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
- StrCopy(gattext,dir)
- StrAdd(gattext,str)
- ELSEIF StrLen(dir)<1
- StrCopy(gattext,dir)
- StrAdd(gattext,str)
- ELSE
- StrCopy(gattext,dir)
- StrAdd(gattext,'/')
- StrAdd(gattext,str)
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_DITHER'))>0
- IF StrCmp(UpperStr(str),'GRAY8')
- prr:=0
- ELSEIF StrCmp(UpperStr(str),'GRAY')
- prr:=1
- ELSEIF StrCmp(UpperStr(str),'HAM8')
- prr:=2
- ELSEIF StrCmp(UpperStr(str),'HAM6')
- prr:=3
- ELSEIF StrCmp(UpperStr(str),'COLOR')
- prr:=4
- ELSEIF StrCmp(UpperStr(str),'2X2')
- prr:=5
- ELSEIF StrCmp(UpperStr(str),'MBORDERED')
- prr:=6
- ELSEIF StrCmp(UpperStr(str),'TRESHOLD')
- prr:=7
- ELSEIF StrCmp(UpperStr(str),'HYBRID')
- prr:=8
- ELSEIF StrCmp(UpperStr(str),'HYBRID2')
- prr:=9
- ELSEIF StrCmp(UpperStr(str),'ORDERED')
- prr:=10
- ELSEIF StrCmp(UpperStr(str),'ORDERED2')
- prr:=11
- ELSEIF StrCmp(UpperStr(str),'FS2')
- prr:=12
- ELSEIF StrCmp(UpperStr(str),'FS2FAST')
- prr:=13
- ELSEIF StrCmp(UpperStr(str),'FS4')
- prr:=14
- ELSEIF StrCmp(UpperStr(str),'MONO')
- prr:=15
- ELSEIF StrCmp(UpperStr(str),'RETINA24')
- prr:=16
- ELSEIF StrCmp(UpperStr(str),'EGS24')
- prr:=17
- ELSEIF StrCmp(UpperStr(str),'VILLAGE24')
- prr:=18
- ELSEIF StrCmp(UpperStr(str),'OPAL24')
- prr:=19
- ELSEIF StrCmp(UpperStr(str),'OPAL15')
- prr:=20
- ELSEIF StrCmp(UpperStr(str),'AMP-COLOR')
- prr:=21
- ELSEIF StrCmp(UpperStr(str),'AMP-HAM6')
- prr:=22
- ELSEIF StrCmp(UpperStr(str),'AMP-HIRESHAM')
- prr:=23
- ELSE
- EasyRequestArgs(NIL,
- [SIZEOF easystruct, 0, 'Request Window Name',
- ' Unknow dither type\nspecified in icon tooltype',
- 'OK I''ll use DEFAULT (gray8)']:easystruct,
- NIL,NIL)
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'X_WIN'))>0
- pri:=Val(str,read)
- IF read=0
- x:=pri
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'Y_WIN'))>0
- pri:=Val(str,read)
- IF read=0
- y:=pri
- ENDIF
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_RAM'))>0
- IF StrCmp(UpperStr(str),'YES') THEN ch1:=0
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_NOP'))>0
- IF StrCmp(UpperStr(str),'YES') THEN ch4:=0
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_NOB'))>0
- IF StrCmp(UpperStr(str),'YES') THEN ch3:=0
- ENDIF
- IF (str:=FindToolType(toolarray,'MP_LOOP'))>0
- IF StrCmp(UpperStr(str),'YES') THEN ch2:=0
- ENDIF
- IF (str:=FindToolType(toolarray,'TOPAZ'))>0
- IF StrCmp(UpperStr(str),'YES') THEN font:=0
- ENDIF
- CloseLibrary(iconbase)
- ENDIF
- ELSE
- Raise(NO_ICON)
- ENDIF
- ENDPROC
-
- PROC cop(nam1,nam2)
- DEF buffer,leng,actleng,plik,plik2
- leng:=10240
- buffer:= AllocMem(leng,0)
- IF plik :=Open(nam1,OLDFILE)
- ELSE
- ENDIF
- IF plik2 :=Open(nam2,NEWFILE)
- ELSE
- ENDIF
- REPEAT
- actleng:=Read(plik,buffer,leng)
- Write(plik2,buffer,actleng)
- UNTIL actleng<10240
- Close(plik)
- Close(plik2)
- ENDPROC
-
- PROC play()
- DEF roboc[150]:STRING,riek[50]:STRING,po
- po:=InStr(smform,'{f}')
- StrCopy(riek,smform,po)
- StringF(roboc,'run delay -MS \d+\n\s \s"\s"',levelid*5,smpath,riek,stringSamplValue)
- MidStr(riek,smform,po+3,ALL)
- StrAdd(roboc,riek)
- Execute(roboc,0,NIL)
- ENDPROC
-
-