Debatemne: vonderlippe.dk :: MP3 Player

Oprettet af Brian d. 28/06/2009 07:48
#1


Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/vonderlippe.dk/public_html/includes/bbcodes/url_bbcode_include.php on line 21
Dette er en lille MP3 player.

copy/past koden ind i scripts-editor/remote, og så skulle den være kørende.

For at bruge den, så skal du bare højre klikke i en channel, og nu skulle du have fået en ny valgmulighed (mp3).....vælg dette, og du har musik :)

Kode
menu channel {
MP3
.MP3:/aud
}
alias aud dialog -md aud aud
dialog aud {
title "Audio Player"
size -1 -1 157 155
option dbu
list 14, 6 7 145 67, size
box "Song List", 15, 3 0 151 78
button "Play", 13, 3 80 27 12, flat
button "Stop", 16, 34 80 27 12, flat
button "< Prev", 17, 65 80 27 12, flat
button "Next >", 18, 96 80 27 12, flat
button "Pause", 19, 127 80 27 12, flat
edit "No Song Is Playing", 20, 2 96 112 10, read
scroll "", 22, 3 109 151 8, range 100 horizontal bottom
box "Volume Control", 23, 3 119 151 21
button "+", 24, 11 127 10 10
button "-", 25, 63 127 10 10
text "Volume Up", 26, 24 128 30 8
text "Volume Down", 27, 76 128 35 8
check "Mute", 28, 120 127 26 10
text "00:00", 29, 116 97 14 8
text "/", 30, 132 97 4 8
text "00:00", 31, 137 97 15 8
edit "", 21, 3 143 87 10
button "Search", 32, 93 143 27 10, ok flat
link "clan-brb.dk", 33, 124 146 32 8
menu "File", 1
item "Add Dir", 2, 1
item "Add File", 3, 1
item "Remove File", 4, 1
item "Clear List", 5, 1
item "Save List", 6, 1
menu "Edit", 7
menu "Spam Message", 9, 7
item "Spam Message", 34, 9
item "Edit Message", 35, 9
item "ID3 Tags", 10, 7
menu "Options", 8
item "Repeat", 11, 8
item "Shuffle", 12, 8
}
on *:dialog:aud:init:0:{
if ($isfile(tsong.hsh)) {
if ($hget(tsong)) {
hload tsong tsong.hsh
}
else {
hmake tsong 100
hload tsong tsong.hsh
}
}
var %x = 1
while (%x <= $hget(tsong,0).item) {
did -a aud 14 $nopath($hget(tsong,%x))
inc %x
}
if ($didwm(aud,14,*$song $artist $length*)) {
did -d aud 14 $v1
}
elseif ($hget(tsong,spam)) {
if ($did(aud,14).lines == $hget(tsong,0).item) {
did -d aud 14 $did(aud,14).lines
}
}
}
on *:dialog:aud:menu:2:{
var %dir $sdir(C:\,Music Files)
did -r aud 14
var %x 1
while ($findfile(%dir,*.mp3,%x) != $null ) {
did -a aud 14 $nopath($findfile(%dir,*.mp3,%x))
hadd -m tsong %x $findfile(%dir,*.mp3,%x)
inc %x
}
var %x 1
while ($findfile(%dir,*.wav,%x) != $null ) {
did -a aud 14 $nopath($findfile(%dir,*.wav,%x))
hadd -m tsong %x $findfile(%dir,*.wav,%x)
inc %x
}
var %x 1
while ($findfile(%dir,*.midi,%x) != $null ) {
did -a aud 14 $nopath($findfile(%dir,*.midi,%x))
hadd -m tsong %x $findfile(%dir,*.midi,%x)
inc %x
}
}
on *:dialog:aud:menu:3:{
var %file $sfile(C:\,Music Files)
did -a aud 14 $nopath(%file)
hadd -m tsong $hget(tsong,0).item %file
}
on *:dialog:aud:menu:4:{
if ($did(aud,14).sel == $null) {
did -ra aud 20 Error: No Song Selected to Remove
.timermp3status 1 3 did -ra aud 20 No Song Is Playing
}
else {
hdel -w tsong $hfind(tsong,$+(*,$did(aud,14).seltext,*),w,1).data
did -d aud 14 $did(aud,14).sel
}
}
on *:dialog:aud:menu:5:{
did -r aud 14
hfree tsong
.remove tsong.hsh
}
on *:dialog:aud:menu:6:{
hsave -o tsong tsong.hsh
echo -s Play List Saved.
}
on *:dialog:aud:menu:10: dialog -m id3 id3
on *:dialog:aud:menu:11:{
if ($did(12).state == 1) {
did -u aud 12
$iif($did(11).state == 1,did -u $dname 11,did -c $dname 11)
}
else $iif($did(11).state == 1,did -u $dname 11,did -c $dname 11)
}
on *:dialog:aud:menu:12:{
if ($did(11).state == 1) {
did -u aud 11
$iif($did(12).state == 1,did -u $dname 12,did -c $dname 12)
}
else $iif($did(12).state == 1,did -u $dname 12,did -c $dname 12)
}
on *:dialog:aud:menu:34: $iif($did(34).state == 1,did -u $dname 34,did -c $dname 34)
on *:dialog:aud:menu:35: dialog -m spam spam
on *:dialog:aud:close:0:{
splay stop
.timerpos off
}
on *:dialog:aud:sclick:13: audplay
on *:dialog:aud:sclick:16: stop
on *:dialog:aud:sclick:17: prev
on *:dialog:aud:sclick:18: next
on *:dialog:aud:sclick:19:{
if ($insong == $true) && (!$insong.pause) {
splay pause
did -ra aud 19 Resume
}
elseif ($insong.pause) {
splay resume
did -ra aud 19 Pause
}
}
on *:dialog:aud:sclick:24: vol -v $calc($vol(master) + 2000)
on *:dialog:aud:sclick:25: vol -v $calc($vol(master) - 2000)
on *:dialog:aud:sclick:28: $iif($did(28).state == 1,vol -pu1,vol -pu2)
on *:dialog:aud:dclick:14: audplay
on *:dialog:aud:sclick:32:{
did -c aud 14 $didwm(aud,14,$+(*,$did(aud,21),*),1)
did -r aud 21
halt
}
on *:dialog:aud:sclick:33: run http://www.clan-brb.dk/
; Below is part of nTOxIc8's
; mp3player seek/scroll bar
on *:dialog:aud:scroll:22:{
if ($devent == scroll) {
if ($did == 22) {
if ($insong == $true) {
var %t $round($calc($did(aud,22).sel / 22000 * $insong.length),0)
splay seek $calc((%t + $did(aud,22).sel) * 200)
}
}
}
}
on *:mp3end: next
on *:waveend: next
on *:midiend: next
alias audplay {
if ($did(aud,14).lines == 0) {
did -ra aud 20 No Playlist
halt
}
elseif ($did(aud,14).sel == $null) {
did -ra aud 20 No Song Selected
halt
}
else {
if ($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).title != $null) {
did -ra aud 20 Playing: $sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).title
did -ra aud 31 $asctime($calc($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).length / 1000 ),nn:ss)
.timerpos 0 1 pos.seek
splay $hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)
}
else {
did -ra aud 20 Playing: $did(aud,14).seltext
did -ra aud 31 $asctime($calc($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).length / 1000 ),nn:ss)
.timerpos 0 1 pos.seek
splay $hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)
}
}
if ($did(aud,34).state == 1) {
if ($hget(tsong,spam)) {
if ($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).title == $null) && ($did(aud,34).state == 1) msg $active Jamming to $did(aud,14).seltext
else $iif($did(aud,34).state == 1,$($+($hget(tsong,spam)),2),return)
}
}
}
alias stop {
splay stop
.timerpos off
did -ra aud 20 No Song Is Playing
did -ra aud 31 00:00
did -ra aud 29 00:00
}
alias prev {
splay stop
.timerpos off
if ($did(aud,12).state == 1) {
if ($hget(tsong,spam)) {
did -c aud 14 $r(1,$calc($hget(tsong,0).item - 1))
audplay
}
else {
did -c aud 14 $r(1,$hget(tsong,0).item)
audplay
}
}
elseif ($did(aud,11).state == 1) { audplay }
else {
did -c aud 14 $calc($did(aud,14).sel - 1)
audplay
}
}
alias next {
splay stop
.timerpos off
if ($did(aud,12).state == 1) {
if ($hget(tsong,spam)) {
did -c aud 14 $r(1,$calc($hget(tsong,0).item - 1))
audplay
}
else {
did -c aud 14 $r(1,$hget(tsong,0).item)
audplay
}
}
elseif ($did(aud,11).state == 1) { audplay }
elseif ($did(aud,14).sel == $did(aud,14).lines) && ($did(aud,11).state == 0) && ($did(aud,12).state == 0) {
did -c aud 14 1
audplay
}
else {
did -c aud 14 $calc($did(aud,14).sel + 1)
audplay
}
}
; Below is part of nTOxIc8's
; mp3player seek/scroll bar
alias -l pos.seek {
if ($dialog(aud) != $null) && ($inmp3 == $true) {
did -c aud 22 $round($calc($calc($insong.pos / $insong.length) * 100),0)
;the below line was basically written by the good ImthePariah
did -ra aud 29 $+($gettok($duration($calc($insong.pos / 1000),3),2-,58),/,$gettok($duration($calc($insong.length / 1000),3),2-,58))
}
elseif ($dialog(aud) == $null) {
.timerpos off
}
}
alias length {
return $asctime($calc($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).length / 1000 ),nn:ss)
}
alias artist {
return $sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).artist
}
alias song {
return $sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).title
}
alias bit {
return $sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).bitrate
}
alias jam {
if ($hget(tsong,spam)) {
if ($sound($hget(tsong,$hfind(tsong,$+(*,$did(aud,14).seltext,*),1,w).data)).title == $null) msg $active Jamming to $did(aud,14).seltext
else $($+($hget(tsong,spam)),2)
}
else echo -a No Spam Message set.
}
dialog spam {
title "Spam Message"
size -1 -1 147 82
option dbu
radio "Message all channels", 1, 2 3 63 10,
radio "Describe all channels", 2, 75 3 64 10, group
radio "Message active channels", 3, 2 16 72 10, group
radio "Describe active channels", 4, 75 16 71 10, group
text "Select one of the above boxes and fill in the message that you would like to use for your spam message. You can use the following identifiers to return song info. $length = Song length $artist = Artist $song = Title $bit = Bitrate", 5, 1 27 145 28
edit "", 6, 25 57 115 10, autohs
text "Message:", 7, 1 58 24 8
button "Set", 8, 7 70 25 10, ok flat
button "Cancel", 9, 34 70 25 10, cancel flat
}
on *:dialog:spam:init:0:{
if ($gettok($hget(tsong,spam),1,32) == msg) did -c spam 3
if ($gettok($hget(tsong,spam),1,32) == describe) did -c spam 4
if ($gettok($hget(tsong,spam),1,32) == amsg) did -c spam 1
if ($gettok($hget(tsong,spam),1,32) == ame) did -c spam 2
if ($gettok($hget(tsong,spam),1,32) == msg) || ($gettok($hget(tsong,spam),1,32) == describe) {
$iif($hget(tsong,spam),did -a spam 6 $gettok($hget(tsong,spam),3-,32),return)
}
else {
$iif($hget(tsong,spam),did -a spam 6 $gettok($hget(tsong,spam),2-,32),return)
}
}
on *:dialog:spam:sclick:1: did -u spam 2,3,4
on *:dialog:spam:sclick:2: did -u spam 1,3,4
on *:dialog:spam:sclick:3: did -u spam 1,2,4
on *:dialog:spam:sclick:4: did -u spam 1,2,3
on *:dialog:spam:sclick:8:{
if ($did(spam,1).state == 0) && ($did(spam,2).state == 0) && ($did(spam,3).state == 0) && ($did(spam,4).state == 0) {
did -ra spam 6 You need to check a message type.
halt
}
else {
if ($did(spam,1).state == 1) hadd -m tsong Spam amsg $did(spam,6)
elseif ($did(spam,2).state == 1) hadd -m tsong Spam ame $did(spam,6)
elseif ($did(spam,3).state == 1) hadd -m tsong Spam msg $eval($active,0) $did(spam,6)
elseif ($did(spam,4).state == 1) hadd -m tsong Spam describe $eval($active,0) $did(spam,6)
}
}
dialog id3 {
title "Id3 Changer"
size -1 -1 88 90
option dbu
list 1, 1 0 86 52, size
text "Title:", 2, 2 54 13 8
text "Artist:", 3, 2 65 14 8
edit "", 4, 16 53 66 10, autohs
edit "", 5, 16 64 66 10, autohs
button "Save", 6, 3 76 22 12, flat
button "Close", 7, 33 76 22 12, flat ok
button "Cancel", 8, 63 76 22 12, flat cancel
}
on *:dialog:id3:init:0:{
var %x = 1
while (%x <= $hget(tsong,0).item) {
did -a id3 1 $nopath($hget(tsong,%x))
inc %x
}
if ($didwm(aud,14,*$song $artist $length*)) {
did -d id3 1 $v1
}
elseif ($hget(tsong,spam)) {
if ($did(id3,1).lines == $hget(tsong,0).item) {
did -d id3 1 $did(id3,1).lines
}
}
}
on *:dialog:id3:dclick:1:{
set %song $hget(tsong,$hfind(tsong,$+(*,$did(id3,1).seltext,*),1,w).data)
did -r id3 5,4
if ($sound(%song).artist) did -a id3 5 $ifmatch
if ($sound(%song).title) did -a id3 4 $ifmatch
}
on *:dialog:id3:sclick:6:{
$EDIT($shortfn(%song),1,4)
$EDIT($shortfn(%song),2,5)
}
; Following piece of code from PR|MuS's MiniID3 Editor
; Seeing as I know nothing about Binvars XP
; http://www.mircscripts.org/showdoc.php?type=code&id=1186
; Author: PR|MuS
; Email: Shredplayer@email.com
alias -l EDIT {
bread $1 $B_CALC($1,128) 3 &tag
if ($bvar(&tag,1-3).text != TAG) {
bwrite $1 $B_CALC($1,128) 3 TAG
bset &fill 125 0
bwrite $1 $B_CALC($1,125) 124 &fill
bunset &fill
}
if ($did(id3,4)) || ($did(id3,5)) {
bset &val $N_BYTE($2) $did(id3,$3)
bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) &val
$iif($2 < 6,.bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) $did(id3,$3))
}
else {
bset &val 30 $asc($chr(32))
bwrite $1 $S_BYTE($1,$2) $N_BYTE($2) &val
}
bunset &val
}
alias -l B_CALC return $calc($file($1).size - $2)
alias -l N_BYTE return $gettok(30 30 30 4 30 1,$1,32)
alias -l S_BYTE return $calc($file($1).size - $gettok(125 95 65 35 31 1,$2,32))






made by tank59 (lavet en anelse om af undertegnede