;--------------------------------------------------------; ; ; ; Media Player 2.0 ; ; Originally created as Cool MP3 by: \BlackHowling ; ; Modified by: Some_Person ; ; ; ;--------------------------------------------------------; dialog mp3 { title "Media Player" size -1 -1 327 431 option pixels text "", 4, 7 15 312 57 text "Stopped", 1, 66 20 180 33 text "00:00 ", 2, 18 20 37 17 text "00:00 / 0 kbps / 0 Hz", 3, 66 50 180 17 button "Previous", 5, 165 102 53 18 button "Play ", 6, 6 102 52 18 check "Pause", 7, 59 102 52 18, push button "Stop", 8, 112 102 52 18 button "Next", 9, 219 102 48 18 list 10, 7 125 265 186, size button "Add File", 11, 6 410 75 17 button "Delete", 12, 164 410 75 17 button "Add DIR", 13, 85 410 75 17 list 14, 3 76 325 22, size button "Clear", 15, 243 410 75 17 button "", 1000, 0 0 0 0, hide ok check "Shuffle", 16, 268 102 52 18, push } on *:dialog:Mp3:*:*:{ if ($devent == init) { mdx SetMircVersion $version | mdx MarkDialog $dname | mdx SetControlMDX $dname 10 listview report single showsel rowselect noheader infotip sortascending > $scriptdirviews.mdx | mdx SetFont $dname 10 +a 13 400 Tahoma did -i $dname 10 1 headerdims 288 | mdx SetControlMDX $dname 14 trackbar noticks > $scriptdirbars.mdx | mdx SetFont $dname 1,3 +a 14 400 Tahoma | mdx SetFont $dname 2 +a 15 700 Tahoma | mdx SetBorderStyle $dname 14 | mdx MoveControl $dname 10 8 125 310 280 mdx SetFont $dname 5,6,7,8,9,11,12,13,15,16 +a 12 400 Tahoma | mdx SetColor $dname 1,2,3,4 background $rgb(0,0,0) | mdx SetColor $dname 1,2,3,4 textbg $rgb(0,0,0) | mdx SetColor $dname 1,2,3,4 text $rgb(28,154,255) | playlist.load | did -c $dname 10 2 | if (%mp3.shuffle) { did -c mp3 16 } mdx SetDialog mp3 icon 0 $scriptdirlistmod.ico } if ($devent == sclick) { var %d = $did | var %q = $gettok($did(10).seltext,2,4) if (%d == 5) { px_ | prev_ | mp3.pub } if (%d == 8) { px_ | stop_ | mp3.pub } if (%d == 9) { px_ | next_ | mp3.pub } if (%d == 12) { if (%q) { del.mp3_ [ [ %q ] ] } } if (%d == 6 ) { if (%q) { timez_ | did -u mp3 7 | splay -p %q | mp3.pub } } if (%d == 7 ) { $iif($insong == $true,$iif($did(7).state == 1,splay pause,splay resume)) } if (%d == 11) { var %i = $sfile(C:\,Add Mp3 File,Add) | if (%i) { write playlist.txt $gettok(%i,$numtok(%i,92),92) $chr(4) %i | did -a $dname 10 $gettok(%i,$numtok(%i,92),92) $chr(4) %i | did -c mp3 10 2 } } if (%d == 13) { %mp3.dir = $sdir(C:\,Add New Directory) | if (%mp3.dir) { var %o = $findfile(%mp3.dir,*.mp3,0) | var %x = 1 | while (%x <= %o ) { var %musik = $findfile(%mp3.dir,*.mp3,%x) | write playlist.txt $gettok(%musik,$numtok(%musik,92),92) $chr(4) %musik | inc %x } | playlist.load } } if (%d == 14) { if (!$insong) { halt } | var %p = $did(14).seltext | if ($gettok(%p,9,32) == end) { did -i $dname 14 1 params $gettok(%p,1,32) | splay seek $insong.fname $gettok(%p,1,32) } } if (%d == 15) { write -c playlist.txt | did -r $dname 10 } if (%d == 16) { if ($did(16).state == 1) { %mp3.shuffle = $true } | else { unset %mp3.shuffle } } } if ($devent == dclick) { if ($did == 10) { var %w = $gettok($did(10).seltext,2,4) | if (%w) { timez_ | did -u mp3 7 | splay %w | mp3.pub } } } } on *:mp3end:{ next_ | mp3.pub } } on *:load:{ if ($numtok($scriptdir,32) > 1) { echo 5 -a 4,1(WARNING) The folder of this ADD-ON contains 2 or more words. The script may not worked correcty. If it does not work, please put this add-on in a folder with no spaces in its path. Example: 4C:\CoolMP3 } else { echo 5 -a Thank you for using Media Player! Type 4F3 to open it. } } on *:unload:{ if ($numtok($scriptdir,32) < 2) { echo 5 -a Thank you for Media Player! | .timerINSONG off } } alias mp3 dialog $iif($dialog(mp3) == $null,-md mp3,-e) mp3 alias -l mdx dll $scriptdirmdx.dll $1- alias -l px_ did -u mp3 7 alias -l timex_ { .timerINSONG off } alias -l timez_ { .timerINSONG 0 1 song.time } alias -l song.time { if ($dialog(mp3)) { if ($insong) { did -ra mp3 2 $gmt($calc($insong.fname.pos /1000),nn:ss) | did -ra mp3 1 $gettok($insong.fname,$numtok($insong.fname,92),92) | did -ra mp3 3 $gmt($calc($sound($insong.fname).length /1000),nn:ss) / $sound($insong.fname).bitrate kbps / $sound($insong.fname).sample Hz | did -i mp3 14 1 params $calc($insong.pos +1000) 0 $insong.length 5 * * * } | else { stop_ } } } alias -l next_ { var %w = $gettok($did(mp3,10).seltext,2,4) | if (!%w) { return } | if (%mp3.shuffle) { did -c mp3 10 $r(1,$did(mp3,10).lines) } | else { if ($did(mp3,10).sel != $did(mp3,10).lines) { did -c mp3 10 $calc($did(mp3,10).sel + 1) } | else { return } } | kanta_ } alias -l prev_ { var %w = $right($gettok($did(mp3,10).seltext,2,4),-1) | if (!%w) { return } | if (%mp3.shuffle) { did -c mp3 10 $r(1,$did(mp3,10).lines) } | else { if ($did(mp3,10).sel > 2) { did -c mp3 10 $calc($did(mp3,10).sel - 1) } | else { return } } | kanta_ } alias -l kanta_ { splay stop | splay -p $right($gettok($did(mp3,10).seltext,2,4),-1) | timez_ } alias -l stop_ { did -i mp3 14 1 params 0 | splay stop | timex_ | did -a mp3 1 Stopped | did -a mp3 2 00:00 | did -a mp3 3 00:00 / 0 kbps / 0 Hz } alias -l del.mp3_ { set -u %f * $+ $1- $+ * | set -u %e $read(playlist.txt,w,%f,1) | set -u %line.ttl $lines(playlist.txt) | set -u %line.inc 1 | while (%line.inc <= %line.ttl) { set -u %line.read $read(playlist.txt,%line.inc) | if (%e == %line.read) { write -dl $+ %line.inc playlist.txt | goto end } | inc %line.inc } | :end | did -d mp3 10 $did(mp3,10).sel | did -c mp3 10 2 } alias -l mp3.pub { if ($chan(0)) && ($insong.fname) { var %h = $insong.fname | if (%mp3.pub) { AME 7,1Now Playing: 4/11 $gettok(%h,$numtok(%h,92),92) 4/9 $sound(%h).artist 4/10 $gmt($calc($insong.fname.length /1000),nn:ss) 4/8 $sound(%h).bitrate kbps 4/4 $sound(%h).sample Hz } } } alias -l playlist.load { did -r mp3 10 | var %e = $lines(playlist.txt) | var %k = 1 | while (%k <= %e) { did -a mp3 10 $read(playlist.txt,%k) | inc %k 1 } | did -c mp3 10 2 } menu menubar { - &Media Player .Media Player:mp3 .- .Channel Display ..Status - $iif(%mp3.pub,on,off):return ..- ..Enable:set %mp3.pub $true ..Disable:set %mp3.pub $false .- .Uninstall:unload -rs $script - } alias F3 { mp3 }