View Single Post
Sponsorlu Bağlantılar
Zoque.Forum
Advertisement
Old 16.07.2005   #1 (permalink)
Scud
 
Scud's Avatar
 
Üyelik Tarihi: 25.08.2001
Yer: Antalya
Yaş: 26
Mesaj: 970
WinampClone [HTML MEdia player]

aşağıdaki kodları winampclone.hta olarak kaydedin... kodlar arasındaki

Kod:
yol="d:\\mp3";
satırını kendi mp3 yolu ile değiştirin. \ işareti yerine \\ kullanın...

Kod:
<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=JavaScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META NAME="AUTHOR" Content="Deniz DURSUN [info@theturkhost.net]">
<TITLE>([ WinampClone By Scud© 2005])</TITLE>
    <HTA:APPLICATION ID="winampclone"
     APPLICATIONNAME="WinampClone"
     BORDER="thin"
     BORDERSTYLE="normal"
     CAPTION="yes"
     ICON=""
     MAXIMIZEBUTTON="no"
     MINIMIZEBUTTON="yes"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="yes"
     SYSMENU="yes"
     VERSION="1.0"
     WINDOWSTATE="normal"/>
<style>
.plon{
font-family:Verdana;
font-size:9px;
background-color:lightgreen;
color:black;
}
.ploff{
font-family:Verdana;
font-size:9px;
background-color:darkgreen;
color:white;
}
</style>
<script LANGUAGE=JavaScript>
/*
Copyright Scud © 2005
Deniz Dursun
info@theturkhost.net
www.TheTurkHost.net
*/
yol="d:\\mp3";  //Buraya mp3 klasör ve dosyalarınızın olduğu ana klasörü yazın
fso = new ActiveXObject("Scripting.FileSystemObject");
j=0;
subs=0;
folderlist=Array();
k=0;
first=0;
function folder(fso,yol,j,k,folderlist,first){
	i=0;
	esubs=folderlist.length;
	f = fso.GetFolder(yol);
	fc = new Enumerator(f.SubFolders);
	do{
		if(fc.item()!=undefined){
			folderlist[j]=fc.item();
			j++;
			CMS=fc.item();
			fc.moveNext();
			i++;
		}
		if(fc.atEnd()){break;}
	}while(fc.atEnd);
	if(first>0){k++;}else{first++;}
	if(k!=j){
		folder(fso,folderlist[k],j,k,folderlist,first);
	}else{return folderlist;}
}
function files(fso,folderlist){
  filelist=Array();
  var fso, f, fc;
  s=0;
	for(i=0;i<folderlist.length;i++){
		f = fso.GetFolder(folderlist[i]);
		fc = new Enumerator(f.files);
		for (; !fc.atEnd(); fc.moveNext()){
			if(fc.item()!=undefined){
				CMS=new String(fc.item());
				cmsv=CMS.split("\\");
				cmsv=new String(cmsv[cmsv.length-1]);
				cmsv=cmsv.toLowerCase();
				cmsv=cmsv.slice(0,-4);
				filelist[s]=[cmsv,CMS];
				s++;
			}
		}
	}
return filelist;
}
function dlac(){
	var dar=Array(pl.outerHTML,"test");
	var mypen=window.showModalDialog("jump.hta",dar,"dialogWidth=406px;dialogHeight=394px;center=yes");
	if(mypen!=null){
		cal(mypen);
	}
}
</script>
</HEAD>
<BODY onload="s(yol);window.setInterval('kontrol(mp.PlayState)',1)" onkeydown="if(event.keyCode==74){dlac();}" leftmargin=0 topmargin=0 scroll="no">
<script LANGUAGE=JavaScript>
function s(yol){
	folder(fso,yol,j,k,folderlist,first);
	files(fso,folderlist);
	filelist.sort();
	for(l=0;l<filelist.length;l++){
		var myop=document.createElement("OPTION");
		myop.value=filelist[l][1];
		myop.text=filelist[l][0];
		pl.add(myop);
	}
	pl.selectedIndex=0;
	pl.focus();
	pl.style.visibility="hidden";
window.resizeTo(408,100);
window.moveTo((screen.availWidth-404)/2,(screen.availHeight-100)/4);

}
function cal(yol){
	mp.FileName=yol;
	mp.Play();
	for(l=0;l<pl.length;l++){
		if(pl.options[l].value==yol){
			pl.selectedIndex=l;//alert(pl.options[l].value+"\n"+yol);
		}
	}
}
function playlist(){
	if(pl.style.visibility!="hidden"){
		pl.style.visibility="hidden";
		window.resizeBy(0,-328);
		button1.className="ploff";
	} else {
		pl.style.visibility="visible";
		window.resizeBy(0,328);
		button1.className="plon";
	}
}
function kontrol(state){
	if(state==2){
		if(Math.round(mp.CurrentPosition)!=Math.round(mp.Duration)){
		} else {
			if(!shuffle.checked){
				pl.selectedIndex++;
			} else {
				pl.selectedIndex=Math.round(Math.random()*pl.length);
			}
		cal(pl.options[pl.selectedIndex].value);
		}
	}
}
</script>
<table border=0 cellspacing=0 cellpadding=0>
	<tr>
		<td>
			<OBJECT id=mp style="width:400px;HEIGHT: 46px;" classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95 VIEWASTEXT><PARAM NAME="AudioStream" VALUE="-1"><PARAM NAME="AutoSize" VALUE="-1"><PARAM NAME="AutoStart" VALUE="-1"><PARAM NAME="AnimationAtStart" VALUE="-1"><PARAM NAME="AllowScan" VALUE="-1"><PARAM NAME="AllowChangeDisplaySize" VALUE="-1"><PARAM NAME="AutoRewind" VALUE="0"><PARAM NAME="Balance" VALUE="-50"><PARAM NAME="BaseURL" VALUE=""><PARAM NAME="BufferingTime" VALUE="5"><PARAM NAME="CaptioningID" VALUE=""><PARAM NAME="ClickToPlay" VALUE="-1"><PARAM NAME="CursorType" VALUE="0"><PARAM NAME="CurrentPosition" VALUE="-1"><PARAM NAME="CurrentMarker" VALUE="0"><PARAM NAME="DefaultFrame" VALUE=""><PARAM NAME="DisplayBackColor" VALUE="0"><PARAM NAME="DisplayForeColor" VALUE="16777215"><PARAM NAME="DisplayMode" VALUE="0"><PARAM NAME="DisplaySize" VALUE="0"><PARAM NAME="Enabled" VALUE="-1"><PARAM NAME="EnableContextMenu" VALUE="0"><PARAM NAME="EnablePositionControls" VALUE="-1"><PARAM NAME="EnableFullScreenControls" VALUE="0"><PARAM NAME="EnableTracker" VALUE="-1"><PARAM NAME="Filename" VALUE=""><PARAM NAME="InvokeURLs" VALUE="-1"><PARAM NAME="Language" VALUE="-1"><PARAM NAME="Mute" VALUE="0"><PARAM NAME="PlayCount" VALUE="1"><PARAM NAME="PreviewMode" VALUE="0"><PARAM NAME="Rate" VALUE="1"><PARAM NAME="SAMILang" VALUE=""><PARAM NAME="SAMIStyle" VALUE=""><PARAM NAME="SAMIFileName" VALUE=""><PARAM NAME="SelectionStart" VALUE="-1"><PARAM NAME="SelectionEnd" VALUE="-1"><PARAM NAME="SendOpenStateChangeEvents" VALUE="-1"><PARAM NAME="SendWarningEvents" VALUE="-1"><PARAM NAME="SendErrorEvents" VALUE="-1"><PARAM NAME="SendKeyboardEvents" VALUE="0"><PARAM NAME="SendMouseClickEvents" VALUE="0"><PARAM NAME="SendMouseMoveEvents" VALUE="0"><PARAM NAME="SendPlayStateChangeEvents" VALUE="-1"><PARAM NAME="ShowCaptioning" VALUE="0"><PARAM NAME="ShowControls" VALUE="-1"><PARAM NAME="ShowAudioControls" VALUE="-1"><PARAM NAME="ShowDisplay" VALUE="0"><PARAM NAME="ShowGotoBar" VALUE="0"><PARAM NAME="ShowPositionControls" VALUE="0"><PARAM NAME="ShowStatusBar" VALUE="0"><PARAM NAME="ShowTracker" VALUE="-1"><PARAM NAME="TransparentAtStart" VALUE="0"><PARAM NAME="VideoBorderWidth" VALUE="0"><PARAM NAME="VideoBorderColor" VALUE="0"><PARAM NAME="VideoBorder3D" VALUE="0"><PARAM NAME="Volume" VALUE="0"><PARAM NAME="WindowlessVideo" VALUE="0"></OBJECT>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border=0 cellspacing=0 cellpadding=0>
				<tr>
					<td>
						Karışık: <INPUT type="checkbox" id=shuffle>
					</td>
					<td align=center>
						Press "J" for Jump menu
					</td>
					<td align=right>
						<INPUT onclick="playlist()" type="button" value="Play List" id=button1 class="ploff">
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<SELECT size=20 id="pl" style="WIDTH: 400px" onkeypress="if(event.keyCode==13){cal(pl.options[pl.selectedIndex].value);}" ondblclick="cal(pl.options[pl.selectedIndex].value)"></SELECT>
		</td>
	</tr>
</table>
</BODY>
</HTML>


aşağıdaki kodları ise jump.hta olarak kaydedin...

Kod:
<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=JavaScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META NAME="AUTHOR" Content="Microsoft Visual Studio 6.0">
<TITLE>-------------<([ Jump menu for WinampClone ])>-------------</TITLE>
<script LANGUAGE=JavaScript>
<!--
function testkey(mkey){
	switch(mkey){
		case 13:
			cal();break;
		case 38:
			if(pl.selectedIndex!=0) pl.selectedIndex--;break;
		case 40:
			if(pl.selectedIndex!=pl.length-1) pl.selectedIndex++;break;
		case 8:
		case 37:
		case 39:
		case 46:
			pls=ply.cloneNode(1);
			pl.outerHTML=pls.outerHTML;
			kontrol(plt.value);
			break;
		default:
			pl.focus();break;
	}
}
function kontrol(aranan){
	boyut=pl.length;
	j=0;
	silinecekler=Array();
		for(i=0;i<boyut;i++){
			pt=pl.options[i].text;
			mt=new String(pt);
			pltv=new String(plt.value);
			rx=new RegExp(aranan,"i");
			c=mt.search(rx);
			if(c<0){
				silinecekler[j]=i;
				j++;
			}
		}
	k=0;
	sboyut=silinecekler.length;
	for(i=0;i<sboyut;i++){
		pl.options.remove(silinecekler[i]-k);
		k++;
	}
	pl.selectedIndex=0;
}
//-->
</script>
</HEAD>
<BODY onload="s()" scroll="no">
<script LANGUAGE=JavaScript>
<!--
function testself(){
	return typeof(dialogArguments)!="undefined"?true:false;
}
function s(){
	if(testself()){
		pl.outerHTML=dialogArguments[0];
		pl.style.visibility="visible";
		ply=pl.cloneNode(1);
		pl.selectedIndex=0;
		plt.focus();
	} else {
		location.replace("deniz.hta");
	}
}
function cal(){
	window.returnValue=pl.options[pl.selectedIndex].value;
	window.close();
}
//-->
</script>
<div style="display:expression(!testself()?'none':'')">
<input id=plt style="WIDTH: 400px" onchange="kontrol(this.value)" onkeyup="testkey(event.keyCode)" onblur="if(document.activeElement.id=='pl'){plt.focus();}">
<SELECT size=20 id="pl" style="WIDTH: 400px" onkeypress="if(event.keyCode==13){cal();}" ondblclick="cal()">
</SELECT>
</div>
</BODY>
</HTML>



Askerde vakit geçirmek için yapmış olduğum bi çalışmadır. Görüntü olarak pek içaçıcı olduğu söylenemez. Fakat kodlar arasında dosya/klasör listelemeden, media player kontrollerine, string fonksiyonlarından dizi fonksiyonlarına kadar bir çok örneği bulabilirsiniz...

projenin zipli hali için tıklayın
__________________
Take me back to my boat on the river
and I won't cry out any more
Scud şu an çevrimdışı   Mesajdan alıntı yaparak yeni bir cevap ekleyin