Remstart // --------------------------------------------- MediX DB Player v1.00 (betatest release) Programmed by Volker Stepprath 13-12-2004 This source ist FREEWARE (Open Source) --------------------------------------------- This mediaplayer was only programmed to learn about DarkBASIC Pro and its use of mediafiles Replays 32! mediaformats eg. DVD/SVCD/DAT... --------------------------------------------- Sorry: only german remarks !!! --------------------------------------------- Variablen-Information (privat) xNumb(0)=Aktuelle Dateinummer xNumb(1)=Gesammte Dateianzahl --------------------------------------------- For more free codes/games please visit my preview homepage: http://home.arcor.de/testaware/index.htm --------------------------------------------- // Remend xCL$=cl$() : Rem * Wurde Medix über Bios oder als Defplayer aufgerufen? disable escapekey dim xMD$(1) xMD$(0)="MediX DB Player v1.00" set window title xMD$(0)+" (c) by Volker Stepprath" Rem * Globale variablen definieren dim xEntry$(1000,5) dim xExtension$(100,1) dim xPath$(1) dim xFile$(1) dim xTime(1) dim xNumb(1) dim xMode(1) dim xStatus(1) dim xPanel$(10) dim xAttributes$(10,1) dim xZone(100,3) dim xMedix$(2) dim xMess$(1) dim x169(1) dim xColor(1) dim xID3TagGenre$(130) dim xVisulize(1) dim xVisulizeName$(100) xColor(0)=rgb(224,223,227) : Rem * Hintergrundfarbe [Standart] _ClrScrn() load image "Data\Rewind.bmp",1,1 load image "Data\Forward.bmp",2,1 load image "Data\Play.bmp",3,1 load image "Data\Pause.bmp",4,1 load image "Data\Stop.bmp",5,1 Load image "Data\Updir.bmp",6,1 load image "Data\RewindOff.bmp",7,1 load image "Data\ForwardOff.bmp",8,1 load image "Data\PlayOff.bmp",9,1 load image "Data\PauseOff.bmp",10,1 load image "Data\StopOff.bmp",11,1 Load image "Data\UpdirOff.bmp",12,1 load image "Data\Zone.bmp",13,1 load image "Data\Ordner.bmp",20,1 load image "Data\Audio.bmp",21,1 load image "Data\Film.bmp",22,1 load image "Data\Bild.bmp",23,1 load image "Data\Laufwerk.bmp",24,1 load image "Data\Medix.png",99,1 xMedix$(0)="C:\My Medix\MediX Data" : Rem * Default Pfad Intern xMedix$(1)=xMedix$(0)+"\MediX.prefs" : Rem * Medix Konfigurationsdatei xPath$(0)=get dir$() : Rem * Aktueller Medix Pfad xStatus(0)=4 : Rem * Stop [Initialisierung] _InstallVisulize() _Install() Rem * Falls Kommando übergeben dann Direktstart if xCL$<>"" a$=xCL$ a=len(a$) a$=left$(a$,a-1) : a=len(a$) a$=right$(a$,a-1) : a=len(a$) for i=1 to a if mid$(a$,i)="\" then b=i next i xPath$(0)=left$(a$,b) a$=right$(a$,a-b) _ReadDir(xPath$(0)) a=xNumb(1) for i=0 to a b$=xEntry$(i,0) if b$=a$ xNumb(0)=i exit endif next i _Select() OK=_Play() else if _LastDir()=0 then _ReadDir(xPath$(0)) endif xMedix$(2)=xPath$(0) : Rem * Pfad für MediX.prefs _Panel() FUNCTION _InstallVisulize Rem * Installierung der Visulizer, diese müssen sich im vogegebenen Rem * Verzeichnis befinden da ansonsten keine Visuallisierung, ähm, ja! a$=xPath$(0)+"\Visulize\" if path exist(a$)<1 a$="C:\My Medix\MediX Data\Visulize\" if path exist(a$)<1 then exitfunction endif cd a$ Find First Repeat FileType=Get File Type() If FileType=0 xVisulizeName$(i)=a$+Get File Name$() inc i endif if i>99 then exit Find Next Until Get File Type()=-1 xVisulize(1)=i-1 ENDFUNCTION FUNCTION _Install _ClrScrn() set text font "Arial" set text size 14 Rem * Storyboard _WB(20,19,248,100,"Fileinfo") _WB(20,120,248,240,"Attributes") _WB(20,260,248,312,"Panel") for i=0 to 5 paste image 7+i,24+i*38,270,1 next i _GR(266,18,622,277) _G(411,283,477,312,0) Rem * Installiere Panel (Zonen) restore L_Schalter for i=0 to 5 Rem * Zonentext read a$ : xPanel$(i)=a$ Rem * Zonendeklaration xZone(i,0)=24+i*38 : Rem * X xZone(i,1)=24+i*38+32 : Rem * W xZone(i,2)=270 : Rem * Y xZone(i,3)=270+32 : Rem * H Rem * Zonenschalter paste image i+7,xZone(i,0),xZone(i,2),1 next i set text size 12 set text to bold x=266 : y=283 : a=73 : h=14 for p=0 to 1 for i=0 to 3 read a$ : xPanel$(6+i)=a$ if i=2 then x=332 Rem * Zonen-Nummer z=6+i+p*4 Rem * Zonendeklaration xZone(z,0)=x+i*a : Rem * X xZone(z,1)=x+i*a+a-2 : Rem * W xZone(z,2)=y : Rem * Y xZone(z,3)=y+h : Rem * H paste image 13,x+i*a,y _G(x+i*a,y,x+i*a+a-2,y+h,0) b=x+i*a+a/2-text width(a$)/2 ink rgb(255,255,255),0 : text b+1,y+2,a$ ink rgb(80,80,80),0 : text b,y+1,a$ next i x=266 inc y,h+1 next p set text to normal set text size 14 Rem * Erweiterungen für Erkennung installieren restore L_Extension a=0 do read a$ : if a$="" then exit if len(a$)=1 then b$=a$ : read a$ xExtension$(a,0)=b$ : Rem * Modus 0/1/2 xExtension$(a,1)=a$ : Rem * Erweiterung inc a loop _MEDIX() Rem * MP3 Tag Informationen für Genre installieren if xStatus(0)=4 restore L_ID3TagGenre a=0 do read a$ if a$="" then exit xID3TagGenre$(a)=a$ inc a loop endif L_Schalter: Rem * Schalterbezeichnungen data "Rewind","Forward","Play","Pause","Stop","Updir" data "FULL","CAPTURE","LASTDIR","EXTPLAY" data "16:9","VISULIZE","INFO","EXIT" L_Extension: Rem * Erkennung per Suffix data "0",".MP3",".WMA",".WAV",".WAVE",".MID",".MIDI",".AIF",".AIFF",".SND",".AU",".SGT",".MPA",".MP2" data "1",".MPG",".MPEG",".MJPG",".MJPEG",".AVI",".WMV",".GIF",".MOV",".QT",".DAT",".ASF",".VOB" data "2",".JPG",".JPEG",".BMP",".TGA",".DDS",".DIB",".PNG" data "" L_ID3TagGenre: Rem * ID3Tag Genre Info (127 Items) data "Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age" data "Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska" data "Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion" data "Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","AlternRock" data "Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic" data "Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy" data "Cult","Gangsta","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave" data "Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro" data "Musical","Rock & Roll","Hard Rock","Folk","Folk-Rock","National Folk","Swing","Fast Fusion","Bebob" data "Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock" data "Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson" data "Opera","Chamber Music","Sonata","Symphony","Booty Brass","Primus","Porn Groove","Satire","Slow Jam" data "Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhytmic Soul","Freestyle","Duet","Punk Rock" data "Drum Solo","Acapella","Euro-House","Dance Hall","Unknown" data "" ENDFUNCTION FUNCTION _ReadDir(a$) a=len(a$) if mid$(a$,a)<>"\" then a$=a$+"\" if path exist(a$)<1 then exitfunction cd a$ xPath$(0)=a$ Find First Repeat FileType=Get File Type() FullName$=Get File Name$() If FileType=0 for i=0 to 100 a$=xExtension$(i,1) if a$="" then exit b=len(a$) : b$=upper$(right$(FullName$,b)) if a$=b$ xEntry$(Count,0)=FullName$ xEntry$(Count,1)=xExtension$(i,0) xEntry$(Count,2)=xPath$(0) xEntry$(Count,3)=_FmtDate(get file date$(),"/") s=file size(FullName$) fs=fs+s/1024 xEntry$(Count,4)=_FmtSize(s) xEntry$(Count,5)=right$(a$,b-1) inc Count exit endif next i else if mid$(FullName$,1)<>"." xEntry$(Count,0)=FullName$+"\" xEntry$(Count,1)="-1" xEntry$(Count,2)=xPath$(0) xEntry$(Count,3)=_FmtDate(get file date$(),"-") xEntry$(Count,4)="Directory" inc Count endif endif if Count>999 then exit Find Next Until Get File Type()=-1 xNumb(0)=0 : _Select() : Rem * Erste Mediendatei (default=0) dec Count Rem * Medientyp-Anzahl ermitteln a=0 : b=0 : c=0 : d=0 for i=0 to Count a$=xEntry$(i,1) n=val(a$) if n=-1 then inc a if n=0 then inc b if n=1 then inc c if n=2 then inc d next i Rem * Anzahl der Visulaisierungen formatieren if xVisulize(1)>0 e=xVisulize(1)+1 e$=str$(e) else e$="no found" endif xAttributes$(0,0)="Total:" : xAttributes$(0,1)=str$(Count+1) xAttributes$(1,0)="Folder:" : xAttributes$(1,1)=str$(a) xAttributes$(2,0)="Music:" : xAttributes$(2,1)=str$(b) xAttributes$(3,0)="Video:" : xAttributes$(3,1)=str$(c) xAttributes$(4,0)="Picture:" : xAttributes$(4,1)=str$(d) xAttributes$(5,0)="" : xAttributes$(5,1)="" _Attributes() xMess$(0)=xMD$(0)+" [Total:"+str$(Count+1)+" - Dir:"+str$(a)+" - Music:"+str$(b)+" - Video:"+str$(c)+" - Picture:"+str$(d)+" - Size:"+_FmtSize(fs)+"Mb - Visulize:"+e$+"]" _Message() xNumb(1)=Count ENDFUNCTION FUNCTION _Panel Rem * Sagen wir mal das sich hier die Hauptschaltzentrale befindet Rem * Hier werden alle Ereignisse (Maus/Tastatur) ausgewertet do repeat z=_Zone(z) Rem * Zeitausgabe wenn Play if xStatus(0)=2 then z=_Time() Rem * Test ob Tastatur betätigt if scancode()>0 z=_KeyPush() if z>-1 and z<14 then exit endif sync until mouseclick()<>0 if z>-1 t=timer() select z case 0 : _Rewind() : endcase case 1 : _Forward() : endcase case 2 : OK=_Play() : endcase case 3 : _Pause() : endcase case 4 : _Stop() : endcase case 5 : _Updir() : endcase case 6 : _FullScrn() : endcase case 7 : _Capture() : endcase case 8 : OK=_LastDir() : endcase case 9 : _ExtPlay() : endcase case 10 : _16to9() : endcase case 11 if mouseclick()=2 dec xVisulize(0) : if xVisulize(0)<-1 then xVisulize(0)=xVisulize(1) else inc xVisulize(0) : if xVisulize(0)>xVisulize(1) then xVisulize(0)=-1 endif _Visulize() endcase case 12 : _Info() : endcase case 13 : _Exit() : endcase endselect _ClearMouse() Rem * Laufzeit ggf. aktualisieren if z>4 t=(timer()-t)/1000 xTime(0)=xTime(0)+t endif endif loop ENDFUNCTION FUNCTION _KeyPush a=scancode() select a case 203 : a= 0 : endcase : Rem * CSL = Rewind case 205 : a= 1 : endcase : Rem * CSR = Forward case 28 : a= 2 : endcase : Rem * RET = Play case 25 : a= 3 : endcase : Rem * P = Pause case 57 : a= 4 : endcase : Rem * SPC = Stop case 14 : a= 5 : endcase : Rem * BSP = Updir case 59 : a= 6 : endcase : Rem * F1 = Fullscreen case 60 : a= 7 : endcase : Rem * F2 = Capture case 61 : a= 8 : endcase : Rem * F3 = Lastdir case 62 : a= 9 : endcase : Rem * F4 = Extplay case 63 : a=10 : endcase : Rem * F5 = 16 zu 9 case 64 : a=11 : endcase : Rem * F6 = Visulize case 65 : a=12 : endcase : Rem * F7 = Info case 66 : a=13 : endcase : Rem * F8 = Exit case default : a=-1 : endcase endselect ENDFUNCTION a FUNCTION _Rewind() a=xStatus(0) b=325 repeat dec xNumb(0) : if xNumb(0)<0 then xNumb(0)=xNumb(1) _Select() if a=2 _Stop() if xEntry$(a,1)<>"-1" then s=_Play() exit else sleep b : if b>50 then dec b,50 endif until mouseclick()+scancode()=0 ENDFUNCTION FUNCTION _Forward() a=xStatus(0) b=325 repeat inc xNumb(0) : if xNumb(0)>xNumb(1) then xNumb(0)=0 _Select() if a=2 _Stop() if xEntry$(a,1)<>"-1" then s=_Play() exit else sleep b : if b>50 then dec b,50 endif until mouseclick()+scancode()=0 ENDFUNCTION FUNCTION _Play if xStatus(0)=4 for i=0 to 10 xAttributes$(i,0)="" : xAttributes$(i,1)="" next i ink xColor(0),0 : box 22,127,246,238 : ink 0,0 a=xNumb(0) xFile$(0)=xEntry$(a,0) m$=xEntry$(a,1) xMode(0)=val(m$) if xMode(0)=-1 _ReadDir(xPath$(0)+xFile$(0)) else xStatus(0)=2 if xMode(0)=0 then s=_LoadMUS() if xMode(0)=1 then s=_LoadMOV() if xMode(0)=2 then s=_LoadPIC() endif xTime(0)=0 : Rem * Zeit zurücksetzen endif if xStatus(0)=3 if xMode(0)=0 resume music 1 if xVisulize(0)>0 then resume animation 2 endif if xMode(0)=1 then resume animation 1 xStatus(0)=2 endif ENDFUNCTION s FUNCTION _Pause if xStatus(0)=2 or xStatus(0)=3 if xStatus(0)=2 paste image 7+xStatus(0),24+xStatus(0)*38,270,1 if xMode(0)=0 pause music 1 if xVisulize(0)>0 then pause animation 2 endif if xMode(0)=1 then pause animation 1 xStatus(0)=3 else s=_Play() endif endif ENDFUNCTION FUNCTION _Stop if xStatus(0)=2 or xStatus(0)=3 paste image 7+xStatus(0),24+xStatus(0)*38,270,1 if xMode(0)=0 then stop music 1 : delete music 1 : _MEDIX() if xMode(0)=1 then stop animation 1 : delete animation 1 if xMode(0)=2 then delete sprite 1 sync xStatus(0)=4 endif ENDFUNCTION FUNCTION _Updir cd "..\" xPath$(0)=get dir$() xNumb(0)=0 xTime(0)=0 a$=xPath$(0) _ReadDir(xPath$(0)) if xPath$(0)=a$ Count=xNumb(1)+1 for i=Count to Count+7 xEntry$(i,0)="\" xEntry$(i,1)="-1" xEntry$(i,2)=chr$(65+i-Count)+":" xEntry$(i,3)=get Date$() xEntry$(i,4)="Device" next i xNumb(1)=xNumb(1)+7 endif ENDFUNCTION FUNCTION _16to9 z=10 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) if xStatus(0)=2 and xMode(0)=1 x=268 y=20 if x169(0)=0 x169(0)=1 place animation 1,x+1,y+51,x+352,y+205 : sync ink 0,0 : box 269,21,620,275 : sync else x169(0)=0 place animation 1,x+1,y+1,x+352,y+255 : sync ink 0,0 : box 269,21,620,275 : sync endif endif _ClearMouse() _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION FUNCTION _Visulize z=11 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) if xVisulize(1)>0 if xStatus(0)=2 and xMode(0)=0 if animation exist(2)<>0 stop animation 2 delete animation 2 endif a=xVisulize(0) if a>xVisulize(1) or a<0 xVisulize(0)=-1 _MEDIX() else ink rgb(255,255,255),0 : box 269,21,620,275 : sync load animation xVisulizeName$(a),2 x=animation width(2)/2 y=animation height(2)/2 play animation 2,444-x,148-y loop animation 2 endif endif Rem * Ausgabe der aktuellen Visulalierung (+1) s=text size() set text size 25 ink xColor(0),0 : box 414,286,474,308 a=xVisulize(0)+1 ink rgb(30,160,30),0 : center text 444,285,str$(a) set text size s Rem * Ausgabe der formatierten Visulaisierungsbezeichnung (Name) if xStatus(0)=4 and a>0 a$=xVisulizeName$(a-1) b=len(a$) for i=b to 1 step -1 if mid$(a$,i)="\" then exit next i a$=right$(a$,b-i) a$=left$(a$,len(a$)-4) ink rgb(0,200,190),0 : center text 444,260,a$ endif endif _ClearMouse() if xStatus(0)=4 and a>0 ink 0,0 : box 269,260,620,275 endif _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION FUNCTION _ExtPlay z=9 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) _Stop() sleep 250 execute file xFile$(0),xFile$(0),xPath$(0),1 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION FUNCTION _Info z=12 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) if xStatus(0)=4 _MEDIX() set text to bold restore L_Info do read a$ if a$="" then exit if a$="!" s=text size() set text size 12 a=0 a$="" b$=xExtension$(0,0) do c$=xExtension$(a,1) d$=xExtension$(a,0) if c$="" then exit c$=right$(c$,len(c$)-1) if d$<>b$ a$=right$(a$,len(a$)-1) ink 0,0 : center text 446,37+i*s,a$ ink rgb(255,255,255),0 : center text 445,36+i*s,a$ a$="" b$=d$ inc i endif a$=a$+","+c$ inc a loop a$=right$(a$,len(a$)-1) ink 0,0 : center text 446,37+i*s,a$ ink rgb(255,255,255),0 : center text 445,36+i*s,a$ set text size s read a$ inc i endif if a$="*" then a$="Default folder: "+xMedix$(0) ink 0,0 : center text 446,37+i*text size(),a$ ink rgb(255,255,255),0 : center text 445,36+i*text size(),a$ inc i loop set text to normal endif _ClearMouse() _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) L_Info: data "MediX Dark Basic Player v1.00" data "Coded (c) 2004 by Volker Stepprath" data " " data "Copy MediX to your DB folder (path of DBPro setup)" data "Use it to preview your downloaded media files" data " " data "Known replay formats:" data "!" data " " data "NEVER CLOSE ActiveVideo Window MEDIX CRASH - SORRY!" data "MPG2 (SVCD) files are hard to play, try EXTPLAY!" data "*" data " " data "Have fun... Volker" data "" ENDFUNCTION FUNCTION _FullScrn z=6 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) _ClearMouse() if xStatus(0)=2 and xMode(0)=1 if x169(0)=1 then a=50 place animation 1,0,a,640,340-a : sync set window layout 0,0,1 : sync maximize window : sync hide mouse ink 0,0 : box 0,0,640,340 suspend for key restore window : sync set window layout 1,1,1 : sync place animation 1,269,21+a,620,275-a : sync show mouse _Install() _Select() _Attributes() _Message() ink 0,0 : box 269,21,620,275 : sync endif _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION FUNCTION _Capture z=7 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) if xStatus(0)=2 then _Pause() : a=1 if file exist(xMedix$(0))=0 make directory xMedix$(0) endif x=268 y=20 get image 98,x,y,x+400+3*8,y+256+13*8,0 : sleep 50 a$=get date$()+get time$() b=len(a$) for i=1 to b b$=mid$(a$,i) if b$<>"/" and b$<>":" c$=c$+b$ endif next i a$=xMedix$(0)+"\MediX_Capture_"+c$+".BMP" save image a$,98 : sleep 50 delete image 98 s=text size() set text size 25 ink xColor(0),0 : box 414,286,474,308 ink rgb(160,30,30),0 : center text 444,285,"SHOT" set text size s sleep 250 if a=1 _Play() else ink xColor(0),0 : box 414,286,474,308 endif _ClearMouse() _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION FUNCTION _LastDir z=8 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) a$=xMedix$(1) if file exist(a$)<>0 open to read 1,a$ repeat read string 1,a$ b$="LASTDIR=" : b=len(b$) if left$(a$,b)=b$ b$=right$(a$,len(a$)-b) if path exist(b$) xMedix$(2)=b$ _ReadDir(b$) endif endif b$="VISULIZE=" : b=len(b$) if left$(a$,b)=b$ b$=right$(a$,len(a$)-b) xVisulize(0)=val(b$) endif until file end(1)<>0 close file 1 endif _ClearMouse() _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),0) ENDFUNCTION OK FUNCTION _Exit z=13 _G(xZone(z,0),xZone(z,2),xZone(z,1),xZone(z,3),1) _Stop() a$=xMedix$(0) b$=xMedix$(2)+"\" if a$<>b$ if file exist(a$)=0 then make directory a$ if file exist(xMedix$(1))=1 then delete file xMedix$(1) a=xVisulize(0) open to write 1,xMedix$(1) write string 1,"LASTDIR="+xPath$(0) write string 1,"VISULIZE="+str$(a) write string 1,"" write string 1,";This is the MediX DB Player configuration" write string 1,";Last modified: "+get date$()+" - "+get time$() write string 1,"" write string 1,";Have fun... Volker" close file 1 endif if animation exist(2)<>0 then delete animation 2 sleep 500 end ENDFUNCTION FUNCTION _Zone(a) x=mousex() : y=mousey() : z=-1 if y>xZone(0,2) and yxZone(0,0) and xxZone(6,2) and yxZone(6,0) and xxZone(i,0) and xxZone(i,2) and ya and z<6 Rem * Allte Schalter AUS ink xColor(0),0 : box xZone(0,0),xZone(0,3)-5,xZone(5,1),xZone(0,3)+8 for i=0 to 5 paste image 7+i,xZone(i,0),xZone(i,2),1 next i Rem * Play-/Pause Modus? if xStatus(0)=2 or xStatus(0)=3 then paste image 1+xStatus(0),24+xStatus(0)*38,270,1 Rem * Neuer Schalter AN + Schalterinfo if z>-1 paste image 1+z,xZone(z,0),xZone(z,2),1 if xStatus(0)=4 a$=xPanel$(z) if z=0 then x=xZone(0,0)+4 if z=5 then x=xZone(5,1)-4-text width(a$) if z>0 and z<5 then x=xZone(z,0)+16-text width(a$)/2 ink 0,0 : text x,xZone(0,3)-5,a$ endif endif endif ENDFUNCTION z FUNCTION _Time set text size 25 x=444 : y=281 t=timer() if xTime(0)=0 b=-1 else b=(timer()-t)/1000 endif repeat a=(timer()-t)/1000 if a<>b b=a a=xTime(0) m=a/60 : m$=str$(m) s=a-(m*60) : s$=str$(s) if m<10 then m$="0"+m$ if s<10 then s$="0"+s$ ink xColor(0),0 : box 414,286,474,308 ink rgb(117,117,121),0 : center text 444,286,m$+":"+s$ inc xTime(0) endif if xMode(0)=0 if music playing(1)=0 then _Stop() : exit endif If xMode(0)=1 if animation playing(1)=0 then _Stop() : exit endif z=_Zone(z) sync until mouseclick()+scancode()<>0 set text size 14 ink 0,0 ENDFUNCTION z FUNCTION _Select a=xNumb(0) t=text size() set text size 14 x=30 y=27 ts=text size() a$=xEntry$(a,0) m$=xEntry$(a,1) m=val(m$) b$=xEntry$(a,2) xFile$(0)=a$ xPath$(0)=b$ ink xColor(0),0 : box 22,26,246,98 Rem * Nur im _Stop Modus Icontype ausgeben if xStatus(0)=4 if a$="\" then m=3 box 22,127,246,238 paste image 21+m,111,156,1 endif ink 0,0 set text to bold text x,y,"Numb:" text x,y+ts,"Name:" text x,y+ts*2,"Path:" text x,y+ts*3,"Date:" text x,y+ts*4,"Size:" set text to normal x=x+38 w=244 text x,y,str$(a+1) if m<0 ink rgb(30,110,30),0 else ink 0,0 endif text x,y+ts,_FmtStr(a$,x,w) ink 0,0 text x,y+ts*2,_FmtStr(b$,x,w) text x,y+ts*3,xEntry$(a,3) text x,y+ts*4,xEntry$(a,4) set text size t ENDFUNCTION FUNCTION _Attributes if xAttributes$(0,0)="" then exitfunction w=244 y=130 u=text size()+1 Rem * X-Position für Attribute ermitteln set text to bold for i=0 to 10 a$=xAttributes$(i,0) if text width(a$)>x2 then x2=text width(a$) next i inc x2,34 set text to normal ink xColor(0),0 : box 22,127,246,238 ink 0,0 for i=0 to 10 if xAttributes$(i,0)="" then exit a$=xAttributes$(i,1) if i=0 if xAttributes$(0,0)<>"Title:" and xAttributes$(1,0)<>"Folder:" a$=left$(a$,len(a$)-4) endif endif set text to bold : text 30,y,xAttributes$(i,0) set text to normal : text x2,y,_FmtStr(a$,x2,w) inc y,u next i ENDFUNCTION FUNCTION _LoadMOV a$=xPath$(0)+xFile$(0) if file exist(a$)>0 x169(0)=0 x=268 y=20 load animation a$,1 w=animation width(1) h=animation height(1) a=xNumb(0) a$=xEntry$(a,5) if a$="MPG" or a$="MPEG" or a$="DAT" Rem * Videoformat liegt im VCD Modus (NTSC/PAL) vor if w=352 if h=240 xAttributes$(4,0)="Mode:" : xAttributes$(4,1)="VCD Ntsc (29.970 Kb/s)" endif if h=288 xAttributes$(4,0)="Mode:" : xAttributes$(4,1)="VCD Pal (25.000 Kb/s)" endif endif Rem * Videoformat liegt im SVCD Modus (NTSC/PAL) vor, dann externer Player aktivieren if w=480 if h=480 xAttributes$(4,0)="Mode:" : xAttributes$(4,1)="SVCD Ntsc (29.970 Kb/s)" endif if h=576 xAttributes$(4,0)="Mode:" : xAttributes$(4,1)="SVCD Pal (25.000 Kb/s)" endif endif endif xAttributes$(0,0)="Video:" : xAttributes$(0,1)=xFile$(0) xAttributes$(1,0)="Width:" : xAttributes$(1,1)=str$(animation width(1)) xAttributes$(2,0)="Heigth:" : xAttributes$(2,1)=str$(animation height(1)) xAttributes$(3,0)="Type:" : xAttributes$(3,1)=xEntry$(a,5) _Attributes() play animation 1,x+1,y+1,x+352,y+255 else s=-1 endif ENDFUNCTION s FUNCTION _LoadPIC a$=xPath$(0)+xFile$(0) if file exist(a$) x=268 y=20 load bitmap a$,1 w=bitmap width(1) h=bitmap height(1) d=bitmap depth(1) get image 100,0,0,w,h delete bitmap 1 if w>351 or h>254 sprite 1,x+1,y+1,100 set sprite 1,0,0 size sprite 1,351,254 else ink xColor(0),0 : box 269,21,620,275 x=x+176 y=y+128 sprite 1,x-w/2,y-h/2,100 set sprite 1,0,0 endif xAttributes$(0,0)="Picture:" : xAttributes$(0,1)=xFile$(0) xAttributes$(1,0)="Width:" : xAttributes$(1,1)=str$(w) xAttributes$(2,0)="Height:" : xAttributes$(2,1)=str$(h) xAttributes$(3,0)="Depth:" : xAttributes$(3,1)=str$(d) _Attributes() else s=-1 endif ENDFUNCTION s FUNCTION _LoadMUS a$=xPath$(0)+xFile$(0) b$=upper$(right$(a$,4)) Rem * Wenn MP3 Mediendatei dann ID3Tag Infos ermitteln if b$=".MP3" open to read 1,a$ l=file size(a$) if l>128 skip bytes 1,l-128 make memblock 1,128 for i=0 to 127 read byte 1,b write memblock byte 1,i,b next i a=0 for i=0 to 2 b=memblock byte(1,a) TAG$=TAG$+chr$(b) inc a next i if upper$(TAG$)="TAG" for i=0 to 29 b=memblock byte(1,a) if b>0 then TIT$=TIT$+chr$(b) inc a next i for i=0 to 29 b=memblock byte(1,a) if b>0 then ART$=ART$+chr$(b) inc a next i for i=0 to 29 b=memblock byte(1,a) if b>0 then ALB$=ALB$+chr$(b) inc a next i for i=0 to 3 b=memblock byte(1,a) if b>0 then YEA$=YEA$+chr$(b) inc a next i for i=0 to 28 b=memblock byte(1,a) if b>0 then COM$=COM$+chr$(b) inc a next i TRK=memblock byte(1,a) : inc a GEN=memblock byte(1,a) if GEN>126 b$=str$(GEN) else b$=xID3TagGenre$(GEN) endif xAttributes$(0,0)="Title:" : xAttributes$(0,1)=TIT$ xAttributes$(1,0)="Artist:" : xAttributes$(1,1)=ART$ xAttributes$(2,0)="Album:" : xAttributes$(2,1)=ALB$ xAttributes$(3,0)="Year:" : xAttributes$(3,1)=YEA$ xAttributes$(4,0)="Comment:" : xAttributes$(4,1)=COM$ xAttributes$(5,0)="Track:" : xAttributes$(5,1)=str$(TRK) xAttributes$(6,0)="Genre:" : xAttributes$(6,1)=b$ else xAttributes$(0,0)="No ID3Tag:" : xAttributes$(0,1)=xFile$(0) xAttributes$(1,0)="Type:" : xAttributes$(1,1)="MP3" endif delete memblock 1 endif close file 1 else xAttributes$(0,0)="Music:" : xAttributes$(0,1)=xFile$(0) xAttributes$(1,0)="Type:" : xAttributes$(1,1)=xEntry$(a,5) endif _Attributes() _Visulize() load music a$,1 play music 1 ENDFUNCTION s FUNCTION _MEDIX if animation exist(2)<>0 stop animation 2 delete animation 2 sync endif paste image 99,269,21 ENDFUNCTION FUNCTION _ClearMouse while mouseclick()<>0 : sync : endwhile while scancode()<>0 : sync : endwhile ENDFUNCTION FUNCTION _G(x,y,w,h,s) Rem * Zeichnet ein Gadget auf den Screen (s=0/1) für aus bzw. an if s=0 a=rgb(255,254,255) b=rgb(242,238,240) c=rgb(112,109,106) d=rgb(158,157,159) else a=rgb(112,109,106) b=rgb(158,157,159) c=rgb(255,254,255) d=rgb(242,238,240) endif ink a,0 : line x,y,w,y : line x,y,x,h ink b,0 : line x+1,y+1,w-1,y+1 :line x+1,y+1,x+1,h-1 ink c,0 : line x,h,w,h : line w,y,w,h ink d,0 : line x+1,h-1,w-1,h-1 : line w-1,h,w-1,y-1 ink 0,0 ENDFUNCTION FUNCTION _GR(x,y,w,h) _G(x,y,w,h,0) _G(x+2,y+2,w-2,h-2,1) ENDFUNCTION FUNCTION _ClrScrn() cls xColor(0) : sync ENDFUNCTION FUNCTION _WB(x,y,w,h,a$) ink rgb(239,239,239),0 line x+1,y+1,w+1,y+1 line w+1,y+1,w+1,h+1 line w+1,h+1,x+1,h+1 line x+1,h+1,x+1,y+1 ink rgb(170,170,170),0 line x,y,w,y line w,y,w,h line w,h,x,h line x,h,x,y a=text width(a$) ink xColor(0),0 box x+5,y,x+a+12,y+2 ink rgb(41,71,214),0 text x+10,y-7,a$ ink 0,0 ENDFUNCTION FUNCTION _Message ink xColor(0),0 : box 0,320,640,340 ink rgb(255,255,255),0 : center text 321,321,xMess$(0) ink rgb(117,117,121),0 : center text 320,320,xMess$(0) ENDFUNCTION FUNCTION _FmtSize(a) Rem * Formatiert Zahl in String mit Trennzeichen Rem * a=Zahl a$=str$(a) if a>999 a=len(a$) for i=a to 1 step -1 b$=mid$(a$,i)+b$ inc b if b=3 and i>1 b=0 b$="."+b$ endif next i a$=b$ endif ENDFUNCTION a$ FUNCTION _FmtDate(a$,b$) Rem * Formatiert Widows Datumstring in deutsche Datumanzeige Rem * a$ = Windos-Datum-String / b$=Trennzeichen c$=mid$(a$,9)+mid$(a$,10) d$=upper$(mid$(a$,5)+mid$(a$,6)+mid$(a$,7)) select d$ case "JAN" : d$="01" : endcase case "FEB" : d$="02" : endcase case "MAR" : d$="03" : endcase case "APR" : d$="04" : endcase case "MAY" : d$="05" : endcase case "JUN" : d$="06" : endcase case "JUL" : d$="07" : endcase case "AUG" : d$="08" : endcase case "SEP" : d$="09" : endcase case "OCT" : d$="10" : endcase case "NOV" : d$="11" : endcase case "DEC" : d$="12" : endcase endselect c$=c$+b$+d$ c$=c$+b$+right$(a$,4)+" " for i=12 to 19 c$=c$+mid$(a$,i) next i ENDFUNCTION c$ FUNCTION _FmtStr(a$,a,b) Rem * Formatiert Text auf Pixelanzahl Rem * a$=Text / a=Optional zu b (a+b) / b=Maximale Pixelanzahl if text width(a$)+a>b c=len(a$)/2-1 b$=left$(a$,c) c$=right$(a$,c) do if text width(b$+"..."+c$)+a<=b then exit dec c b$=left$(a$,c) c$=right$(a$,c) loop a$=b$+"..."+c$ endif ENDFUNCTION a$