home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / viewer / MPEGIN23.LHA / MPEGIntuition.e < prev    next >
Encoding:
Text File  |  1995-11-25  |  44.0 KB  |  1,202 lines

  1. /******************(E)(D)evelopment(S)ystem***************
  2. ** FileName:   mpegplayer_3.e
  3. ** Author:     Mahdi/Sauron
  4. ** Company:    GUILT
  5. ** Date:       10-26-95     Time:   18:24:20
  6. ** $VER:       2.3
  7. ***************************************©Sauron***********/
  8. /*********[Revision History]****[Last Update: 10-26-95]**/
  9. /*
  10. ** Version:   2.3
  11. ** Comment:   N/A
  12. **
  13. **     THAT IS TEST VERSION OF v2.3 !!!!!
  14. **
  15. **
  16. **   This Amiga E source is only an example of E programing.
  17. **   You can use part of it in your own programe (Place me on your thx.
  18. **   list :) but you CAN'T create any other Intuition by changing names
  19. **   only !!!!
  20. **
  21. **
  22. **
  23. */
  24.  
  25. OPT OSVERSION=37
  26.  
  27. MODULE 'gadtools', 'libraries/gadtools', 'intuition/intuition','intuition/gadgetclass',
  28.        'intuition/screens','wb',
  29.        'graphics/text','ReqTools',
  30.        'exec/types','exec/ports','exec/memory','dos/dos','devices/inputevent',
  31.        'libraries/ReqTools','exec/lists', 'exec/nodes', 'utility/tagitem',
  32.        'workbench/startup','workbench/workbench','icon'
  33.  
  34. /*-- Function return values. --*/
  35. ENUM NONE,NOCONTEXT, NOGADGET, NOWB, NOVISUAL, OPENGT, NOWINDOW,NO_MP,
  36.      NO_ICONLIB,NO_GADTOOLS,NO_REQTOOLS,NO_ICON
  37.  
  38. /*-- Gadget IDs. --*/
  39. ENUM DELETEBUTTON_ID, STRING_ID, LISTVIEW_ID,
  40.      INFOBUTTON_ID, PLAYBUTTON_ID ,LOADBUTTON_ID, LOADBUTTON2_ID
  41.  
  42. RAISE "MEM" IF New()=NIL,
  43.       "MEM" IF String()=NIL
  44.  
  45. CONST FILEREQ=0
  46.  
  47. DEF id_xsize[3]:     STRING,
  48.     id_ysize[3]:     STRING,
  49.     id_time[13]:     STRING,
  50.     id_framess[9]:   STRING,
  51.     id_framesb[9]:   STRING,
  52.     id_compress[7]:  STRING,
  53.     id_kb[4]:        STRING,
  54.     id_frames[4]:    STRING
  55.  
  56. /*-- Standard SrcGen stuff. --*/
  57. DEF win=NIL:PTR TO window,dither[20]:STRING,
  58.     scr=NIL:PTR TO screen,prr,x,y,levelid,
  59.     glist=NIL,dir[100]:STRING,dirs[100]:STRING,buf[50]:STRING,
  60.     visual=NIL,count,gattext[100]:STRING,
  61.     gatsampl[100]:STRING,
  62.     infos:PTR TO gadget,prio,phii,
  63.     messageClass,rodzajDit,plik[100]:STRING,class,
  64.     offx, offy, tattr:PTR TO textattr ,mainfile[200]:STRING,mppath[100]:STRING,
  65.     smpath[100]:STRING,smform[100]:STRING,
  66.     appath[100]:STRING,noap=FALSE,shit=FALSE,wsize,poOOOOmitazmienna,
  67.     robot[200]:STRING,req:PTR TO rtfilerequester,f
  68.  
  69. /*-- Listview and supporting gadgets. --*/
  70. DEF list=NIL:PTR TO mlh,            /* Exec list holds listview items         */
  71.     listView=NIL:PTR TO gadget,     /* Listview gadget                        */
  72.     infoButton=NIL:PTR TO gadget,
  73.     loadButton=NIL:PTR TO gadget,
  74.     loadSButton=NIL:PTR TO gadget,
  75.     playButton=NIL:PTR TO gadget,
  76.     deleteButton=NIL:PTR TO gadget,
  77.     textX=NIL:PTR TO gadget,
  78.     textY=NIL:PTR TO gadget,
  79.     textSize=NIL:PTR TO gadget,
  80.     textKB=NIL:PTR TO gadget,
  81.     textComp=NIL:PTR TO gadget,
  82.     textFrames=NIL:PTR TO gadget,
  83.     textTime=NIL:PTR TO gadget,
  84.     textKlata=NIL:PTR TO gadget,
  85.     scrolButton=NIL:PTR TO gadget,
  86.     checkRAM=NIL:PTR TO gadget,
  87.     checkLoop=NIL:PTR TO gadget,
  88.     checkNOP=NIL:PTR TO gadget,
  89.     checkNOB=NIL:PTR TO gadget,
  90.     checkPLAY=NIL:PTR TO gadget,
  91.     saveButton=NIL:PTR TO gadget, /* Button gadget TO delete an item        */
  92.     stringGadget=NIL:PTR TO gadget, /* String gadget, value added to listview */
  93.     stringGadgetValue:PTR TO CHAR,   /* Pointer to string gadget buffer        */   
  94.     stringSampl:PTR TO gadget,
  95.     stringSamplValue:PTR TO CHAR,
  96.     check=FALSE,ch1=TRUE,ch2=TRUE,ch3=TRUE,ch4=TRUE,chs=TRUE,
  97.     lue,player=1,font
  98.  
  99. PROC initList(l:PTR TO mlh)
  100. /*-- Initialize an exec list. --*/
  101.   l.head:=l+4
  102.   l.tail:=NIL
  103.   l.tailpred:=l
  104. ENDPROC
  105.  
  106. CHAR '$VER: MPEGInt. v2.3 by MAHDI/SAURON (c) 1995',0
  107.  
  108. PROC setupScreen()
  109. /*-- Open libraries and get screen info. --*/
  110.   IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=NIL THEN RETURN OPENGT
  111.   IF (scr:=LockPubScreen('Workbench'))=NIL THEN RETURN NOWB
  112.   IF (visual:=GetVisualInfoA(scr,NIL))=NIL THEN RETURN NOVISUAL
  113.   offy:=scr.wbortop+Int(scr.rastport+58)-10
  114.   IF font=0
  115.     tattr:=['topaz.font',8,0,0]:textattr
  116.   ELSE
  117.     tattr:=NIL
  118.   ENDIF
  119. ENDPROC  NONE
  120.  
  121. PROC closeScreen()
  122. /*-- Free resources, close screen and libraries. --*/
  123.   IF glist THEN FreeGadgets(glist)
  124.   IF visual THEN FreeVisualInfo(visual)
  125.   IF scr THEN UnlockPubScreen(NIL,scr)
  126.   IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
  127. ENDPROC
  128.  
  129. PROC createGadgets()
  130. /*-- Initialize gadget structures and create 'em. --*/
  131.   DEF g, stringInfo:PTR TO stringinfo , stringInfo2:PTR TO stringinfo
  132.   /*-- Init exec list to hold listview items.  Starts out empty. --*/
  133.   list:=New(SIZEOF mlh)
  134.   initList(list)
  135.   IF (g:=CreateContext({glist}))=NIL THEN RETURN NOCONTEXT
  136.   IF (g:=listView:=CreateGadgetA(LISTVIEW_KIND,g,
  137.     [offx+179,offy+26,130,104,'Dither type',tattr,LISTVIEW_ID,0,visual,0]:newgadget,
  138.     [GTLV_LABELS,list,
  139.      GTLV_SHOWSELECTED,NIL,
  140.      TAG_DONE]))=NIL THEN RETURN NOGADGET
  141.   IF (g:=textX:=CreateGadgetA(TEXT_KIND,g,
  142.     [offx+17,offy+31,32,12,'X',tattr,1,2,visual,0]:newgadget,
  143.     [GTTX_TEXT,'000',
  144.      GTTX_BORDER,1,
  145.      NIL]))=NIL THEN RETURN NOGADGET
  146.   IF (g:=textY:=CreateGadgetA(TEXT_KIND,g,
  147.     [offx+131,offy+31,32,12,'SIZE Y',tattr,2,1,visual,0]:newgadget,
  148.     [GTTX_TEXT,'000',
  149.      GTTX_BORDER,1,
  150.      NIL]))=NIL THEN RETURN NOGADGET
  151.   IF (g:=textTime:=CreateGadgetA(TEXT_KIND,g,
  152.     [offx+59,offy+46,104,12,'Time',tattr,3,1,visual,0]:newgadget,
  153.     [GTTX_TEXT,'00000.000000',
  154.      GTTX_BORDER,1,
  155.      NIL]))=NIL THEN RETURN NOGADGET
  156.   IF (g:=textFrames:=CreateGadgetA(TEXT_KIND,g,
  157.     [offx+83,offy+61,80,12,'Frame/s',tattr,4,1,visual,0]:newgadget,
  158.     [GTTX_TEXT,'00.000000',
  159.      GTTX_BORDER,1,
  160.      NIL]))=NIL THEN RETURN NOGADGET
  161.   IF (g:=textSize:=CreateGadgetA(TEXT_KIND,g,
  162.     [offx+83,offy+77,80,12,'Frame/B',tattr,5,1,visual,0]:newgadget,
  163.     [GTTX_TEXT,'000.00000',
  164.      GTTX_BORDER,1,
  165.      NIL]))=NIL THEN RETURN NOGADGET
  166.   IF (g:=textComp:=CreateGadgetA(TEXT_KIND,g,
  167.     [offx+98,offy+92,65,12,'Compress.',tattr,6,1,visual,0]:newgadget,
  168.     [GTTX_TEXT,'00:00.0',
  169.      GTTX_BORDER,1,
  170.      NIL]))=NIL THEN RETURN NOGADGET
  171.   IF (g:=textKB:=CreateGadgetA(TEXT_KIND,g,
  172.     [offx+42,offy+108,41,12,'KB',tattr,7,1,visual,0]:newgadget,
  173.     [GTTX_TEXT,'000000000',
  174.      GTTX_BORDER,1,
  175.      NIL]))=NIL THEN RETURN NOGADGET
  176.   IF (g:=textKlata:=CreateGadgetA(TEXT_KIND,g,
  177.     [offx+122,offy+108,41,12,'Fr.',tattr,7,1,visual,0]:newgadget,
  178.     [GTTX_TEXT,'0000',
  179.      GTTX_BORDER,1,
  180.      NIL]))=NIL THEN RETURN NOGADGET
  181.   IF ch1=0
  182.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  183.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  184.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  185.   ELSE
  186.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  187.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  188.      [NIL]))=NIL THEN RETURN NOGADGET
  189.   ENDIF
  190.   IF ch4=0
  191.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  192.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  193.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  194.   ELSE
  195.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  196.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  197.      [NIL]))=NIL THEN RETURN NOGADGET
  198.   ENDIF
  199.   IF ch2=0
  200.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  201.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  202.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  203.   ELSE
  204.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  205.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  206.      [NIL]))=NIL THEN RETURN NOGADGET
  207.   ENDIF
  208.   IF ch3=0
  209.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  210.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  211.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  212.   ELSE
  213.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  214.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  215.      [NIL]))=NIL THEN RETURN NOGADGET
  216.   ENDIF
  217.   IF (g:=loadButton:=CreateGadgetA(BUTTON_KIND,g,
  218.     [offx+11,offy+179,24,12,'L',tattr,12,0,visual,0]:newgadget,
  219.     [NIL]))=NIL THEN RETURN NOGADGET
  220.   IF (g:=deleteButton:=CreateGadgetA(BUTTON_KIND,g,
  221.     [offx+280,offy+179,26,12,'D',tattr,12,0,visual,0]:newgadget,
  222.     [NIL]))=NIL THEN RETURN NOGADGET
  223.   IF (g:=stringGadget:=CreateGadgetA(STRING_KIND,g,
  224.     [offx+35,offy+179,245,12,'Files',tattr,13,4,visual,0]:newgadget,
  225.     [GTST_STRING,gattext,
  226.      GTST_MAXCHARS,256,
  227.      NIL]))=NIL THEN RETURN NOGADGET
  228.      stringInfo:=stringGadget.specialinfo
  229.      stringGadgetValue:=stringInfo.buffer
  230.  
  231.   IF (g:=loadSButton:=CreateGadgetA(BUTTON_KIND,g,
  232.     [offx+11,offy+194,24,12,'L',tattr,12,0,visual,0]:newgadget,
  233.     [NIL]))=NIL THEN RETURN NOGADGET
  234.   IF (g:=checkPLAY:=CreateGadgetA(CHECKBOX_KIND,g,
  235.      [offx+280,offy+194,22,12,NIL,tattr,10,1,visual,0]:newgadget,
  236.      [NIL]))=NIL THEN RETURN NOGADGET
  237.  
  238.   IF (g:=stringSampl:=CreateGadgetA(STRING_KIND,g,
  239.     [offx+35,offy+194,245,12,NIL,tattr,0,8,visual,0]:newgadget,
  240.     [GTST_STRING,gatsampl,
  241.      GTST_MAXCHARS,256,
  242.      NIL]))=NIL THEN RETURN NOGADGET
  243.      stringInfo2:=stringSampl.specialinfo
  244.      stringSamplValue:=stringInfo2.buffer
  245.  
  246.   IF (g:=playButton:=CreateGadgetA(BUTTON_KIND,g,
  247.     [offx+15,offy+131,66,29,'PLAY',tattr,14,16,visual,0]:newgadget,
  248.     [NIL]))=NIL THEN RETURN NOGADGET
  249.   IF (g:=infoButton:=CreateGadgetA(BUTTON_KIND,g,
  250.     [offx+244,offy+131,58,14,'About',tattr,15,16,visual,0]:newgadget,
  251.     [NIL]))=NIL THEN RETURN NOGADGET
  252.   IF (g:=saveButton:=CreateGadgetA(BUTTON_KIND,g,
  253.     [offx+244,offy+147,58,13,'SAVE',tattr,16,16,visual,0]:newgadget,
  254.     [NIL]))=NIL THEN RETURN NOGADGET
  255.  
  256.   IF (g:=scrolButton:=CreateGadgetA(SCROLLER_KIND,g,
  257.     [offx+13,offy+210,238,10,NIL,tattr,0,1,visual,0]:newgadget,
  258.     [GA_RELVERIFY,1,
  259.      GA_IMMEDIATE,1,
  260.      GTSC_TOTAL,52,
  261.      GTSC_ARROWS,16,
  262.      NIL]))=NIL THEN RETURN NOGADGET
  263.  
  264. ENDPROC  NONE
  265.  
  266. PROC openWindow()
  267.   IF createGadgets()<>NONE THEN RETURN NOGADGET
  268.   /*-- Note WA_IDCMP to get messages from the listview gadget: --*/
  269.   IF (win:=OpenWindowTagList(NIL,
  270.     [WA_LEFT,         x,
  271.      WA_TOP,          y,
  272.      WA_WIDTH,        offx+316,
  273.      WA_HEIGHT,       offy+229,
  274.      WA_MINWIDTH, 316, WA_MINHEIGHT,  11,
  275.      WA_IDCMP,        (IDCMP_REFRESHWINDOW OR IDCMP_CLOSEWINDOW OR IDCMP_GADGETUP OR
  276.                        IDCMP_MOUSEMOVE OR LISTVIEWIDCMP OR SCROLLERIDCMP
  277. OR IDCMP_NEWSIZE),
  278.      WA_FLAGS,        (WFLG_DRAGBAR OR WFLG_DEPTHGADGET OR WFLG_CLOSEGADGET OR
  279.                        WFLG_SMART_REFRESH OR WFLG_ACTIVATE OR WFLG_HASZOOM),
  280.      WA_TITLE,'MPEG Intuition V2.3',
  281.      WA_SCREENTITLE,'MPEGIntuition v2.3 by Mahdi/Sauron',
  282.      WA_CUSTOMSCREEN, scr,
  283.      WA_AUTOADJUST,   1,
  284.      WA_GADGETS,      glist,
  285.      TAG_DONE]))=NIL THEN RETURN NOWINDOW
  286.   PrintIText(win.rport,
  287.     [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  288.   DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
  289.     [GT_VISUALINFO,visual,NIL])
  290.   DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  291.     [GT_VISUALINFO,visual,NIL])
  292.   DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  293.     [GT_VISUALINFO,visual,NIL])
  294.   Gt_RefreshWindow(win, NIL)
  295.    SetStdRast(win.rport)
  296.    Colour(1,0)
  297.    TextF(offx+251,offy+217,' 0.0 s')
  298. ENDPROC NONE
  299.  
  300. PROC closeWindow()
  301.   IF win THEN CloseWindow(win)
  302. ENDPROC
  303.  
  304. PROC wait4message(win:PTR TO window)
  305.   DEF mes:PTR TO intuimessage,type
  306.   REPEAT
  307.     type:=0
  308.     IF mes:=Gt_GetIMsg(win.userport)
  309.       type:=mes.class
  310.       SELECT type
  311.         CASE IDCMP_NEWSIZE
  312. /*          IF wsize=1
  313.               ->wsize:=0
  314.  
  315.           ELSEIF wsize=0
  316.                wsize:=1
  317.           ENDIF*/
  318.         CASE IDCMP_GADGETUP
  319.           /*-- Any old gadget will do.  The address is used --*/
  320.           /*-- to identify which one sent the message.      --*/
  321.           infos:=mes.iaddress
  322.           infos.gadgetid:=mes.code
  323.         SELECT infos
  324.          CASE listView
  325.            rodzajDit:=mes.code
  326.          ENDSELECT
  327.           IF mes.code THEN check:=TRUE ELSE check:=FALSE
  328.          CASE IDCMP_REFRESHWINDOW
  329.           name()
  330.           IF wsize=1
  331.              IF poOOOOmitazmienna=1
  332. /*
  333. **               wpis()
  334. */
  335.                 Gt_SetGadgetAttrsA (textTime, win, NIL,
  336.                             [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  337.                 Gt_SetGadgetAttrsA (textX, win, NIL,
  338.                             [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  339.                 Gt_SetGadgetAttrsA (textY, win, NIL,
  340.                             [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  341.                 Gt_SetGadgetAttrsA (textSize, win, NIL,
  342.                             [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  343.                 Gt_SetGadgetAttrsA (textFrames, win, NIL,
  344.                             [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  345.                 Gt_SetGadgetAttrsA (textComp, win, NIL,
  346.                             [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  347.                 Gt_SetGadgetAttrsA (textKB,win ,NIL,
  348.                             [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  349.                 Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  350.                             [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  351.  
  352.                Gt_SetGadgetAttrsA (listView, win, NIL,
  353.                       [GTLV_LABELS, list,
  354.                        GTLV_TOP,    0,
  355.                        TAG_DONE])
  356.              ELSE
  357.               Gt_BeginRefresh(win)
  358.               Gt_EndRefresh(win,TRUE)
  359.              ENDIF
  360.                 PrintIText(win.rport,
  361.                 [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  362.                 DrawBevelBoxA(win.rport,7+offx,165+offy,302,60,
  363.                 [GT_VISUALINFO,visual,NIL])
  364.                 DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  365.                 [GT_VISUALINFO,visual,NIL])
  366.                 DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  367.                 [GT_VISUALINFO,visual,NIL])
  368.                 scrol()
  369.             wsize:=0
  370.           ELSEIF wsize=0
  371.               wsize:=1
  372.           ENDIF
  373.           type:=0
  374.       ENDSELECT
  375.       Gt_ReplyIMsg(mes)
  376.     ELSE
  377.       WaitPort(win.userport)
  378.     ENDIF
  379.   UNTIL type
  380. ENDPROC type
  381.  
  382. PROC addToList()
  383.   DEF newNode=NIL:PTR TO ln, node:PTR TO ln,
  384.       len, itemPosition=0
  385.   newNode:=New(SIZEOF ln)
  386.   len:=StrLen(lue)
  387.   newNode.name:=String(len)
  388.   StrCopy(newNode.name, lue, ALL)
  389. /*-- Detach the exec LIST from the listview gadget. --*/
  390.   Gt_SetGadgetAttrsA (listView, win, NIL, [GTLV_LABELS, -1, TAG_DONE])
  391. /*-- Decide where TO insert the new item.  Sorted on first character. --*/
  392.   node:=list.head
  393.   Insert(list, newNode, node.pred)
  394. /*  ENDIF*/
  395.   /*-- Reattach the exec list to the listview gadget. --*/
  396.   Gt_SetGadgetAttrsA (listView, win, NIL,
  397.                       [GTLV_LABELS, list,
  398.                        GTLV_TOP,    itemPosition,
  399.                        TAG_DONE])
  400. ENDPROC
  401.  
  402. PROC main() HANDLE
  403. DEF listItemPosition=0,mp_Task,pentla,brom,prob[2]:STRING
  404.   IF reqtoolsbase:=OpenLibrary('reqtools.library',37)
  405.    font:=1
  406.    ikona()
  407.    levelid:=0
  408.    wsize:=0
  409.    RightStr(prob,mppath,1)
  410.     IF (FileLength(mppath)<=0) OR (StrCmp(prob,':'))
  411.       Raise(NO_MP)
  412.       WriteF('No MP:\d\n', FileLength(mppath))
  413.     ENDIF
  414.     pentla:=1
  415.     poOOOOmitazmienna:=0
  416.    IF setupScreen()=NONE
  417.     IF openWindow()=NONE
  418.      lue:='AMP-hiresham'
  419.      addToList()
  420.      lue:='AMP-ham6'
  421.      addToList()
  422.      lue:='AMP-color'
  423.      addToList()
  424.      lue:='Opal15'
  425.      addToList()
  426.      lue:='Opal24'
  427.      addToList()
  428.      lue:='Village24'
  429.      addToList()
  430.      lue:='EGS24'
  431.      addToList()
  432.      lue:='Retina24'
  433.      addToList()
  434.      lue:='Mono'
  435.      addToList()
  436.      lue:='FS4'
  437.      addToList()
  438.      lue:='FS2 Fast'
  439.      addToList()
  440.      lue:='FS2'
  441.      addToList()
  442.      lue:='Ordered2'
  443.      addToList()
  444.      lue:='Ordered'
  445.      addToList()
  446.      lue:='Hybrid2'
  447.      addToList()
  448.      lue:='Hybrid'
  449.      addToList()
  450.      lue:='Threshold'
  451.      addToList()
  452.      lue:='MBordered'
  453.      addToList()
  454.      lue:='2x2'
  455.      addToList()
  456.      lue:='Color'
  457.      addToList()
  458.      lue:='HAM6'
  459.      addToList()
  460.      lue:='HAM8'
  461.      addToList()
  462.      lue:='Gray'
  463.      addToList()
  464.      lue:='Gray8'
  465.      addToList()
  466.      rodzajDit:=prr
  467. ->    inform()
  468.       REPEAT
  469.         messageClass:=wait4message(win)
  470.         SELECT messageClass
  471.           CASE IDCMP_GADGETUP
  472.             SELECT infos  /* pointer to gadget */
  473.               CASE scrolButton
  474.                 levelid:=infos.gadgetid
  475.                 scrol()
  476.               CASE infoButton
  477.                inform()
  478.                ->play()
  479.               CASE saveButton
  480.                IF req:=RtAllocRequestA(FILEREQ,0)
  481.                 phii:=RtLockWindow(win)
  482.                    RtEZRequestA('Prg. MP needs(?!?!?!??) path < 31 chars.',
  483.                    'BI-LA KAIFA !!!!',0,0,0)
  484.                    RtChangeReqAttrA(req,[RTFI_DIR,dir])
  485.                     IF RtFileRequestA(req,NIL,'Pick a drawer TO save !!!'
  486.                       ,[RTFI_FLAGS,(FREQF_NOFILES OR FREQF_SAVE)])
  487.                       StrCopy(robot,req.dir)
  488.                       StrCopy(plik,robot)
  489.                       StringF(robot,'IFF24.%%%%')
  490.                       IF RtGetStringA(robot,100,'Enter a file pattern !!!',0,0)
  491.                     StrCopy(mainfile,req.dir,ALL)
  492.                     IF StrCmp(req.dir[StrLen(mainfile)-1],':')
  493.                      StrCopy(plik,mainfile)
  494.                     ELSEIF StrCmp(req.dir[StrLen(mainfile)-1],'/')
  495.                      StrCopy(plik,mainfile)
  496.                     ELSEIF StrLen(mainfile)<1
  497.                      StrCopy(plik,mainfile)
  498.                     ELSE
  499.                      StrCopy(plik,mainfile)
  500.                      StrAdd(plik,'/')
  501.                     ENDIF
  502.                          StrCopy(mainfile,plik,ALL)
  503.                          StringF(plik,'"\s\s"',mainfile,robot)
  504.                            IF StrLen(plik)>31
  505.                              RtEZRequestA('It must be under 31 chars !!!!.',
  506.                              'Doup !!! Sorry I''ll try again !!',0,0,0)
  507.                            ELSE
  508.                          StringF(robot,'\s -saveiff \s "\s"',mppath,plik,gattext)
  509.                          Execute(robot,NIL,0)
  510.                          robot[]:=0
  511.                       ENDIF
  512.                     ENDIF
  513.                  ENDIF
  514.                  RtUnlockWindow(win,phii)
  515.                  RtFreeRequest(req)
  516.                ENDIF
  517.         CASE playButton
  518.             IF (noap=1) AND (rodzajDit>20)
  519.                shit:=1
  520.             ENDIF
  521.              IF shit=0
  522.               IF mp_Task:=Open('ram:pracfile',NEWFILE)
  523.                IF FileLength(stringGadgetValue)<>0
  524. /*
  525. ** Button OFF
  526. */
  527.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  528.                       [GA_DISABLED,1,TAG_DONE])
  529.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  530.                       [GA_DISABLED,1,TAG_DONE])
  531.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  532.                       [GA_DISABLED,1,TAG_DONE])
  533.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  534.                       [GA_DISABLED,1,TAG_DONE])
  535.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  536.                       [GA_DISABLED,1,TAG_DONE])
  537.            Gt_SetGadgetAttrsA (loadSButton, win, NIL,
  538.                       [GA_DISABLED,1,TAG_DONE])
  539.            Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
  540.                       [GA_DISABLED,1,TAG_DONE])
  541.  
  542.                 IF rodzajDit=0 THEN StrCopy(dither,' -dither gray8 ',ALL)
  543.                 IF rodzajDit=1 THEN StrCopy(dither,' -dither gray ',ALL)
  544.                 IF rodzajDit=2 THEN StrCopy(dither,' -dither ham8 ',ALL)
  545.                 IF rodzajDit=3 THEN StrCopy(dither,' -dither ham6 ',ALL)
  546.                 IF rodzajDit=4 THEN StrCopy(dither,' -dither color ',ALL)
  547.                 IF rodzajDit=5 THEN StrCopy(dither,' -dither 2x2 ',ALL)
  548.                 IF rodzajDit=6 THEN StrCopy(dither,' -dither mbordered ',ALL)
  549.                 IF rodzajDit=7 THEN StrCopy(dither,' -dither threshold ',ALL)
  550.                 IF rodzajDit=8 THEN StrCopy(dither,' -dither hybrid ',ALL)
  551.                 IF rodzajDit=9 THEN StrCopy(dither,' -dither hybrid2 ',ALL)
  552.                 IF rodzajDit=10 THEN StrCopy(dither,' -dither ordered ',ALL)
  553.                 IF rodzajDit=11 THEN StrCopy(dither,' -dither ordered2 ',ALL)
  554.                 IF rodzajDit=12 THEN StrCopy(dither,' -dither fs2 ',ALL)
  555.                 IF rodzajDit=13 THEN StrCopy(dither,' -dither fs2fast ',ALL)
  556.                 IF rodzajDit=14 THEN StrCopy(dither,' -dither fs4 ',ALL)
  557.                 IF rodzajDit=15 THEN StrCopy(dither,' -dither mono ',ALL)
  558.                 IF rodzajDit=16 THEN StrCopy(dither,' -dither retina24 ',ALL)
  559.                 IF rodzajDit=17 THEN StrCopy(dither,' -dither egs24 ',ALL)
  560.                 IF rodzajDit=18 THEN StrCopy(dither,' -dither village24 ',ALL)
  561.                 IF rodzajDit=19 THEN StrCopy(dither,' -dither opal24 ',ALL)
  562.                 IF rodzajDit=20 THEN StrCopy(dither,' -dither opal15 ',ALL)
  563.                 IF rodzajDit=21 THEN StrCopy(dither,' -dither color ',ALL)
  564.                 IF rodzajDit=22 THEN StrCopy(dither,' -dither ham6 ',ALL)
  565.                 IF rodzajDit=23 THEN StrCopy(dither,' -dither hiresham ',ALL)
  566.                 StringF(mainfile,'')
  567.                  IF rodzajDit>20
  568.                     StrAdd(mainfile,appath,ALL)
  569.                     player:=2
  570.                  ELSE
  571.                     StrAdd(mainfile,mppath,ALL)
  572.                     player:=1
  573.                  ENDIF
  574.                   IF chs=0 THEN play()
  575.                   IF ch3=0 THEN StrAdd(mainfile,' -nob',ALL)
  576.                   IF ch4=0 THEN StrAdd(mainfile,' -nob',ALL)
  577.                     StrAdd(mainfile,dither,ALL)
  578.                     count:=0
  579.                   IF ch2=0
  580.                         pentla:=1
  581.                         IF  RtGetLongA({pentla},'Write LOOP number:',0,0)
  582.                      ELSE
  583.                         pentla:=-1
  584.                      ENDIF
  585.                   ENDIF
  586.                IF pentla>0
  587.                  IF pentla=0 THEN pentla:=1
  588.                   IF ch1=0
  589.                     cop(stringGadgetValue,'ram:mpeg.tmp')
  590.                     StrAdd(mainfile,'RAM:')
  591.                     StrAdd(mainfile,'mpeg.tmp')
  592.                       count:=1
  593.                       REPEAT
  594.                         Execute(mainfile,0,mp_Task)
  595.                         count:=count+1
  596.                       UNTIL count>=pentla
  597.                     pentla:=1
  598.                      DeleteFile('ram:mpeg.tmp')
  599.                   ELSE
  600.                     StringF(robot,'"\s"',stringGadgetValue)
  601.                     StrAdd(mainfile,robot,ALL)
  602.                       REPEAT
  603.                         Execute(mainfile,0,mp_Task)
  604.                         count:=count+1
  605.                       UNTIL count=pentla
  606.                     pentla:=1
  607.                  ENDIF
  608.               ENDIF
  609.                    IF pentla=-1 THEN pentla:=1
  610. /*
  611. ** Button's OK
  612. */
  613.            poOOOOmitazmienna:=1
  614.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  615.                       [GA_DISABLED,0,TAG_DONE])
  616.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  617.                       [GA_DISABLED,0,TAG_DONE])
  618.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  619.                       [GA_DISABLED,0,TAG_DONE])
  620.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  621.                       [GA_DISABLED,0,TAG_DONE])
  622.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  623.                       [GA_DISABLED,0,TAG_DONE])
  624.            Gt_SetGadgetAttrsA (loadSButton, win, NIL,
  625.                       [GA_DISABLED,0,TAG_DONE])
  626.            Gt_SetGadgetAttrsA (checkPLAY, win, NIL,
  627.                       [GA_DISABLED,0,TAG_DONE])
  628.              ENDIF
  629.               ENDIF
  630.                  Close(mp_Task)
  631.                  IF (FileLength('RAM:pracfile')>10) AND (FileLength
  632.                      ('RAM:pracfile')<175)
  633.                     wpis()
  634.                  ELSE
  635.                  ENDIF
  636.                 ENDIF
  637. /* ENDIF*/
  638.                shit:=0
  639.               CASE loadSButton
  640.                   loadsmp()
  641.               CASE loadButton
  642.                IF req:=RtAllocRequestA(FILEREQ,0)
  643.                 phii:=RtLockWindow(win)
  644.                  RtChangeReqAttrA(req,[RTFI_DIR,dir,RTFI_MATCHPAT,
  645.                  '#?.(MPEG|MP|MPG)'])
  646.                   IF RtFileRequestA(req,buf,'Pick an mpeg anim !!!'
  647.                    ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
  648.                    RTFI_OKTEXT,('SURE')])
  649.                    StrCopy(plik,buf)
  650.                    StrCopy(dir,req.dir)
  651.                     IF StrCmp(req.dir[StrLen(dir)-1],':')
  652.                      StrCopy(gattext,dir)
  653.                      StrAdd(gattext,plik)
  654.                     ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  655.                      StrCopy(gattext,dir)
  656.                      StrAdd(gattext,plik)
  657.                     ELSEIF StrLen(dir)<1
  658.                      StrCopy(gattext,dir)
  659.                      StrAdd(gattext,plik)
  660.                     ELSE
  661.                      StrCopy(gattext,dir)
  662.                      StrAdd(gattext,'/')
  663.                      StrAdd(gattext,plik)
  664.                     ENDIF
  665.                    Gt_SetGadgetAttrsA (stringGadget, win, NIL,
  666.                    [GTST_STRING,gattext,TAG_DONE])
  667.                    StrCopy(dir,req.dir)
  668.                    RtFreeRequest(req)
  669.                   ENDIF
  670.                  RtUnlockWindow(win,phii)
  671.                ENDIF
  672.               CASE listView
  673.                 listItemPosition:=infos.gadgetid /* note the use of this field! */
  674.               CASE checkRAM
  675.                 ch1:=check+1
  676.               CASE checkLoop
  677.                 ch2:=check+1
  678.               CASE checkNOP
  679.                 ch3:=check+1
  680.               CASE checkNOB
  681.                 ch4:=check+1
  682.               CASE checkPLAY
  683.                 chs:=check+1
  684.               CASE deleteButton
  685.                phii:=RtLockWindow(win)
  686.                brom:=RtEZRequestA('Shall I delete that file ?\n\s',
  687.                'Delete|Nope leave it',0,[stringGadgetValue],0)
  688.                 IF brom=1
  689.                     DeleteFile(stringGadgetValue)
  690.                 ELSE
  691.                 ENDIF
  692.               RtUnlockWindow(win,phii)
  693.            ENDSELECT
  694.           CASE IDCMP_INTUITICKS
  695.             NOP/*  these are being sent FOR some shitty reason }:-( */
  696.         ENDSELECT
  697.       UNTIL messageClass=IDCMP_CLOSEWINDOW
  698.       closeWindow()
  699.        IF FileLength('ram:pracfile')>0
  700.           DeleteFile('ram:pracfile')
  701.        ENDIF
  702.     ENDIF
  703.   ENDIF
  704.   CloseLibrary(reqtoolsbase)
  705.  ELSE
  706.   Raise(NO_REQTOOLS)
  707.  ENDIF
  708.   closeScreen()
  709.   CleanUp(0)
  710. EXCEPT
  711.   SELECT exception
  712.       IF reqtoolsbase THEN CloseLibrary(reqtoolsbase)
  713.       CASE NO_MP
  714.                          EasyRequestArgs(NIL,
  715.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  716.                         '   I can''t find MP program   \n   check path in icon prefs',
  717.                         'OK :(']:easystruct,
  718.                         NIL,NIL)
  719.       CASE NO_ICONLIB
  720.                         EasyRequestArgs(NIL,
  721.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  722.                         '   Sorry no icon.library\nin your''s LIBS: dir',
  723.                         'OK I''ll copy it']:easystruct,
  724.                         NIL,NIL)
  725.       CASE NO_ICON
  726.                         EasyRequestArgs(NIL,
  727.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  728.                         'Sorry, you need TO run\n this program from WB',
  729.                         'OK (I understand)']:easystruct,
  730.                         NIL,NIL)
  731.       CASE NO_REQTOOLS
  732.                         EasyRequestArgs(NIL,
  733.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  734.                         ' Sorry no ReqTools.library\n   in your''s LIBS: dir',
  735.                         'OK I''ll copy it']:easystruct,
  736.                         NIL,NIL)
  737.       DEFAULT
  738.       WriteF('Well there is some error ( >:-< ) blââââdddd np.\n')
  739.       WriteF('Excident nr: "\s"\n', [exception, 0])
  740.       closeWindow()
  741.       closeScreen()
  742.       CleanUp(0)
  743.   ENDSELECT
  744. ENDPROC
  745.  
  746. PROC scrol()
  747.    SetStdRast(win.rport)
  748.    Colour(1,0)
  749.     IF levelid < 10
  750.      StringF(mainfile,' 0.\d s',levelid)
  751.     ELSEIF levelid = 10
  752.      StringF(mainfile,' 1.0 s')
  753.     ELSEIF (levelid < 20) AND (levelid > 10)
  754.      StringF(mainfile,' 1.\d s',levelid-10)
  755.     ELSEIF levelid = 20
  756.      StringF(mainfile,' 2.0 s')
  757.     ELSEIF (levelid < 30) AND (levelid > 20)
  758.      StringF(mainfile,' 2.\d s',levelid-20)
  759.     ELSEIF levelid = 30
  760.      StringF(mainfile,' 3.0 s')
  761.     ELSEIF (levelid < 40) AND (levelid > 30)
  762.      StringF(mainfile,' 3.\d s',levelid-30)
  763.     ELSEIF levelid = 40
  764.      StringF(mainfile,' 4.0 s')
  765.     ELSEIF (levelid < 50) AND (levelid > 40)
  766.      StringF(mainfile,' 4.\d s',levelid-40)
  767.     ELSEIF levelid = 50
  768.      StringF(mainfile,' 5.0 s')
  769.     ENDIF
  770.    TextF(offx+251,offy+217,mainfile)
  771.  
  772. ENDPROC
  773.  
  774. PROC loadsmp()
  775.     DEF dir[100]:STRING
  776.  
  777.   IF req:=RtAllocRequestA(FILEREQ,0)
  778.     phii:=RtLockWindow(win)
  779.     RtChangeReqAttrA(req,[RTFI_DIR,dirs,RTFI_MATCHPAT,
  780.                      '#?.#?'])
  781.        IF RtFileRequestA(req,buf,'Pick a sample file !!!'
  782.               ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
  783.                RTFI_OKTEXT,('SURE')])
  784.                StrCopy(plik,buf)
  785.                StrCopy(dirs,req.dir)
  786.                 IF StrCmp(req.dir[StrLen(dir)-1],':')
  787.                  StrCopy(gatsampl,dirs)
  788.                  StrAdd(gatsampl,plik)
  789.                 ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  790.                   StrCopy(gatsampl,dirs)
  791.                   StrAdd(gatsampl,plik)
  792.                     ELSEIF StrLen(dirs)<1
  793.                      StrCopy(gatsampl,dirs)
  794.                      StrAdd(gatsampl,plik)
  795.                     ELSE
  796.                      StrCopy(gatsampl,dirs)
  797.                      StrAdd(gatsampl,'/')
  798.                      StrAdd(gatsampl,plik)
  799.                     ENDIF
  800.                    Gt_SetGadgetAttrsA (stringSampl, win, NIL,
  801.                    [GTST_STRING,gatsampl,TAG_DONE])
  802.                    StrCopy(dirs,req.dir)
  803.                    RtFreeRequest(req)
  804.                   ENDIF
  805.                  RtUnlockWindow(win,phii)
  806.                ENDIF
  807. ENDPROC
  808.  
  809. PROC name()
  810.   SetWindowTitles(win,'MPEG Intuition V2.3', Not(0))
  811. ENDPROC
  812.  
  813. PROC inform()
  814.  
  815. DEF w=NIL:PTR TO window
  816.     phii:=RtLockWindow(win)
  817.  IF w:=OpenWindowTagList(NIL,[WA_FLAGS,$E,WA_IDCMP,$268,IDCMP_MOUSEBUTTONS,0,
  818.                   WA_TOP,win.topedge+40,WA_LEFT,win.leftedge+8,
  819.                   WA_WIDTH,300,WA_HEIGHT,140,WA_TITLE,'About MPEG intuition V2.3',0])
  820.                   SetStdRast(w.rport)
  821.                   SetTopaz(8)
  822.                   Colour(2,0)
  823.                   TextF(55,30,'  MPEG Intuition v2.3')
  824.                   TextF(52,45,'by Mahdi/Sauron (c) 1995')
  825.                   Colour(1,0)
  826.                   TextF(55,65,'Bugs & Develope send TO:')
  827.                   TextF(45,75,'Adrian (SAURON) Siemieniak')
  828.                   TextF(45,85,'sauron@sco.zsi.pwr.wroc.pl')
  829.                   TextF(35,95,'sauron@sun1000.ci.pwr.wroc.pl')
  830.                   TextF(75,105,'tel.(071) 24-10-20')
  831.                   TextF(10,125,'-----------------------------------')
  832.                   ->WaitLeftMouse(w)
  833.                   REPEAT
  834.                       class:=WaitIMessage(w)
  835.                   UNTIL (class=IDCMP_CLOSEWINDOW) OR (class=8)
  836.                    CloseWindow(w)
  837.                   name()
  838.  ENDIF
  839.     RtUnlockWindow(win,phii)
  840. ENDPROC
  841.  
  842. PROC wpis()
  843.   DEF inputstring[80]:STRING,work[20]:STRING,work2[14]:STRING,mp_Task,x,y,a,b
  844.   IF FileLength('ram:pracfile')>0
  845.    IF mp_Task:=Open('ram:pracfile',OLDFILE)
  846.       ReadStr(mp_Task,inputstring)
  847.       StrCopy(work2,'')
  848.     IF player=1
  849.       ReadStr(mp_Task,inputstring)
  850.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  851.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  852.       x:= RealVal(work)
  853.       StrAdd(work2,work)
  854.       StrCopy(id_time,work2)
  855.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  856.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  857.  
  858.       ReadStr(mp_Task,inputstring)
  859.       a:= InStr(inputstring,' x',10)
  860.       MidStr(work,inputstring,11,a-11)
  861.       StrCopy(id_xsize,work)
  862.       Gt_SetGadgetAttrsA (textX, win, NIL,
  863.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  864.       a:= InStr(inputstring,'x ',10)
  865.       b:= InStr(inputstring,' Pi',10)
  866.       b:= b-2-a
  867.       IF b=2
  868.           a:=a-1
  869.           b:=3
  870.       ENDIF
  871.       MidStr(work,inputstring,a+2,b)
  872.       StrCopy(id_ysize,work)
  873.       Gt_SetGadgetAttrsA (textY, win, NIL,
  874.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  875.  
  876.       ReadStr(mp_Task,inputstring)
  877.       StrCopy(work2,'')
  878.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  879.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  880.       y:= RealVal(work)
  881.       StrAdd(work2,work)
  882.       StrCopy(id_framess,work2)
  883.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  884.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  885.  
  886.       ReadStr(mp_Task,inputstring)
  887.       UpperStr(inputstring)
  888.       StrCopy(work2,'')
  889.       a:= InStr(inputstring,' BYTES',13)
  890.       MidStr(work,inputstring,16,a-16)
  891.       FOR a:=1 TO 9- StrLen(work) DO StrAdd(work2,' ')
  892.       StrAdd(work2,work)
  893.       StrCopy(id_framesb,work2)
  894.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  895.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  896.       a:= InStr(inputstring,'TE ',42)
  897.       MidStr(work,inputstring,a+2,7)
  898.       StrCopy(id_compress,work)
  899.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  900.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  901.     ELSE
  902.       ReadStr(mp_Task,inputstring)
  903.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  904.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  905.       x:= RealVal(work)
  906.       StrAdd(work2,work)
  907.       StrCopy(id_time,work2)
  908.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  909.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  910.  
  911.       ReadStr(mp_Task,inputstring)
  912.       StrCopy(work2,'')
  913.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  914.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  915.       y:= RealVal(work)
  916.       StrAdd(work2,work)
  917.       StrCopy(id_framess,work2)
  918.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  919.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  920.  
  921.       ReadStr(mp_Task,inputstring)
  922.       a:= InStr(inputstring,'*',10)
  923.       MidStr(work,inputstring,12,a-12)
  924.       StrCopy(id_xsize,work)
  925.       Gt_SetGadgetAttrsA (textX, win, NIL,
  926.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  927.       a:= InStr(inputstring,'*',10)
  928.       b:= InStr(inputstring,' pi',10)
  929.       b:= b-2-a
  930.       IF b=1
  931.           b:=2
  932.           MidStr(work2,inputstring,a+1,b)
  933.           StringF(work,' \s',work2)
  934.       ELSEIF
  935.           MidStr(work,inputstring,a+1,b+2)
  936.       ENDIF
  937.       StrCopy(id_ysize,work)
  938.       Gt_SetGadgetAttrsA (textY, win, NIL,
  939.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  940.  
  941.       StrCopy(work2,'')
  942.       b:= !x*y
  943.       a:= FileLength(gattext)/(!b!)
  944.       StringF(work,'\d.2',a)
  945.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  946.       StrAdd(work2,work)
  947.       StrCopy(id_framesb,work2)
  948.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  949.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  950.  
  951.    ENDIF
  952.  
  953. /* File length procedure*/
  954.       StrCopy(work2,'')
  955.       StringF(work,'\d',FileLength(gattext))
  956.       a:= Val(work)
  957.       b:=Div(a,1024)
  958.       StringF(work,'\d',b)
  959.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  960.       StrAdd(work2,work)
  961.       StrCopy(id_kb,work2)
  962.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  963.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  964.  
  965. /* Frames counter procedure */
  966.       b:=!x*y
  967.       StringF(work,'\d',!b!)
  968.       StrCopy(work2,'')
  969.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  970.       StrAdd(work2,work)
  971.       StrCopy(id_frames,work2)
  972.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  973.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  974.     Close(mp_Task)
  975.   ENDIF
  976.  ELSE
  977.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  978.                   [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  979.       Gt_SetGadgetAttrsA (textX, win, NIL,
  980.                   [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  981.       Gt_SetGadgetAttrsA (textY, win, NIL,
  982.                   [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  983.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  984.                   [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  985.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  986.                   [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  987.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  988.                   [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  989.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  990.                   [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  991.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  992.                   [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  993.  ENDIF
  994. ENDPROC
  995.  
  996. PROC ikona()
  997.         DEF wb:PTR TO wbstartup,wba:PTR TO wbarg,dobj:PTR TO diskobject,toolarray,
  998.         str,olddir=0,pri=0,read=0
  999.         IF (iconbase:=OpenLibrary('icon.library',37))
  1000.         ELSE
  1001.             Raise(NO_ICONLIB)
  1002.         ENDIF
  1003.    IF wbmessage
  1004.                 wb:=wbmessage ; wba:=wb.arglist
  1005.                 IF (wba.lock>0) AND (wba.name>0)
  1006.                         olddir:=CurrentDir(wba.lock)
  1007.                 ENDIF
  1008.                  IF (dobj:=GetDiskObject(wba.name))>0
  1009.                     toolarray:=dobj.tooltypes
  1010.                        IF (str:=FindToolType(toolarray,'MP_PATH'))>0
  1011.                          StrCopy(mppath,str,ALL)
  1012.                        ENDIF
  1013.                        IF (str:=FindToolType(toolarray,'AP_PATH'))>0
  1014.                          StrCopy(appath,str,ALL)
  1015.                          IF FileLength(appath)<=0
  1016.                              noap:=1
  1017.                          EasyRequestArgs(NIL,
  1018.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  1019.                         '   I can''t find Amipeg program   \n     check path in icon prefs',
  1020.                         'OK :(']:easystruct,
  1021.                         NIL,NIL)
  1022.                          ENDIF
  1023.                        ENDIF
  1024.                        IF (str:=FindToolType(toolarray,'MP_PRIO'))>0
  1025.                          pri:=Val(str,read)
  1026.                           IF read=0
  1027.                            prio:=pri
  1028.                           ENDIF
  1029.                        ENDIF
  1030.                        IF (str:=FindToolType(toolarray,'SM_PATH'))>0
  1031.                          StrCopy(smpath,str,ALL)
  1032.                          IF FileLength(smpath)>0
  1033.                         ELSE
  1034.                          EasyRequestArgs(NIL,
  1035.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  1036.                         '   I can''t find program TO Play Sample  \n       check path in icon prefs',
  1037.                         'OK :(']:easystruct,
  1038.                         NIL,NIL)
  1039.                          ENDIF
  1040.                        ENDIF
  1041.                        IF (str:=FindToolType(toolarray,'SM_FORM'))>0
  1042.                          StrCopy(smform,str,ALL)
  1043.                        ENDIF
  1044.                        IF (str:=FindToolType(toolarray,'SM_SAMPLEPATH'))>0
  1045.                          StrCopy(dirs,str,ALL)
  1046.                        ENDIF
  1047.                        IF (str:=FindToolType(toolarray,'SM_SAMPLENAME'))>0
  1048.                         IF StrCmp(req.dir[StrLen(dir)-1],':')
  1049.                          StrCopy(gatsampl,dirs)
  1050.                          StrAdd(gatsampl,str)
  1051.                         ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  1052.                          StrCopy(gatsampl,dirs)
  1053.                          StrAdd(gatsampl,str)
  1054.                         ELSEIF StrLen(dirs)<1
  1055.                          StrCopy(gatsampl,dirs)
  1056.                          StrAdd(gatsampl,str)
  1057.                         ELSE
  1058.                          StrCopy(gatsampl,dirs)
  1059.                          StrAdd(gatsampl,'/')
  1060.                          StrAdd(gatsampl,str)
  1061.                         ENDIF
  1062.                        ENDIF
  1063.  
  1064.                        IF (str:=FindToolType(toolarray,'MP_ANIMPATH'))>0
  1065.                          StrCopy(dir,str,ALL)
  1066.                        ENDIF
  1067.                        IF (str:=FindToolType(toolarray,'MP_ANIMNAME'))>0
  1068.                         IF StrCmp(req.dir[StrLen(dir)-1],':')
  1069.                          StrCopy(gattext,dir)
  1070.                          StrAdd(gattext,str)
  1071.                         ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  1072.                          StrCopy(gattext,dir)
  1073.                          StrAdd(gattext,str)
  1074.                         ELSEIF StrLen(dir)<1
  1075.                          StrCopy(gattext,dir)
  1076.                          StrAdd(gattext,str)
  1077.                         ELSE
  1078.                          StrCopy(gattext,dir)
  1079.                          StrAdd(gattext,'/')
  1080.                          StrAdd(gattext,str)
  1081.                         ENDIF
  1082.                        ENDIF
  1083.                        IF (str:=FindToolType(toolarray,'MP_DITHER'))>0
  1084.                          IF StrCmp(UpperStr(str),'GRAY8')
  1085.                              prr:=0
  1086.                          ELSEIF StrCmp(UpperStr(str),'GRAY')
  1087.                              prr:=1
  1088.                          ELSEIF StrCmp(UpperStr(str),'HAM8')
  1089.                              prr:=2
  1090.                          ELSEIF StrCmp(UpperStr(str),'HAM6')
  1091.                              prr:=3
  1092.                          ELSEIF StrCmp(UpperStr(str),'COLOR')
  1093.                              prr:=4
  1094.                          ELSEIF StrCmp(UpperStr(str),'2X2')
  1095.                              prr:=5
  1096.                          ELSEIF StrCmp(UpperStr(str),'MBORDERED')
  1097.                              prr:=6
  1098.                          ELSEIF StrCmp(UpperStr(str),'TRESHOLD')
  1099.                              prr:=7
  1100.                          ELSEIF StrCmp(UpperStr(str),'HYBRID')
  1101.                              prr:=8
  1102.                          ELSEIF StrCmp(UpperStr(str),'HYBRID2')
  1103.                              prr:=9
  1104.                          ELSEIF StrCmp(UpperStr(str),'ORDERED')
  1105.                              prr:=10
  1106.                          ELSEIF StrCmp(UpperStr(str),'ORDERED2')
  1107.                              prr:=11
  1108.                          ELSEIF StrCmp(UpperStr(str),'FS2')
  1109.                              prr:=12
  1110.                          ELSEIF StrCmp(UpperStr(str),'FS2FAST')
  1111.                              prr:=13
  1112.                          ELSEIF StrCmp(UpperStr(str),'FS4')
  1113.                              prr:=14
  1114.                          ELSEIF StrCmp(UpperStr(str),'MONO')
  1115.                              prr:=15
  1116.                          ELSEIF StrCmp(UpperStr(str),'RETINA24')
  1117.                              prr:=16
  1118.                          ELSEIF StrCmp(UpperStr(str),'EGS24')
  1119.                              prr:=17
  1120.                          ELSEIF StrCmp(UpperStr(str),'VILLAGE24')
  1121.                              prr:=18
  1122.                          ELSEIF StrCmp(UpperStr(str),'OPAL24')
  1123.                              prr:=19
  1124.                          ELSEIF StrCmp(UpperStr(str),'OPAL15')
  1125.                              prr:=20
  1126.                          ELSEIF StrCmp(UpperStr(str),'AMP-COLOR')
  1127.                              prr:=21
  1128.                          ELSEIF StrCmp(UpperStr(str),'AMP-HAM6')
  1129.                              prr:=22
  1130.                          ELSEIF StrCmp(UpperStr(str),'AMP-HIRESHAM')
  1131.                              prr:=23
  1132.                          ELSE
  1133.                              EasyRequestArgs(NIL,
  1134.                             [SIZEOF easystruct, 0, 'Request Window Name',
  1135.                             '   Unknow dither type\nspecified in icon tooltype',
  1136.                             'OK I''ll use DEFAULT (gray8)']:easystruct,
  1137.                             NIL,NIL)
  1138.                          ENDIF
  1139.                        ENDIF
  1140.                        IF (str:=FindToolType(toolarray,'X_WIN'))>0
  1141.                          pri:=Val(str,read)
  1142.                           IF read=0
  1143.                            x:=pri
  1144.                           ENDIF
  1145.                        ENDIF
  1146.                        IF (str:=FindToolType(toolarray,'Y_WIN'))>0
  1147.                          pri:=Val(str,read)
  1148.                           IF read=0
  1149.                            y:=pri
  1150.                           ENDIF
  1151.                        ENDIF
  1152.                        IF (str:=FindToolType(toolarray,'MP_RAM'))>0
  1153.                          IF StrCmp(UpperStr(str),'YES') THEN ch1:=0
  1154.                        ENDIF
  1155.                        IF (str:=FindToolType(toolarray,'MP_NOP'))>0
  1156.                          IF StrCmp(UpperStr(str),'YES') THEN ch4:=0
  1157.                        ENDIF
  1158.                        IF (str:=FindToolType(toolarray,'MP_NOB'))>0
  1159.                          IF StrCmp(UpperStr(str),'YES') THEN ch3:=0
  1160.                        ENDIF
  1161.                        IF (str:=FindToolType(toolarray,'MP_LOOP'))>0
  1162.                          IF StrCmp(UpperStr(str),'YES') THEN ch2:=0
  1163.                        ENDIF
  1164.                        IF (str:=FindToolType(toolarray,'TOPAZ'))>0
  1165.                          IF StrCmp(UpperStr(str),'YES') THEN font:=0
  1166.                        ENDIF
  1167.               CloseLibrary(iconbase)
  1168.           ENDIF
  1169.    ELSE
  1170.        Raise(NO_ICON)
  1171.    ENDIF
  1172. ENDPROC
  1173.  
  1174. PROC cop(nam1,nam2)
  1175.   DEF buffer,leng,actleng,plik,plik2
  1176.   leng:=10240
  1177.   buffer:= AllocMem(leng,0)
  1178.    IF plik :=Open(nam1,OLDFILE)
  1179.    ELSE
  1180.    ENDIF
  1181.    IF plik2 :=Open(nam2,NEWFILE)
  1182.    ELSE
  1183.    ENDIF
  1184.   REPEAT
  1185.    actleng:=Read(plik,buffer,leng)
  1186.    Write(plik2,buffer,actleng)
  1187.   UNTIL actleng<10240
  1188.   Close(plik)
  1189.   Close(plik2)
  1190. ENDPROC
  1191.  
  1192. PROC play()
  1193. DEF roboc[150]:STRING,riek[50]:STRING,po
  1194.   po:=InStr(smform,'{f}')
  1195.   StrCopy(riek,smform,po)
  1196.   StringF(roboc,'run delay -MS \d+\n\s \s"\s"',levelid*5,smpath,riek,stringSamplValue)
  1197.   MidStr(riek,smform,po+3,ALL)
  1198.   StrAdd(roboc,riek)
  1199.   Execute(roboc,0,NIL)
  1200. ENDPROC
  1201.  
  1202.