home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaMiscModsCD3.iso / _PROGRAMME / PLAYER / GUI / EasyPlayer.lha / EYP / Source / easyimages.e < prev    next >
Encoding:
Text File  |  1999-09-25  |  5.7 KB  |  228 lines

  1. /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. -- EasyPlayer, EYP, Ralph Debusmann 1997-9
  3. */
  4.  
  5. OPT MODULE
  6. OPT EXPORT
  7.  
  8. MODULE 'tools/copylist',
  9. 'intuition/intuition',
  10. 'utility',
  11. '*modules/plugins/buttonclass','*modules/plugins/buttonbase',
  12. '*modules/plugins/newimagebutton',
  13. '*modules/reqs',
  14. '*easyconst'
  15.  
  16. CONST NUMNIBS=13,
  17. PREVMODNIB=0,PLAYNIB=1,SONGNUMNIB=2,NEXTMODNIB=3,STOPNIB=4,EJECTNIB=5,
  18. ADDNIB=6,DELNIB=7,UPNIB=8,DOWNNIB=9,FIRSTNIB=10,LASTNIB=11,SHUFFLENIB=12
  19.  
  20. OBJECT mainimages
  21.     nib:PTR TO LONG,
  22.     img:PTR TO LONG,
  23.     d:PTR TO LONG
  24. ENDOBJECT
  25.  
  26. PROC mainimages() OF mainimages HANDLE
  27. DEF d,nib:PTR TO newimagebutton,i
  28.     utilitybase:=0
  29.     IF (utilitybase:=OpenLibrary('utility.library',37))=0 THEN Raise(ERR_OPENUTIL)
  30.  
  31.     self.nib:=List(NUMNIBS)
  32.     self.img:=List(NUMNIBS)
  33.     self.d:=List(NUMNIBS)
  34.  
  35.     self.img[PREVMODNIB]:=[0,0,$15,$d,1,
  36.         d:=copyListToChip([
  37.     $00000000,$00000000,$00000000,$1060c000,
  38.     $11e3c000,$17efc000,$1fffc000,$17efc000,
  39.     $11e3c000,$1060c000,$00000000,$00000000,
  40.     $00000000
  41.                                             ]),
  42.         $0001,0,NIL]:image
  43.     self.d[PREVMODNIB]:=d
  44.  
  45.     self.img[PLAYNIB]:=[0,0,$15,$d,1,
  46.         d:=copyListToChip([
  47.     $00000000,$00000000,$00000000,$01800000,
  48.     $01e00000,$01f80000,$01fe0000,$01f80000,
  49.     $01e00000,$01800000,$00000000,$00000000,
  50.     $00000000
  51.                                             ]),
  52.         $0001,0,NIL]:image
  53.     self.d[PLAYNIB]:=d
  54.  
  55.     self.img[SONGNUMNIB]:=[0,0,$15,$d,1,
  56.         d:=copyListToChip([
  57.     $00000000,$00000000,$00000000,$20d82000,
  58.     $23de2000,$2fdfa000,$3fdfe000,$2fdfa000,
  59.     $23de2000,$20d82000,$00000000,$00000000,
  60.     $00000000
  61.                                             ]),
  62.         $0001,0,NIL]:image
  63.     self.d[SONGNUMNIB]:=d
  64.  
  65.     self.img[NEXTMODNIB]:=[0,0,$15,$d,1,
  66.         d:=copyListToChip([
  67.     $00000000,$00000000,$00000000,$18304000,
  68.     $1e3c4000,$1fbf4000,$1fffc000,$1fbf4000,
  69.     $1e3c4000,$18304000,$00000000,$00000000,
  70.     $00000000
  71.                                             ]),
  72.         $0001,0,NIL]:image
  73.     self.d[NEXTMODNIB]:=d
  74.  
  75.     self.img[STOPNIB]:=[0,0,$15,$d,1,
  76.         d:=copyListToChip([
  77.     $00000000,$00000000,$00000000,$03fe0000,
  78.     $03fe0000,$03fe0000,$03fe0000,$03fe0000,
  79.     $03fe0000,$03fe0000,$00000000,$00000000,
  80.     $00000000
  81.                                             ]),
  82.         $0001,0,NIL]:image
  83.     self.d[STOPNIB]:=d
  84.  
  85.     self.img[EJECTNIB]:=[0,0,$15,$d,1,
  86.         d:=copyListToChip([
  87.     $00000000,$00000000,$00000000,$00200000,
  88.     $00700000,$00f80000,$01fc0000,$03fe0000,
  89.     $00000000,$03fe0000,$00000000,$00000000,
  90.     $00000000
  91.                                             ]),
  92.         $0001,0,NIL]:image
  93.     self.d[EJECTNIB]:=d
  94.  
  95.     self.img[ADDNIB]:=[0,0,$14,$d,1,
  96.         d:=copyListToChip([
  97.     $00000000,$00000000,$00000000,$00600000,$00600000,$03fc0000,
  98.     $03fc0000,$00600000,$00600000,$00000000,$00000000,$00000000,
  99.     $00000000]),
  100.         $0001,0,NIL]:image
  101.     self.d[ADDNIB]:=d
  102.  
  103.     self.img[DELNIB]:=[0,0,$14,$d,1,
  104.         d:=copyListToChip([
  105.     $00000000,$00000000,$00000000,$00000000,$00000000,$03fc0000,
  106.     $03fc0000,$00000000,$00000000,$00000000,$00000000,$00000000,
  107.     $00000000]),
  108.         $0001,0,NIL]:image
  109.     self.d[DELNIB]:=d
  110.  
  111.     self.img[UPNIB]:=[0,0,$15,$d,1,
  112.         d:=copyListToChip([
  113.     $00000000,$00000000,$00000000,$00600000,$00f00000,$01f80000,
  114.     $00600000,$00600000,$00600000,$00600000,$00600000,$00000000,
  115.     $00000000]),
  116.         $0001,0,NIL]:image
  117.     self.d[UPNIB]:=d
  118.  
  119.     self.img[DOWNNIB]:=[0,0,$15,$d,1,
  120.         d:=copyListToChip([
  121.     $00000000,$00000000,$00600000,$00600000,$00600000,$00600000,
  122.     $00600000,$01f80000,$00f00000,$00600000,$00000000,$00000000,
  123.     $00000000]),
  124.         $0001,0,NIL]:image
  125.     self.d[DOWNNIB]:=d
  126.  
  127.     self.img[FIRSTNIB]:=[0,0,$15,$d,1,
  128.         d:=copyListToChip([
  129.     $00000000,$00000000,$0fff0000,$00600000,$00f00000,$01f80000,
  130.     $00600000,$00600000,$00600000,$00600000,$00600000,$00000000,
  131.     $00000000]),
  132.         $0001,0,NIL]:image
  133.     self.d[FIRSTNIB]:=d
  134.  
  135.     self.img[LASTNIB]:=[0,0,$15,$d,1,
  136.         d:=copyListToChip([
  137.     $00000000,$00000000,$00600000,$00600000,$00600000,$00600000,
  138.     $00600000,$01f80000,$00f00000,$00600000,$0fff0000,$00000000,
  139.     $00000000]),
  140.         $0001,0,NIL]:image
  141.     self.d[LASTNIB]:=d
  142.  
  143.     self.img[SHUFFLENIB]:=[0,0,$15,$d,1,
  144.         d:=copyListToChip([
  145.     $00000000,$00000000,$00000000,$0c800000,$12800000,$0ce48000,
  146.     $02948000,$12948000,$0c938000,$00000000,$00000000,$00000000,
  147.     $00000000]),
  148.         $0001,0,NIL]:image
  149.     self.d[SHUFFLENIB]:=d
  150.  
  151.     FOR i:=0 TO NUMNIBS-1
  152.       NEW nib.button([NIB_IMAGE, self.img[i], NB_TOGGLE, FALSE, NB_FRAMETYPE, BATT_THINFRAME, 
  153.             NB_RESIZEX, TRUE, NIL])
  154.         self.nib[i]:=nib
  155.     ENDFOR
  156.  
  157. EXCEPT DO
  158.     IF utilitybase THEN CloseLibrary(utilitybase)
  159.     SELECT exception
  160.         CASE ERR_OPENUTIL
  161.             errorreq('Couldn''t open ''utility.library'' v37.','mainimages.mainimages')
  162.     ENDSELECT
  163. ENDPROC
  164.  
  165. PROC end() OF mainimages
  166. DEF i,nib:PTR TO newimagebutton
  167.     FOR i:=0 TO NUMNIBS-1
  168.         nib:=self.nib[i]
  169.         END nib
  170.         Dispose(self.d[i])
  171.     ENDFOR
  172.     DisposeLink(self.d)
  173.     DisposeLink(self.img)
  174.     DisposeLink(self.nib)
  175. ENDPROC
  176.  
  177. PROC enabled(num) OF mainimages
  178. DEF value,check,nib:PTR TO newimagebutton
  179.     nib:=self.nib[num]
  180.     value,check:=nib.get(NB_DISABLED)
  181. ENDPROC Not(value)
  182.  
  183. /*********************************************************/
  184.  
  185. OBJECT filereqimage
  186.     nib:PTR TO newimagebutton,img,d
  187. ENDOBJECT
  188.  
  189. PROC filereqimage() OF filereqimage HANDLE
  190. DEF d,nib:PTR TO newimagebutton
  191.     utilitybase:=0
  192.     IF (utilitybase:=OpenLibrary('utility.library',37))=0 THEN Raise(ERR_OPENUTIL)
  193.  
  194.     self.img:=[0,0,$f,$f,1,
  195.         d:=copyListToChip([
  196.     $00000000,$00e00110,$3f083f08,$3ff830f8,
  197.     $30083008,$30083008,$3ff80000,$00000000
  198.                                             ]),
  199.         $0001,0,NIL]:image
  200.     self.d:=d
  201.  
  202.   NEW self.nib.button([NIB_IMAGE, self.img, NB_TOGGLE, FALSE, NB_FRAMETYPE, BATT_THINFRAME,
  203.         NIL])
  204.  
  205. EXCEPT DO
  206.     IF utilitybase THEN CloseLibrary(utilitybase)
  207.     SELECT exception
  208.         CASE ERR_OPENUTIL
  209.             errorreq('Couldn''t open ''utility.library'' v37.','filereqimage.filereqimage')
  210.     ENDSELECT
  211. ENDPROC
  212.  
  213. PROC end() OF filereqimage
  214.     END self.nib
  215.     Dispose(self.d)
  216. ENDPROC
  217.  
  218. /*********************************************************/
  219.  
  220. PROC enablenibgads(enablelist:PTR TO LONG)
  221. DEF item=0,nib:PTR TO newimagebutton
  222.     REPEAT
  223.         nib:=enablelist[item]
  224.         nib.set(NB_DISABLED,Not(enablelist[item+1]))
  225.         item:=item+2
  226.     UNTIL enablelist[item]=0
  227. ENDPROC
  228.