Kod: Kodu kopyalamak için üzerine çift tıklayın!
#mp3player on
alias mp3 { $iif($dialog(mp3),dialog -x mp3,dialog -m mp3 mp3) }
alias mp3set { if (!$dialog(mp3set)) dialog -m mp3set mp3set }
alias -l plisthide { dialog -s mp3 $dialog(mp3).x $dialog(mp3).y 270 110 }
alias -l plistshow { dialog -s mp3 $dialog(mp3).x $dialog(mp3).y 270 417 }
alias mdxpath { return $shortfn($mircdir $+ mdx\) }
alias mdxdll { return $shortfn($mdxpath $+ mdx.dll) }
alias ctl { return $mdxpath $+ ctl_gen.mdx }
alias viewsdll { return $shortfn($mdxpath $+ views.mdx) }
alias bars { return $shortfn($mdxpath $+ bars.mdx) }
alias diags { return $shortfn($mdxpath $+ dialog.mdx) }
alias mdx {
if ($isid) return $dll($mdxdll,$1,$2-)
else dll $mdxdll $$1-
}
alias -l _mskin { return $readini($mircdir $+ %mp3.cfile,$1,$2) }
alias -l _lfile { return $shortfn($mircdir $+ %mp3.lfile) }
alias -l _mcount { return $ini($_lfile,list,0) }
dialog mp3 {
title " »» mp3 player <Kapatmak için ESC> "
size 202 82 135 209
option dbu
box "", 1, 1 0 131 57
box "", 21, 3 1 35 30,
edit "00:00", 2, 5 5 31 12,autohs center read
edit "", 3, 5 18 31 12,autohs left read
list 11, 3 33 127 10,size
button "9", 4, 3 46 10 8,autohs center
button "4", 5, 14 46 10 8,autohs center
button "<", 6, 25 46 10 8,autohs center
button ";", 7, 36 46 10 8,autohs center
button ":", 8, 47 46 10 8,autohs center
box "", 9, 39 1 92 15,
edit "", 10, 41 5 88 10,autohs left read
box "", 12, 39 14 92 17,
list 13, 41 19 36 10,size
button "X" 15, 86 46 10 8,autohs center
edit "", 16, 78 19 24 10,left read
text "" , 17, 103 19 26 10,autohs left read
button "-" 20, 64 46 10 8,autohs center
button "q" 23, 75 46 10 8,autohs center
button "P" 24, 120 46 10 8,autohs center
button "E" 25, 109 46 10 8,autohs center
icon 26, 0 59 135 6, $mircdirimages/plist2.jpg, 0, noborder center
;box "", 27, 1 61 132 150,
list 28, 3 66 128 140,autohs center
button "+", 29, 3 200 10 8,autohs center
button "-", 30, 15 200 10 8,autohs center
button "5", 31, 97 200 10 8,autohs center
button "C", 32, 121 200 10 8,autohs center
button "6", 33, 109 200 10 8,autohs center
}
on *:dialog:mp3:init:*: {
mdx SetMircVersion $version
mdx MarkDialog $dname
mdx SetControlMDX $dname 11,13 TrackBar trackbar noticks > $bars
mp3color
did -i mp3 11,13 1 params 0 0 100 1 0 0 1 13
did -f $dname 4
did -a $dname 3 $deltok($duration($int($calc($sound(%mp3).length / 1000)),3),1,58)
did -a $dname 10 %mp3.id
did -a $dname 16 $int($calc($vol(master) *100 / 65535)) $chr(37)
did -a $dname 17 $sound(%mp3).bitrate Kbps $sound(%mp3).sample KHz
if ($insong == $true) .timermp3 0 1 update
did -a $dname 20 $iif(%mp3.shuffle == on,-,y)
did -a $dname 23 $iif(%mp3.loop == on,q,x)
did -i mp3 13 1 params $int($calc($vol(master) *100 / 65535))
did -ra mp3 13 1 params $int($calc($vol(master) *100 / 65535)) $chr(37)
did -ra mp3 15 $iif($vol(master).mute == $true,r,X)
refresh $dname 28
did -c $dname 28 %mp3.x
set %mp3.plhide off
}
on *:dialog:mp3:dclick:28: {
setsong $did($dname,28).sel
if ((%mp3.lecho != on) && (%mp3.echo == on)) echow
playit
}
on *:dialog:mp3:close:*: {
.timermp3 off
}
alias -l mp3color {
mdx SetFont mp3 4,5,6,7,8,20,23,31,33 -12 100 Webdings
mdx SetFont mp3 15 -16 200 Webdings
mdx SetFont mp3 10 -8 600 MS Sans Serif
mdx SetFont mp3 2,3 -16 800 MS Sans Serif
mdx SetFont mp3 16 -12 800 tahoma
mdx SetFont mp3 17 -9 500 tahoma
mdx SetDialog [ mp3 ] bgcolor [ $_mskin(main,bg) ]
mdx SetDialog [ mp3 ] style tool smaller title bars
mdx SetColor 2,3 background [ $_mskin(time,bg) ]
mdx SetColor 2,3 textbg [ $_mskin(time,textbg) ]
mdx SetColor 2,3 text [ $_mskin(time,text) ]
;mdx SetColor 4,5,6,7,8,15,20,23,24,25 background [ $_mskin(mbutton,bg) ]
mdx SetColor 10 background [ $_mskin(song,bg) ]
mdx SetColor 10 textbg [ $_mskin(song,textbg) ]
mdx SetColor 10 text [ $_mskin(song,text) ]
mdx SetColor 16,17 background [ $_mskin(info,bg) ]
mdx SetColor 16,17 textbg [ $_mskin(info,textbg) ]
mdx SetColor 16,17 text [ $_mskin(info,text) ]
mdx SetColor 11 background [ $_mskin(tbar,bg) ]
mdx SetColor 13 background [ $_mskin(vbar,bg) ]
mdx SetColor 28 background [ $_mskin(list,bg) ]
mdx SetColor 28 textbg [ $_mskin(list,textbg) ]
mdx SetColor 28 text [ $_mskin(list,text) ]
}
alias -l refresh {
did -r $1 $2
var %x 1
while ($readini($_lfile,list,n $+ %x)) {
;did -a $1 $2 $sound($ifmatch).artist - $sound($ifmatch).title
did -a $1 $2 %x $+ . $+ $nopath($ifmatch)
inc %x
}
}
alias -l update {
if (($insong != $true) || (!$dialog(mp3))) { .timermp3 off | return }
did -ra mp3 2 $deltok($duration($int($calc($insong.pos / 1000)),3),1,58)
did -i mp3 11 1 params $int($calc($calc($insong.pos / $insong.length) * 100))
}
alias -l setsong {
set %mp3 $readini($_lfile,list,n $+ $1)
setid
}
alias -l setid {
if (($sound(%mp3).artist) && ($sound(%mp3).title)) {
set %mp3.id $sound(%mp3).artist - $sound(%mp3).title
}
else set %mp3.id $remove($nopath(%mp3),.mp3)
}
alias nextsong {
set %mp3.psong %mp3
if (%mp3.shuffle == on) set %mp3.x $rand(1,$_mcount)
elseif ($did(mp3,28).sel) { set %mp3.x $calc($ifmatch + 1) }
else set %mp3.x $calc(%mp3.x + 1)
setsong %mp3.x
$iif($dialog(mp3),did -c mp3 28 %mp3.x)
playit
}
alias privsong {
set %mp3 %mp3.psong
setid
playit
}
alias -l echow {
var %match
if ((%mp3.act == msg) || (%mp3.act == notice)) {
var %x 1
while ($gettok(%mp3.chans,%x,124)) {
%match = $ifmatch
if ($me ison %match) %mp3.act %match %mp3.id
inc %x
}
}
elseif ((%mp3.act == amsg) || (%mp3.act == ame)) %mp3.act %mp3.id
}
alias playit {
if (!$exists(%mp3)) return
if (%mp3.lecho == on) { echow }
set %mp3.paused 0
if ($dialog(mp3)) {
did -ra mp3 3 $deltok($duration($int($calc($sound(%mp3).length / 1000)),3),1,58)
did -ra mp3 17 $sound(%mp3).bitrate Kbps $sound(%mp3).sample KHz
.timermp3 0 1 update
did -ra mp3 10 %mp3.id
}
splay -p %mp3
}
alias -l iniload {
var %y $calc($_mcount + 1)
var %x 1 | var %path $shortfn($1-)
while ($findfile(%path,*.mp3,%x)) {
writeini $_lfile list n $+ %y $ifmatch
inc %x | inc %y
if (%y >= %mp3.limit) return
}
}
on *:dialog:mp3:sclick:*: {
if ($did == 5) {
if ($did(mp3,28).sel) { set %mp3.x $ifmatch | did -c mp3 28 %mp3.x }
setsong %mp3.x
if ((%mp3.lecho != on) && (%mp3.echo == on)) echow
playit | return
}
if ($did == 6) { splay -p stop | did -i mp3 11 1 params 0 | .timermp3 off | return }
if (($did == 7) && ($insong == $true)) {
if (!%mp3.paused) { set %mp3.paused 1 | splay -p pause | .timermp3 off }
else { splay -p resume | set %mp3.paused 0 | .timer 1 0 update | .timermp3 0 1 update }
return
}
if ($did == 4) { privsong | return }
if ($did == 8) { nextsong | return }
if (($did == 11) && ($insong)) {
splay -p seek $int($calc($calc($gettok($did($dname,11).seltext,1,32) / 100) * $insong.length)) | return
}
if ($did == 13) {
vol -v $int($calc($calc($gettok($did(mp3,$did).seltext,1,32) / 100) * 65535))
did -ra $dname 16 $int($calc($vol(master) * 100 / 65535)) $chr(37) | return
}
if ($did == 15) {
if ($vol(master).mute == $true) { vol -vu2 | did -ra mp3 15 X }
else { vol -vu1 | did -ra mp3 15 r } | return
}
if ($did == 20) {
if (%mp3.shuffle == on) { set %mp3.shuffle off | did -ra $dname $did y }
else { set %mp3.shuffle on | did -ra $dname $did - } | return
}
if ($did == 23) {
if (%mp3.loop == on) { set %mp3.loop off | did -ra $dname $did x }
else { set %mp3.loop on | did -ra $dname $did q } | return
}
if ($did == 24) {
if (%mp3.plhide == off) {
plisthide
set %mp3.plhide on
}
else {
plistshow
set %mp3.plhide off
}
return
}
if ($did == 25) { $iif($dialog(mp3set),dialog -x mp3set,mp3set) | return }
if ($did == 29) {
set %mp3.fdir $$sfile(%mp3.fdir,Yüklenecek Mp3 Dosyasını Seçin)
writeini $_lfile list n $+ $calc($_mcount + 1) %mp3.fdir | refresh $dname 28 | return
}
if ($did == 30) {
if (!$did($dname,28).seltext) return | var %x 1 | hmake mp3.dtable $_mcount
while ((%x < $did($dname,28).sel) && ($readini($_lfile,list,n $+ %x))) { hadd mp3.dtable n $+ %x $ifmatch | inc %x }
while ($readini($_lfile,list,n $+ $calc(%x + 1))) { hadd mp3.dtable n $+ %x $ifmatch | inc %x }
remini $_lfile list | var %x 1
while ($hget(mp3.dtable,n $+ %x)) { writeini $_lfile list n $+ %x $ifmatch | inc %x }
hfree mp3.dtable | refresh $dname 28 | return
}
if ($did == 31) {
set %mp3.mdir $shortfn($$sdir(%mp3.mdir,Yüklenecek Mp3 Klasörünü Seçin))
iniload %mp3.mdir
refresh $dname 28
return
}
if ($did == 33) {
if (!$_mcount) return
set %mp3.mdir $shortfn($$sdir(%mp3.mdir,Geri Yüklenecek Mp3 Klasörünü Seçin))
var %path %mp3.mdir | var %x 1 | var %y 0 | var %temp | hmake mp3.dtable $_mcount
while ($readini($_lfile,list,n $+ %x)) {
%temp = $ifmatch
if (%path !isin $nofile($ifmatch)) { inc %y | hadd mp3.dtable n $+ %x %temp } | inc %x
}
remini $_lfile list | %y = $calc(%x - %y) | var %x 1
while ($hget(mp3.dtable,n $+ %y)) { writeini $_lfile list n $+ %x $ifmatch | inc %x | inc %y }
hfree mp3.dtable | refresh $dname 28 | return
}
if ($did == 32) {
if ($input(Tüm Listeyi Silmek İstiyor Musunuz ?,iy,Listeyi Temizle,Temizle,mesaj) == $false) return
remini $_lfile list | refresh $dname 28 | return
}
}
on *:mp3end: {
if ($dialog(mp3)) { did -i mp3 11 1 params 0 | did -ra mp3 2 00:00 }
if (%mp3.loop == on) { nextsong }
}
dialog mp3set {
title "Echo Ayarları"
size -1 -1 110 100
option dbu
box "Ayarlar", 1, 1 1 105 95
check "play'de echo" 2, 10 10 40 13,
check "devamlı echo" 3, 55 10 40 13,autohs center
text "Echo şekli:" 4, 10 26 40 13
combo 5, 55 25 40 80,drop
text "Echo kanallari:" 6, 10 40 40 13
list 7, 55 40 40 60
button "Ekle" 8, 9 50 20 10,default
button "Çıkar" 9, 30 50 20 10,default
button "Kaydet" 10, 9 80 20 10,default
button "Çıkış" 11, 30 80 20 10,cancel
}
on *:dialog:mp3set:init:*: {
did $iif(%mp3.echo == on,-c,-u) $dname 2
did $iif(%mp3.lecho == on,-c,-u) $dname 3
did -a $dname 5 msg
did -a $dname 5 notice
did -a $dname 5 amsg
did -a $dname 5 ame
did -c $dname 5 $findtok(msg|notice|amsg|ame,%mp3.act,124)
set %mp3.plhide off
refresh2
}
on *:dialog:mp3set:sclick:*: {
if ($did == 8) {
var %temp #$$?="Kanal?"
if (!$istok(%mp3.chans,%temp,124)) set %mp3.chans $addtok(%mp3.chans,%temp,124)
refresh2 | return
}
if (($did == 9) && ($did(7).seltext)) { set %mp3.chans $remtok(%mp3.chans,$ifmatch,124) | refresh2 | return }
if ($did == 10) {
set %mp3.echo $iif($did($dname,2).state,on,off)
set %mp3.lecho $iif($did($dname,3).state,on,off)
if ($istok(msg.notice.amsg.ame,$did(5),46)) set %mp3.act $did(5)
}
}
alias -l refresh2 {
did -r mp3set 7 | var %x 1
while ($gettok(%mp3.chans,%x,124)) { did -a mp3set 7 $ifmatch | inc %x }
}
menu {
-
» Mp3 Calar
.» Mp3 Calari Ac:mp3
.-
.» Mp3 Temalari
..$submenu($mp3skin($1))
.» Echo Ayarlari:mp3set
}
alias mp3skin {
if ($1 == begin) return -
var %x 1,%match
while ($findfile($shortfn($mircdirmp3\skin),*.ini,%x)) {
%match = $ifmatch
if ($1 == %x) return $iif(mp3\skin\ $+ $nopath(%match) == %mp3.cfile,$style(1)) $readini(%match,skin,name) : { setf mp3.cfile mp3\skin\ $+ $nopath(%match) }
inc %x
}
}
alias -l setf { set % $+ [ $1 ] $2- }
#mp3player end