home *** CD-ROM | disk | FTP | other *** search
- /******************(E)(D)evelopment(S)ystem***************
- ** FileName: mpegplayer_2.e
- ** Author: Sauron
- ** Company: GUILT
- ** Date: 06-11-95 Time: 19:24:20
- ** $VER: 2.12b
- ***************************************©Sauron***********/
- /*********[Revision History]****[Last Update: 06-11-95]**/
- /*
- ** Version: 2.12b
- ** Comment: N/A
- **
- **
- **
- **
- ** 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', 'graphics/text', 'ReqTools','commodities','libraries/commodities',
- 'exec/types','exec/ports','exec/memory','dos/dos','devices/inputevent',
- 'libraries/ReqTools','exec/lists', 'exec/nodes', 'utility/tagitem',
- 'workbench/startup','workbench/workbench','icon','keymap'
-
- /*-- 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
-
- RAISE "MEM" IF New()=NIL,
- "MEM" IF String()=NIL
-
- CONST FILEREQ=0
-
- /*-- Standard SrcGen stuff. --*/
- DEF win=NIL:PTR TO window,dither[20]:STRING,
- scr=NIL:PTR TO screen,prr,x,y,
- glist=NIL,dir[100]:STRING,buf[50]:STRING,
- visual=NIL,count,gattext[100]:STRING,
- infos:PTR TO gadget,chippointer,prio,
- messageClass,rodzajDit,plik[100]:STRING,class,
- offx, offy, tattr,mainfile[200]:STRING,mppath[100]:STRING,
- appath[100]:STRING,noap=FALSE,shit=FALSE,
- robot[100]:STRING,req:PTR TO rtfilerequester,myreq:requester
-
- /*-- 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,
- playButton=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,
- checkRAM=NIL:PTR TO gadget,
- checkLoop=NIL:PTR TO gadget,
- checkNOP=NIL:PTR TO gadget,
- checkNOB=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 */
- check=FALSE,ch1=TRUE,ch2=TRUE,ch3=TRUE,ch4=TRUE,lue,player=1
-
- 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.12b by 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
- tattr:=['topaz.font',8,0,0]:textattr
- 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
- /*-- 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+17,offy+178,20,14,'L',tattr,12,0,visual,0]:newgadget,
- [NIL]))=NIL THEN RETURN NOGADGET
- IF (g:=stringGadget:=CreateGadgetA(STRING_KIND,g,
- [offx+38,offy+179,263,12,'File ',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:=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
- 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+200,
- WA_MINWIDTH, 240, 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,'Sauron MPEG Intuition V2.12b',
- WA_CUSTOMSCREEN, scr,
- WA_MINWIDTH, 67,
- WA_MINHEIGHT, 21,
- WA_MAXWIDTH, $2C0,
- WA_MAXHEIGHT, 277,
- 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,31,
- [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)
- 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
- 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 stringGadget
- StrCopy(gattext,stringGadgetValue)
- RightStr(buf,gattext,porow())
- Gt_SetGadgetAttrsA (stringGadget, win, NIL,
- [GTST_STRING,gattext,TAG_DONE])*/
- CASE listView
- rodzajDit:=mes.code
- ENDSELECT
- IF mes.code THEN check:=TRUE ELSE check:=FALSE
- CASE IDCMP_REFRESHWINDOW
- Gt_BeginRefresh(win)
- Gt_EndRefresh(win,TRUE)
- name()
- 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,waitpointer,mp_Task,pentla
- waitpointer:=[$0000, $0000,
- $0400, $07C0,
- $0000, $07C0,
- $0100, $0380,
- $0000, $07E0,
- $07C0, $1FF8,
- $1FF0, $3FEC,
- $3FF8, $7FDE,
- $3FF8, $7FBE,
- $7FFC, $FF7F,
- $7EFC, $FFFF,
- $7FFC, $FFFF,
- $3FF8, $7FFE,
- $3FF8, $7FFE,
- $1FF0, $3FFC,
- $07C0, $1FF8,
- $0000, $07E0,
- $0000, $0000]:INT
-
- IF chippointer:=AllocVec(72,MEMF_CHIP)
- CopyMemQuick(waitpointer,chippointer,72)
- ENDIF
- IF reqtoolsbase:=OpenLibrary('reqtools.library',37)
- ikona()
- IF FileLength(mppath)<=0
- Raise(NO_MP)
- ENDIF
- 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 infoButton
- inform()
- CASE saveButton
- IF req:=RtAllocRequestA(FILEREQ,0)
- IF beginWait(win, myreq)
- 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)
- StrAdd(plik,'/')
- StrAdd(plik,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
- endWait(win, myreq)
- RtFreeRequest(req)
- ENDIF
- 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
- /*
- ****** Buttons OFF
- */
- Gt_SetGadgetAttrsA (loadButton, 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])
-
- 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 ch3=0 THEN StrAdd(mainfile,' -nob',ALL)
- IF ch4=0 THEN StrAdd(mainfile,' -nob',ALL)
- StrAdd(mainfile,dither,ALL)
- /* IF beginWait(win, myreq)
- */
- count:=0
- IF ch2=0 THEN RtGetLongA({pentla},'Write LOOP number:',0,0)
- IF pentla=0 THEN pentla:=1
- IF ch1=0
- StringF(robot,'C:Copy \s TO Ram:\s',stringGadgetValue,buf)
- Execute(robot,NIL,0)
- StrAdd(mainfile,'RAM:')
- StrAdd(mainfile,buf)
- REPEAT
- Execute(mainfile,0,mp_Task)
- count:=count+1
- UNTIL count=pentla
- pentla:=1
- StringF(mainfile,'C:Delete >NIL: RAM:\s',buf)
- Execute(mainfile,0,mp_Task)
- ELSE
- StrAdd(mainfile,stringGadgetValue,ALL)
- REPEAT
- Execute(mainfile,0,mp_Task)
- count:=count+1
- UNTIL count=pentla
- pentla:=1
- ENDIF
- /* endWait(win, myreq)*/
- /* Button's OK
- */
- Gt_SetGadgetAttrsA (loadButton, 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])
-
- ENDIF
- ENDIF
- Close(mp_Task)
- IF (FileLength('RAM:pracfile')>10) AND (FileLength
- ('RAM:pracfile')<175)
- wpis()
- ELSE
- ENDIF
- ENDIF
- /* ENDIF*/
- shit:=0
- CASE loadButton
- IF req:=RtAllocRequestA(FILEREQ,0)
- IF beginWait(win, myreq)
- /*buf[]:=0 */
- 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
- endWait(win, myreq)
- ENDIF
- 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
- ENDSELECT
- CASE IDCMP_INTUITICKS
- NOP/* these are being sent FOR some shitty reason }:-( */
- ENDSELECT
- UNTIL messageClass=IDCMP_CLOSEWINDOW
- closeWindow()
- 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 beginWait(win, waitRequest)
- InitRequester(waitRequest)
- IF Request(waitRequest, win)
- SetPointer(win,chippointer, 16, 16, -6, 0)
- RETURN TRUE
- ELSE
- RETURN FALSE
- ENDIF
- ENDPROC
-
- PROC endWait(win, waitRequest)
- ClearPointer(win)
- EndRequest(waitRequest, win)
- ENDPROC
-
- PROC name()
- SetWindowTitles(win,'Sauron MPEG Intuition V2.12b', Not(0))
- ENDPROC
-
- PROC inform()
-
- DEF w=NIL:PTR TO window
- IF beginWait(win, myreq)
- IF w:=OpenWindowTagList(NIL,[WA_FLAGS,$E,WA_IDCMP,$268,
- WA_TOP,win.topedge+40,WA_LEFT,win.leftedge+8,
- WA_WIDTH,300,WA_HEIGHT,140,WA_TITLE,'About MPEG intuition V2.12b',0])
- SetStdRast(w.rport)
- Colour(2,0)
- TextF(70,30,'Sauron MPEG Intuition')
- TextF(50,45,'by Sauron (c) 1995 v2.12b')
- 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(15,125,'---------------------------------')
- WHILE (class:=WaitIMessage(w))<>IDCMP_CLOSEWINDOW
- ENDWHILE
- CloseWindow(w)
- name()
- ENDIF
- endWait(win, myreq)
- ENDIF
- ENDPROC
-
- PROC wpis()
- DEF inputstring[80]:STRING,work[20]:STRING,work2[14]:STRING,mp_Task,x,y,a,b
- 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)
- 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)
- 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)
- 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)
- 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)
- Gt_SetGadgetAttrsA (textSize, win, NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
- a:= InStr(inputstring,'TE ',42)
- MidStr(work,inputstring,a+2,7)
- 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)
- 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)
- 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)
- 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
- 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)
- 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)
- 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)
- Gt_SetGadgetAttrsA (textKlata,win ,NIL,
- [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
- Close(mp_Task)
- 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,'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
- CloseLibrary(iconbase)
- ENDIF
- ELSE
- Raise(NO_ICON)
- ENDIF
- ENDPROC
-