MP3 Speler
Auteur: Paul - 19 oktober 2008 - 12:54 - Gekeurd door: Gerard - Hits: 3352 - Aantal punten: (0 stemmen)
Open simpelweg je remote (alt+r) en plak de code daar.
|
Code: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Script: Pauls MP3 Player ;
; Version: 2 ;
; ;
; Beta Testers: Typo and H_M ;
; Feedback to ;
; admin@xstaticcodes.com ;
; Thank You ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias mpn { if ($dialog(mpnew)) dialog -v mpnew | else dialog -md mpnew mpnew }
alias mp_mini { if ($dialog(mini_mpnew)) dialog -v mini_mpnew | else dialog -md mini_mpnew mini_mpnew | set %mini_mode 1 }
alias mp_settings { if ($dialog(settings_mpnew)) dialog -v settings_mpnew | else dialog -md settings_mpnew settings_mpnew }
alias mp_lyrics { if ($dialog(lyrics_mpnew)) dialog -v lyrics_mpnew | else dialog -md lyrics_mpnew lyrics_mpnew }
dialog mpnew {
title "MP3 Player - Beta"
size -1 -1 236 159
option dbu
box "Playlist", 1, 1 1 159 62
list 2, 4 8 152 50, sort size extsel
box "Controls", 3, 1 100 85 56
scroll "", 4, 4 137 77 8, range 1 500 horizontal
button "Play", 5, 5 109 37 12
button "Stop", 6, 44 109 37 12
text "Rewind or Fastforward", 7, 4 146 77 8, center
box "Tunes Found", 8, 90 124 39 21
edit "", 9, 95 132 28 10, read
button "Shoutcast", 10, 187 7 35 12
button "Close", 11, 187 20 35 12
box "Volume", 12, 162 1 23 62
scroll "", 13, 170 10 8 49, range 0 65535
box "Message Settings.", 14, 90 65 144 35
edit "04Is now playing: <song> 03Total Playing Length: <length>", 15, 93 73 138 23, multi autohs autovs
box "Browse.", 18, 90 101 144 22
button "MP3 Dir", 19, 92 108 37 12
edit "", 20, 133 109 97 10, read
button "Refresh.", 21, 187 33 35 12
link "X-Static Codes", 22, 186 60 37 8
check "Random Play", 23, 4 75 43 10
button "Next Song", 24, 5 122 37 12
button "Previous Song", 25, 44 122 37 12
text "Made by Paul - F*U*R*B*Y* - Beta Testers: Typo, H_M", 26, 91 147 136 8
check "Continuous Play", 27, 4 85 50 10
box "Play Modes", 28, 1 66 85 33
box "Extras", 29, 131 124 103 21
link "Check for Upgrades", 30, 135 132 49 8
link "Bug Reports", 31, 195 132 31 8
text "+", 32, 165 51 5 8
text "-", 33, 166 10 4 8
button "Mini Mode", 34, 187 46 35 12
menu "File", 35
item "Set Directory", 36, 35
item break, 37, 35
item "Exit", 38, 35
menu "Window", 39
item "Mini-Mode", 40, 39
item "Settings", 41, 39
menu "Help", 42
item "IRC", 43, 42
item "E-Mail", 44, 42
item "MSN", 45, 42
}
dialog mini_mpnew {
title "Mini - MP3 Player"
size -1 -1 146 27
option dbu
list 1, 31 3 82 11, size vsbar
button "Play", 2, 114 2 16 12
button "Next", 3, 130 2 16 12
button "Stop", 4, 17 2 16 12
button "Prev", 5, 2 2 15 12
button "MP3 Player", 6, 50 16 37 10
}
dialog settings_mpnew {
title "MP3 Player - Settings"
size -1 -1 136 117
option dbu
check "Use $tip when playing songs", 1, 4 2 79 10
list 2, 2 67 126 32, size vsbar
text "Please select which type of format you want used when playing a song.", 3, 2 51 126 15
button "Save && Return", 4, 46 102 39 12, flat
check "Activate Messages", 5, 4 39 78 10
check "Post info online", 6, 4 14 78 10
check "Use Ascii Characters", 7, 4 27 61 10
}
dialog lyrics_mpnew {
title "MP3 Player - Lyrics"
size -1 -1 236 176
option dbu
edit "", 1, 2 26 230 148, read multi return autohs autovs
text "Lyrics Page using http://www.metrolyrics.com/ for lyrics. Any wrong lyrics or missing lyrics have nothing to do with the actual MP3 Player", 2, 10 4 216 16
}
;Dialog Activated.
on *:dialog:mpnew:init:0: {
if (%mp.pause == 1) {
did -r mpnew 5
did -a mpnew 5 Play
}
if ($vol(master).mute == $true) { did -o mpnew 17 1 Unmute }
set %mp.format $did(15)
if (%mp.shuffle == On) { did -c mpnew 27 }
if (%mp.rand == On) { did -c mpnew 23 }
set %mp.chan $active
did -o mpnew 20 1 %mp.dir
set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-))
did -o mpnew 9 1 %mp.found
did -c mpnew 13 $vol(master)
}
;Double Clicking on play list
on *:dialog:mpnew:sclick:2: { set %mp.file $did(2).seltext | set %mp.temp %mp.dir $+ %mp.file | set %mp.bitrate $mp3(%mp.temp).bitrate | set %mp.size $round($calc($lof(%mp.temp) / 1048576),2) }
on *:dialog:mpnew:dclick:2: { set %mp.file $did(2).seltext | set %mp.temp %mp.dir $+ %mp.file | set %mp.bitrate $mp3(%mp.temp).bitrate | set %mp.length $mplength | set %mp.size $round($calc($lof(%mp.temp) / 1048576),2) | splay %mp.dir $+ %mp.file | set %mp.play 1 | set %mp.pause 0 | did -r mpnew 5 | did -a mpnew 5 Pause | set %mp.format $did(15) | mpmsg }
;Rewind & Fastforward
on *:dialog:mpnew:scroll:4: {
.timermp3tseek -m 1 500 splay seek $int($calc(($did(4).sel / 500) * $inmp3.length)) | .timerpos.update -r
}
;Play Button
on *:dialog:mpnew:sclick:5: {
if ($did(mpnew,5).text == Play) {
set %mp.temp %mp.dir $+ %mp.file
splay %mp.temp
set %mp.play 1
set %mp.pause 0
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(15)
set %mp.length $mplength
$mpmsg
}
elseif ($did(mpnew,5).text == Resume) {
if (%mp.play == 0) { halt }
elseif (%mp.pause == 1) {
splay resume
set %mp.pause 0
did -r mpnew 5
did -a mpnew 5 Pause
}
}
elseif ($did(mpnew,5).text == Pause) {
if ((%mp.play == 1) && (%mp.pause == 0)) {
splay pause
set %mp.pause 1
did -r mpnew 5
did -a mpnew 5 Resume
}
}
}
;Stop Button
on *:dialog:mpnew:sclick:6: { splay stop | set %mp.play 0 | set %mp.pause 0 | did -r mpnew 5 | did -a mpnew 5 Play }
;Shoutcast Button
on *:dialog:mpnew:sclick:10: { run http://www.xstaticcodes.com/shoutcast.php }
;Close Button
on *:dialog:mpnew:sclick:11: { if ($input(Do you want the song to stop also?,n,End Song,,) == $true) { $mpclose | dialog -x mpnew mpnew } | else { dialog -x mpnew mpnew } }
;Volume Scroller
on *:dialog:mpnew:scroll:13: { vol -v $did(13).sel }
;MP3 Dir Button
on *:dialog:mpnew:sclick:19: { did -r mpnew 2 | set %mp.dir $sdir="Mp3 directory" c: | did -o mpnew 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-)) | did -o mpnew 9 1 %mp.found }
;Randomnize Playing
on *:dialog:mpnew:sclick:23: { if (%mp.rand == On) { set %mp.rand Off } | else { set %mp.rand On } }
;Next Song Button
on *:dialog:mpnew:sclick:24: { $mp3next }
;Previous Song Button
on *:dialog:mpnew:sclick:25: { $mp3previous }
;Shuffle Button is Ticked :)
on *:dialog:mpnew:sclick:27: { if ((%mp.shuffle == On) && (%mp.rand != On)) { set %mp.shuffle Off } | elseif ((%mp.shuffle == Off) && (%mp.rand != On)) { set %mp.shuffle On } }
;The 3 random Links
on *:dialog:mpnew:sclick:[22,30,31]: {
if ($did == 22) { run http://www.xstaticcodes.com/ }
if ($did == 30) { echo -a "Website under Construction" }
if ($did == 31) { run mailto:admin@xstaticcodes.com&subject=MP3 Problems }
}
;Call the Mini Mode up :)
on *:dialog:mpnew:sclick:34: { $mp_mini | dialog -x mpnew mpnew }
;Menu and its Items
;Set Directory
on *:dialog:mpnew:menu:36: { did -r mpnew 2 | set %mp.dir $sdir="Mp3 directory" c: | did -o mpnew 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-)) | did -o mpnew 9 1 %mp.found }
;Exit MP3 Player
on *:dialog:mpnew:menu:38: { dialog -x mpnew mpnew }
;Launch Mini Mode
on *:dialog:mpnew:menu:40: { $mp_mini | dialog -x mpnew mpnew }
;Launch Setting Window
on *:dialog:mpnew:menu:41: { $mp_settings }
; IRC Help
on *:dialog:mpnew:menu:43: { server -m irc.snm.co.nz -j #x-static }
; E-Mail Help
on *:dialog:mpnew:menu:44: { run mailto:admin@xstaticcodes.com&subject=MP3 Player Help }
; MSN Help
on *:dialog:mpnew:menu:45: { echo -a For MSN Help, please add paul@irc4.snm.co.nz }
;When MP3 Player Finishes, play new Song
on *:MP3END: { $mp3determine }
;When MP3 Player Exits, unset some stuff
on *:dialog:mpnew:close:*: { $mpclose }
;When the script is unloaded, auto unset all variables
on *:UNLOAD: unset %mp.*
;Now we start the coding for the mini MP3 Player Viewer
;When the dialog is opened
on *:dialog:mini_mpnew:init:0: set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mini_mpnew 1 $nopath($1-))
;Single Click a Song - Set stuff, don't play although
on *:dialog:mini_mpnew:sclick:1: {
set %mp.file $did(1).seltext
set %mp.temp %mp.dir $+ %mp.file
set %mp.bitrate $mp3(%mp.temp).bitrate
set %mp.size $round($calc($lof(%mp.temp) / 1048576),2)
}
;Double click a song - set stuff, play song
on *:dialog:mini_mpnew:dclick:1: {
set %mp.file $did(1).seltext
set %mp.temp %mp.dir $+ %mp.file
set %mp.bitrate $mp3(%mp.temp).bitrate
set %mp.length $mplength
set %mp.size $round($calc($lof(%mp.temp) / 1048576),2)
splay %mp.dir $+ %mp.file
set %mp.play 1
set %mp.pause 0
mpmsg
}
;Play Song.
on *:dialog:mini_mpnew:sclick:2: {
set %mp.temp %mp.dir $+ %mp.file
splay %mp.temp
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
;New Song
on *:dialog:mini_mpnew:sclick:3: { $mp3next }
;Stop Song
on *:dialog:mini_mpnew:sclick:4: { splay stop }
;Previous Song
on *:dialog:mini_mpnew:sclick:5: { $mp3previous }
;Return to Full MP3 Player
on *:dialog:mini_mpnew:sclick:6: { $mpn | dialog -x mini_mpnew mini_mpnew }
on *:dialog:settings_mpnew:init:0: {
if (%mp.tip == On) { did -c settings_mpnew 1 }
if (%mp.msg == On) { did -c settings_mpnew 5 }
if (%mp.online == On) { did -c settings_mpnew 6 }
if (%mp.ascii == On) { did -c settings_mpnew 7 }
tokenize 44 echo,msg,me,amsg,ame
did -a settings_mpnew 2 $*
}
on *:dialog:settings_mpnew:sclick:1: { if (%mp.tip == On) { set %mp.tip Off } | else set %mp.tip On }
on *:dialog:settings_mpnew:sclick:2: { set %mp.mfor $did(2).seltext }
on *:dialog:settings_mpnew:sclick:4: { dialog -x settings_mpnew settings_mpnew }
on *:dialog:settings_mpnew:sclick:5: { if (%mp.msg == On) { set %mp.msg Off } | else { set %mp.msg On } }
on *:dialog:settings_mpnew:sclick:6: { if (%mp.online == On) { set %mp.online Off } | else { set %mp.online On } }
on *:dialog:settings_mpnew:sclick:7: { if (%mp.ascii == On) { set %mp.ascii Off } | else { set %mp.ascii On } }
alias -l mpclose {
set %mp.play 0
.timermp3Update Off
splay stop
}
alias -l mplength {
var %mp.len $int($calc($mp3(%mp.temp).length / 1000))
var %mp.min $int($calc(%mp.len / 60))
var %mp.sec $calc(%mp.len - (%mp.min * 60))
if (%mp.min < 10) { set %mp.min 0 $+ %mp.min }
if (%mp.sec < 10) { set %mp.sec 0 $+ %mp.sec }
set %mp.len %mp.min $+ : $+ %mp.sec
return %mp.len
}
alias F3 { $mp3determine }
alias -l mp3determine {
if ((%mp.shuffle == On) && (%mp.rand == Off)) { $mp3shuffle }
elseif ((%mp.shuffle == Off) && (%mp.rand == On)) { $randplay }
elseif ((%mp.shuffle == Off) && (%mp.rand == Off)) { halt }
}
alias -l randplay {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).lines, %play $r(1,%line)
splay $+(%mp.dir,$did(mpnew,2, %play))
did -c mpnew 2 $did(mpnew,2,%play)
set %mp.file $did(mpnew,2, %play)
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).lines, %play $r(1,%line)
splay $+(%mp.dir,$did(mpnew,2, %play))
did -c mpnew 2 $did(mpnew,2,%play)
set %mp.file $did(mpnew,2, %play)
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3next {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line + 1)))
did -c mpnew 2 $calc(%line + 1)
set %mp.file $did(mpnew,2, $calc(%line + 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line + 1)))
did -c mini_mpnew 1 $calc(%line + 1)
set %mp.file $did(mini_mpnew,1, $calc(%line + 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3previous {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line - 1)))
did -c mpnew 2 $calc(%line - 1)
set %mp.file $did(mpnew,2, $calc(%line - 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line - 1)))
did -c mini_mpnew 1 $calc(%line - 1)
set %mp.file $did(mini_mpnew,1, $calc(%line - 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3shuffle {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if ($dialog(mpnew)) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line + 1)))
did -c mpnew 2 $calc(%line + 1)
set %mp.file $did(mpnew,2, $calc(%line + 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ($dialog(mini_mpnew)) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line + 1)))
did -c mini_mpnew 1 $calc(%line + 1)
set %mp.file $did(mini_mpnew,1, $calc(%line + 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3update {
if ($dialog(mpnew)) {
if (%mp.play == 1) { did -c mpnew 4 $calc(($inmp3.pos / $inmp3.length)*500) }
else { timermp3Update off }
}
}
alias -l mpmsg {
if (%mp.online == On) { $mp3write_online }
if (!$dialog(mini_mpnew)) { .timermp3Update 10000 1 $!mp3update }
if (%mp.mfor == $null) { echo -a Please select which type of format you want to use | $mp_settings }
else {
if (%mp.format != $null) {
set %mp.song $remove(%mp.file,.mp3)
set %mp.song $replace(%mp.format,<song>,%mp.song,<length>,%mp.length)
if (%mp.ascii == On) { set %mp.song $replacecs(%mp.song,a,?,A,?,b,?,B,?,c,?,C,?,d,?,D,?,e,?,E,?,f,?,F,?,i,?,I,?,l,?,L,?,n,?,N,?,o,?,O,?,p,?,P,?,q,?,Q,?,r,?,R,?,s,?,S,?,u,?,U,?,x,?,X,?,y,?,Y,?,!,?,?,?,>,?,<,?,2,?,3,?,half,?,fourth,?,/,?,.,?,ae,?,tm,?,TM,?) }
if (%mp.msg == On) {
if (%mp.mfor == echo) { echo %mp.chan %mp.song }
elseif (%mp.mfor == say) { msg %mp.chan %mp.song }
elseif (%mp.mfor == me) { describe %mp.chan %mp.song }
elseif (%mp.mfor == amsg) { amsg %mp.song }
elseif (%mp.mfor == ame) { ame %mp.song }
}
}
else {
set %mp.song $remove(%mp.file,.mp3)
set %mp.song $replace(%mp.format,<song>,%mp.song,<length>,%mp.length)
if (%mp.ascii == On) { set %mp.song $replacecs(%mp.song,a,?,A,?,b,?,B,?,c,?,C,?,d,?,D,?,e,?,E,?,f,?,F,?,i,?,I,?,l,?,L,?,n,?,N,?,o,?,O,?,p,?,P,?,q,?,Q,?,r,?,R,?,s,?,S,?,u,?,U,?,x,?,X,?,y,?,Y,?,!,?,?,?,>,?,<,?,2,?,3,?,half,?,fourth,?,/,?,.,?,ae,?,tm,?,TM,?) }
if (%mp.mfor == echo) { echo %mp.chan %mp.song }
elseif (%mp.mfor == say) { msg %mp.chan %mp.song }
elseif (%mp.mfor == me) { describe %mp.chan %mp.song }
elseif (%mp.mfor == amsg) { amsg %mp.song }
elseif (%mp.mfor == ame) { ame %mp.song }
}
}
if (%mp.tip == On) { $tip(Paul's MP3 Player,Paul's MP3 Player,Now Playing: $replace(%mp.format,<song>,$remove(%mp.file,.mp3),<length>,%mp.length),5,,,,) }
}
alias -l mp3write_online {
sockopen abc www.xstaticcodes.com 80
}
on *:SOCKOPEN:abc: {
var %data = $+(d=,add,&nick=,$me,&address=,$address($me,2),&channel=,%mp.chan,&server=,$server,&song=,%mp.file,&length=,%mp.length,&network=,$network)
sockwrite -nt $sockname POST /shoutcast.php HTTP/1.1 $crlf
sockwrite -nt $sockname Host: www.xstaticcodes.com $crlf
sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded $crlf
sockwrite -nt $sockname Content-Length: $len(%data) $crlf
sockwrite -nt $sockname $crlf %data $crlf
}
on *:SOCKREAD:abc: {
if ($sockerr) {
aline @abc-debug Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
}
menu channel,menubar {
-
MP3 Player (NEW):/mpn
-
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Script: Pauls MP3 Player ;
; Version: 2 ;
; ;
; Beta Testers: Typo and H_M ;
; Feedback to ;
; admin@xstaticcodes.com ;
; Thank You ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias mpn { if ($dialog(mpnew)) dialog -v mpnew | else dialog -md mpnew mpnew }
alias mp_mini { if ($dialog(mini_mpnew)) dialog -v mini_mpnew | else dialog -md mini_mpnew mini_mpnew | set %mini_mode 1 }
alias mp_settings { if ($dialog(settings_mpnew)) dialog -v settings_mpnew | else dialog -md settings_mpnew settings_mpnew }
alias mp_lyrics { if ($dialog(lyrics_mpnew)) dialog -v lyrics_mpnew | else dialog -md lyrics_mpnew lyrics_mpnew }
dialog mpnew {
title "MP3 Player - Beta"
size -1 -1 236 159
option dbu
box "Playlist", 1, 1 1 159 62
list 2, 4 8 152 50, sort size extsel
box "Controls", 3, 1 100 85 56
scroll "", 4, 4 137 77 8, range 1 500 horizontal
button "Play", 5, 5 109 37 12
button "Stop", 6, 44 109 37 12
text "Rewind or Fastforward", 7, 4 146 77 8, center
box "Tunes Found", 8, 90 124 39 21
edit "", 9, 95 132 28 10, read
button "Shoutcast", 10, 187 7 35 12
button "Close", 11, 187 20 35 12
box "Volume", 12, 162 1 23 62
scroll "", 13, 170 10 8 49, range 0 65535
box "Message Settings.", 14, 90 65 144 35
edit "04Is now playing: <song> 03Total Playing Length: <length>", 15, 93 73 138 23, multi autohs autovs
box "Browse.", 18, 90 101 144 22
button "MP3 Dir", 19, 92 108 37 12
edit "", 20, 133 109 97 10, read
button "Refresh.", 21, 187 33 35 12
link "X-Static Codes", 22, 186 60 37 8
check "Random Play", 23, 4 75 43 10
button "Next Song", 24, 5 122 37 12
button "Previous Song", 25, 44 122 37 12
text "Made by Paul - F*U*R*B*Y* - Beta Testers: Typo, H_M", 26, 91 147 136 8
check "Continuous Play", 27, 4 85 50 10
box "Play Modes", 28, 1 66 85 33
box "Extras", 29, 131 124 103 21
link "Check for Upgrades", 30, 135 132 49 8
link "Bug Reports", 31, 195 132 31 8
text "+", 32, 165 51 5 8
text "-", 33, 166 10 4 8
button "Mini Mode", 34, 187 46 35 12
menu "File", 35
item "Set Directory", 36, 35
item break, 37, 35
item "Exit", 38, 35
menu "Window", 39
item "Mini-Mode", 40, 39
item "Settings", 41, 39
menu "Help", 42
item "IRC", 43, 42
item "E-Mail", 44, 42
item "MSN", 45, 42
}
dialog mini_mpnew {
title "Mini - MP3 Player"
size -1 -1 146 27
option dbu
list 1, 31 3 82 11, size vsbar
button "Play", 2, 114 2 16 12
button "Next", 3, 130 2 16 12
button "Stop", 4, 17 2 16 12
button "Prev", 5, 2 2 15 12
button "MP3 Player", 6, 50 16 37 10
}
dialog settings_mpnew {
title "MP3 Player - Settings"
size -1 -1 136 117
option dbu
check "Use $tip when playing songs", 1, 4 2 79 10
list 2, 2 67 126 32, size vsbar
text "Please select which type of format you want used when playing a song.", 3, 2 51 126 15
button "Save && Return", 4, 46 102 39 12, flat
check "Activate Messages", 5, 4 39 78 10
check "Post info online", 6, 4 14 78 10
check "Use Ascii Characters", 7, 4 27 61 10
}
dialog lyrics_mpnew {
title "MP3 Player - Lyrics"
size -1 -1 236 176
option dbu
edit "", 1, 2 26 230 148, read multi return autohs autovs
text "Lyrics Page using http://www.metrolyrics.com/ for lyrics. Any wrong lyrics or missing lyrics have nothing to do with the actual MP3 Player", 2, 10 4 216 16
}
;Dialog Activated.
on *:dialog:mpnew:init:0: {
if (%mp.pause == 1) {
did -r mpnew 5
did -a mpnew 5 Play
}
if ($vol(master).mute == $true) { did -o mpnew 17 1 Unmute }
set %mp.format $did(15)
if (%mp.shuffle == On) { did -c mpnew 27 }
if (%mp.rand == On) { did -c mpnew 23 }
set %mp.chan $active
did -o mpnew 20 1 %mp.dir
set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-))
did -o mpnew 9 1 %mp.found
did -c mpnew 13 $vol(master)
}
;Double Clicking on play list
on *:dialog:mpnew:sclick:2: { set %mp.file $did(2).seltext | set %mp.temp %mp.dir $+ %mp.file | set %mp.bitrate $mp3(%mp.temp).bitrate | set %mp.size $round($calc($lof(%mp.temp) / 1048576),2) }
on *:dialog:mpnew:dclick:2: { set %mp.file $did(2).seltext | set %mp.temp %mp.dir $+ %mp.file | set %mp.bitrate $mp3(%mp.temp).bitrate | set %mp.length $mplength | set %mp.size $round($calc($lof(%mp.temp) / 1048576),2) | splay %mp.dir $+ %mp.file | set %mp.play 1 | set %mp.pause 0 | did -r mpnew 5 | did -a mpnew 5 Pause | set %mp.format $did(15) | mpmsg }
;Rewind & Fastforward
on *:dialog:mpnew:scroll:4: {
.timermp3tseek -m 1 500 splay seek $int($calc(($did(4).sel / 500) * $inmp3.length)) | .timerpos.update -r
}
;Play Button
on *:dialog:mpnew:sclick:5: {
if ($did(mpnew,5).text == Play) {
set %mp.temp %mp.dir $+ %mp.file
splay %mp.temp
set %mp.play 1
set %mp.pause 0
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(15)
set %mp.length $mplength
$mpmsg
}
elseif ($did(mpnew,5).text == Resume) {
if (%mp.play == 0) { halt }
elseif (%mp.pause == 1) {
splay resume
set %mp.pause 0
did -r mpnew 5
did -a mpnew 5 Pause
}
}
elseif ($did(mpnew,5).text == Pause) {
if ((%mp.play == 1) && (%mp.pause == 0)) {
splay pause
set %mp.pause 1
did -r mpnew 5
did -a mpnew 5 Resume
}
}
}
;Stop Button
on *:dialog:mpnew:sclick:6: { splay stop | set %mp.play 0 | set %mp.pause 0 | did -r mpnew 5 | did -a mpnew 5 Play }
;Shoutcast Button
on *:dialog:mpnew:sclick:10: { run http://www.xstaticcodes.com/shoutcast.php }
;Close Button
on *:dialog:mpnew:sclick:11: { if ($input(Do you want the song to stop also?,n,End Song,,) == $true) { $mpclose | dialog -x mpnew mpnew } | else { dialog -x mpnew mpnew } }
;Volume Scroller
on *:dialog:mpnew:scroll:13: { vol -v $did(13).sel }
;MP3 Dir Button
on *:dialog:mpnew:sclick:19: { did -r mpnew 2 | set %mp.dir $sdir="Mp3 directory" c: | did -o mpnew 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-)) | did -o mpnew 9 1 %mp.found }
;Randomnize Playing
on *:dialog:mpnew:sclick:23: { if (%mp.rand == On) { set %mp.rand Off } | else { set %mp.rand On } }
;Next Song Button
on *:dialog:mpnew:sclick:24: { $mp3next }
;Previous Song Button
on *:dialog:mpnew:sclick:25: { $mp3previous }
;Shuffle Button is Ticked :)
on *:dialog:mpnew:sclick:27: { if ((%mp.shuffle == On) && (%mp.rand != On)) { set %mp.shuffle Off } | elseif ((%mp.shuffle == Off) && (%mp.rand != On)) { set %mp.shuffle On } }
;The 3 random Links
on *:dialog:mpnew:sclick:[22,30,31]: {
if ($did == 22) { run http://www.xstaticcodes.com/ }
if ($did == 30) { echo -a "Website under Construction" }
if ($did == 31) { run mailto:admin@xstaticcodes.com&subject=MP3 Problems }
}
;Call the Mini Mode up :)
on *:dialog:mpnew:sclick:34: { $mp_mini | dialog -x mpnew mpnew }
;Menu and its Items
;Set Directory
on *:dialog:mpnew:menu:36: { did -r mpnew 2 | set %mp.dir $sdir="Mp3 directory" c: | did -o mpnew 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mpnew 2 $nopath($1-)) | did -o mpnew 9 1 %mp.found }
;Exit MP3 Player
on *:dialog:mpnew:menu:38: { dialog -x mpnew mpnew }
;Launch Mini Mode
on *:dialog:mpnew:menu:40: { $mp_mini | dialog -x mpnew mpnew }
;Launch Setting Window
on *:dialog:mpnew:menu:41: { $mp_settings }
; IRC Help
on *:dialog:mpnew:menu:43: { server -m irc.snm.co.nz -j #x-static }
; E-Mail Help
on *:dialog:mpnew:menu:44: { run mailto:admin@xstaticcodes.com&subject=MP3 Player Help }
; MSN Help
on *:dialog:mpnew:menu:45: { echo -a For MSN Help, please add paul@irc4.snm.co.nz }
;When MP3 Player Finishes, play new Song
on *:MP3END: { $mp3determine }
;When MP3 Player Exits, unset some stuff
on *:dialog:mpnew:close:*: { $mpclose }
;When the script is unloaded, auto unset all variables
on *:UNLOAD: unset %mp.*
;Now we start the coding for the mini MP3 Player Viewer
;When the dialog is opened
on *:dialog:mini_mpnew:init:0: set %mp.found $findfile(%mp.dir, *.mp3,0,1,did -a mini_mpnew 1 $nopath($1-))
;Single Click a Song - Set stuff, don't play although
on *:dialog:mini_mpnew:sclick:1: {
set %mp.file $did(1).seltext
set %mp.temp %mp.dir $+ %mp.file
set %mp.bitrate $mp3(%mp.temp).bitrate
set %mp.size $round($calc($lof(%mp.temp) / 1048576),2)
}
;Double click a song - set stuff, play song
on *:dialog:mini_mpnew:dclick:1: {
set %mp.file $did(1).seltext
set %mp.temp %mp.dir $+ %mp.file
set %mp.bitrate $mp3(%mp.temp).bitrate
set %mp.length $mplength
set %mp.size $round($calc($lof(%mp.temp) / 1048576),2)
splay %mp.dir $+ %mp.file
set %mp.play 1
set %mp.pause 0
mpmsg
}
;Play Song.
on *:dialog:mini_mpnew:sclick:2: {
set %mp.temp %mp.dir $+ %mp.file
splay %mp.temp
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
;New Song
on *:dialog:mini_mpnew:sclick:3: { $mp3next }
;Stop Song
on *:dialog:mini_mpnew:sclick:4: { splay stop }
;Previous Song
on *:dialog:mini_mpnew:sclick:5: { $mp3previous }
;Return to Full MP3 Player
on *:dialog:mini_mpnew:sclick:6: { $mpn | dialog -x mini_mpnew mini_mpnew }
on *:dialog:settings_mpnew:init:0: {
if (%mp.tip == On) { did -c settings_mpnew 1 }
if (%mp.msg == On) { did -c settings_mpnew 5 }
if (%mp.online == On) { did -c settings_mpnew 6 }
if (%mp.ascii == On) { did -c settings_mpnew 7 }
tokenize 44 echo,msg,me,amsg,ame
did -a settings_mpnew 2 $*
}
on *:dialog:settings_mpnew:sclick:1: { if (%mp.tip == On) { set %mp.tip Off } | else set %mp.tip On }
on *:dialog:settings_mpnew:sclick:2: { set %mp.mfor $did(2).seltext }
on *:dialog:settings_mpnew:sclick:4: { dialog -x settings_mpnew settings_mpnew }
on *:dialog:settings_mpnew:sclick:5: { if (%mp.msg == On) { set %mp.msg Off } | else { set %mp.msg On } }
on *:dialog:settings_mpnew:sclick:6: { if (%mp.online == On) { set %mp.online Off } | else { set %mp.online On } }
on *:dialog:settings_mpnew:sclick:7: { if (%mp.ascii == On) { set %mp.ascii Off } | else { set %mp.ascii On } }
alias -l mpclose {
set %mp.play 0
.timermp3Update Off
splay stop
}
alias -l mplength {
var %mp.len $int($calc($mp3(%mp.temp).length / 1000))
var %mp.min $int($calc(%mp.len / 60))
var %mp.sec $calc(%mp.len - (%mp.min * 60))
if (%mp.min < 10) { set %mp.min 0 $+ %mp.min }
if (%mp.sec < 10) { set %mp.sec 0 $+ %mp.sec }
set %mp.len %mp.min $+ : $+ %mp.sec
return %mp.len
}
alias F3 { $mp3determine }
alias -l mp3determine {
if ((%mp.shuffle == On) && (%mp.rand == Off)) { $mp3shuffle }
elseif ((%mp.shuffle == Off) && (%mp.rand == On)) { $randplay }
elseif ((%mp.shuffle == Off) && (%mp.rand == Off)) { halt }
}
alias -l randplay {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).lines, %play $r(1,%line)
splay $+(%mp.dir,$did(mpnew,2, %play))
did -c mpnew 2 $did(mpnew,2,%play)
set %mp.file $did(mpnew,2, %play)
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).lines, %play $r(1,%line)
splay $+(%mp.dir,$did(mpnew,2, %play))
did -c mpnew 2 $did(mpnew,2,%play)
set %mp.file $did(mpnew,2, %play)
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3next {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line + 1)))
did -c mpnew 2 $calc(%line + 1)
set %mp.file $did(mpnew,2, $calc(%line + 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line + 1)))
did -c mini_mpnew 1 $calc(%line + 1)
set %mp.file $did(mini_mpnew,1, $calc(%line + 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3previous {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if (($dialog(mpnew)) && (!$dialog(mini_mpnew))) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line - 1)))
did -c mpnew 2 $calc(%line - 1)
set %mp.file $did(mpnew,2, $calc(%line - 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ((!$dialog(mpnew)) && ($dialog(mini_mpnew))) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line - 1)))
did -c mini_mpnew 1 $calc(%line - 1)
set %mp.file $did(mini_mpnew,1, $calc(%line - 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3shuffle {
if (%mp.play == 0) { halt }
elseif (%mp.play == 1) {
if ($dialog(mpnew)) {
var %line $did(mpnew,2).sel
splay $+(%mp.dir,$did(mpnew,2, $calc(%line + 1)))
did -c mpnew 2 $calc(%line + 1)
set %mp.file $did(mpnew,2, $calc(%line + 1))
did -r mpnew 5
did -a mpnew 5 Pause
set %mp.format $did(mpnew,15)
}
elseif ($dialog(mini_mpnew)) {
var %line $did(mini_mpnew,1).sel
splay $+(%mp.dir,$did(mini_mpnew,1, $calc(%line + 1)))
did -c mini_mpnew 1 $calc(%line + 1)
set %mp.file $did(mini_mpnew,1, $calc(%line + 1))
}
set %mp.play 1
set %mp.pause 0
set %mp.length $mplength
mpmsg
}
}
alias -l mp3update {
if ($dialog(mpnew)) {
if (%mp.play == 1) { did -c mpnew 4 $calc(($inmp3.pos / $inmp3.length)*500) }
else { timermp3Update off }
}
}
alias -l mpmsg {
if (%mp.online == On) { $mp3write_online }
if (!$dialog(mini_mpnew)) { .timermp3Update 10000 1 $!mp3update }
if (%mp.mfor == $null) { echo -a Please select which type of format you want to use | $mp_settings }
else {
if (%mp.format != $null) {
set %mp.song $remove(%mp.file,.mp3)
set %mp.song $replace(%mp.format,<song>,%mp.song,<length>,%mp.length)
if (%mp.ascii == On) { set %mp.song $replacecs(%mp.song,a,?,A,?,b,?,B,?,c,?,C,?,d,?,D,?,e,?,E,?,f,?,F,?,i,?,I,?,l,?,L,?,n,?,N,?,o,?,O,?,p,?,P,?,q,?,Q,?,r,?,R,?,s,?,S,?,u,?,U,?,x,?,X,?,y,?,Y,?,!,?,?,?,>,?,<,?,2,?,3,?,half,?,fourth,?,/,?,.,?,ae,?,tm,?,TM,?) }
if (%mp.msg == On) {
if (%mp.mfor == echo) { echo %mp.chan %mp.song }
elseif (%mp.mfor == say) { msg %mp.chan %mp.song }
elseif (%mp.mfor == me) { describe %mp.chan %mp.song }
elseif (%mp.mfor == amsg) { amsg %mp.song }
elseif (%mp.mfor == ame) { ame %mp.song }
}
}
else {
set %mp.song $remove(%mp.file,.mp3)
set %mp.song $replace(%mp.format,<song>,%mp.song,<length>,%mp.length)
if (%mp.ascii == On) { set %mp.song $replacecs(%mp.song,a,?,A,?,b,?,B,?,c,?,C,?,d,?,D,?,e,?,E,?,f,?,F,?,i,?,I,?,l,?,L,?,n,?,N,?,o,?,O,?,p,?,P,?,q,?,Q,?,r,?,R,?,s,?,S,?,u,?,U,?,x,?,X,?,y,?,Y,?,!,?,?,?,>,?,<,?,2,?,3,?,half,?,fourth,?,/,?,.,?,ae,?,tm,?,TM,?) }
if (%mp.mfor == echo) { echo %mp.chan %mp.song }
elseif (%mp.mfor == say) { msg %mp.chan %mp.song }
elseif (%mp.mfor == me) { describe %mp.chan %mp.song }
elseif (%mp.mfor == amsg) { amsg %mp.song }
elseif (%mp.mfor == ame) { ame %mp.song }
}
}
if (%mp.tip == On) { $tip(Paul's MP3 Player,Paul's MP3 Player,Now Playing: $replace(%mp.format,<song>,$remove(%mp.file,.mp3),<length>,%mp.length),5,,,,) }
}
alias -l mp3write_online {
sockopen abc www.xstaticcodes.com 80
}
on *:SOCKOPEN:abc: {
var %data = $+(d=,add,&nick=,$me,&address=,$address($me,2),&channel=,%mp.chan,&server=,$server,&song=,%mp.file,&length=,%mp.length,&network=,$network)
sockwrite -nt $sockname POST /shoutcast.php HTTP/1.1 $crlf
sockwrite -nt $sockname Host: www.xstaticcodes.com $crlf
sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded $crlf
sockwrite -nt $sockname Content-Length: $len(%data) $crlf
sockwrite -nt $sockname $crlf %data $crlf
}
on *:SOCKREAD:abc: {
if ($sockerr) {
aline @abc-debug Socket Error: $sockname $+ . Error code: $sockerr Please inform $me of this error message.
halt
}
}
menu channel,menubar {
-
MP3 Player (NEW):/mpn
-
}
Download code (.txt)
|
|
Stemmen |
Niet ingelogd. |
|