MP3 player

By F*U*R*B*Y* on Jul 10, 2005

put it in remotes and right click in the channel window and select mp3

alias mp { if ($dialog(mp)) dialog -v mp | else dialog -md mp mp }
alias mp3data { return $+(",$shortfn($scriptdirmp3data.ini),") }

dialog mp {
  title "Paul's Mp3 Player"
  size -1 -1 266 180
  option dbu
  box "Playlist", 1, 6 6 194 89
  list 2, 11 13 185 80, sort extsel
  button "Close", 3, 205 14 22 11, ok cancel
  box "Controls", 4, 7 99 118 44
  button "Rewind", 5, 10 108 34 11
  button "Play", 6, 48 108 34 11
  button "Stop", 7, 25 122 34 11
  button "Pause", 8, 85 108 34 11
  button "Forward", 9, 67 122 34 11
  box "Browse", 10, 8 151 249 24
  button "Mp3 Dir", 11, 11 159 34 11
  button "Refresh", 12, 213 159 34 11
  edit "", 13, 49 159 151 11, read
  box "Volume", 14, 128 99 60 24
  button "+", 15, 131 108 10 11
  button "-", 16, 143 108 10 11
  button "Mute", 17, 160 108 24 11
  box "Tunes Found", 18, 133 125 46 24
  edit "", 19, 136 134 40 11, read
  box "Message", 20, 191 99 71 24
  check "Message in Channel", 21, 197 109 64 10
}

on *:dialog:mp:init:0: { if (%mp.pause == 1) { did -r mp 8 | did -a mp 8 Resume } | if ($vol(master).mute == $true) { did -o mp 17 1 Unmute } | if (%mp.msg == On) { did -c mp 21 } | did -o mp 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,did -a mp 2 $nopath($1-)) | did -o mp 19 1 %mp.found }
on *:dialog:mp:dclick:4: { splay %mp.temp | set %mp.play 1 | set %mp.pause 0 | did -r mp 8 | did -a mp 8 Pause | mpmsg }
on *:dialog:mp:sclick: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) }
on *:dialog:mp:sclick:5: { if (%mp.play == 0) { halt } | else { splay seek $calc($inmp3.pos -5000) } }
on *:dialog:mp:sclick:6: { splay %mp.dir $+ %mp.file | set %mp.play 1 | set %mp.pause 0 | did -r mp 8 | did -a mp 8 Pause | mpmsg }
on *:dialog:mp:sclick:7: { splay stop | set %mp.play 0 | set %mp.pause 0 | did -r mp 8 | did -a mp 8 Pause  }
on *:dialog:mp:sclick:8: { if (%mp.play == 0) { halt } | elseif (%mp.pause == 1) { splay resume | set %mp.pause 0 | did -r mp 8 | did -a mp 8 Pause } | elseif ((%mp.play == 1) && (%mp.pause == 0)) { splay pause | set %mp.pause 1 | did -r mp 8 | did -a mp 8 Resume  } }
on *:dialog:mp:sclick:9: { if (%mp.play == 0) { halt } | else { splay seek $calc($inmp3.pos +5000) } | halt }
on *:dialog:mp:sclick:11: { did -r mp 2 | set %mp.dir $sdir="Mp3 directory" c:\ | did -o mp 13 1 %mp.dir | set %mp.found $findfile(%mp.dir, *.mp3,0,did -a mp 2 $nopath($1-)) | did -o mp 19 1 %mp.found }
on *:dialog:mp:sclick:12: { did -r mp 2 | set %mp.found $findfile(%mp.dir, *.mp3,0,did -a mp 2 $nopath($1-)) | did -o mp 19 1 %mp.found }
on *:dialog:mp:sclick:15: { if (%mp.play == 0) { halt } | if ($vol(master).mute == $true) { halt } | else { set %mp.vol $calc($vol(master)+7000) | vol -v %mp.vol | set %mp.vol 0 } }
on *:dialog:mp:sclick:16: { if (%mp.play == 0) { halt } | if ($vol(master).mute == $true) { halt } | else { if ($vol(master) < 7000) { vol -v 0 } | elseif ($vol(master) == 0) { halt } | else { set %mp.vol $calc($vol(master)-7000) | vol -v %mp.vol | set %mp.vol 0  } } }
on *:dialog:mp:sclick:17: { if (%mp.play == 0) { halt } | if ($vol(master).mute == $false) { vol -vu1 | did -o mp 17 1 Unmute } | elseif ($vol(master).mute == $true) { vol -vu2 | did -o mp 17 1 Mute } }
on *:dialog:mp:sclick:21: { if (%mp.msg == On) { set %mp.msg Off } | else { set %mp.msg On } }

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 -l mpmsg { if (%mp.msg == On) ame 1[3: 1Paul's Mp3 Player 3:1] [3: 1Plays:  $remove(%mp.file,.mp3)  3:1] }

menu channel,menubar {
  -
  MP3 Player:/mp
  -

Comments

Sign in to comment.
vinetio   -  Aug 17, 2007

Nice :D
Had to edit it though so that it only messages one channel (got banned for using colours by the way :p)

Anyway, very nice 9/10

 Respond  
Noutrious   -  Jul 22, 2005

I think this script is perfect... Of course better can be allways [This time design] but for functions it`s great! Good job dude!

 Respond  
xDaeMoN   -  Jul 22, 2005

That is if you really scripted this =P

 Respond  
F*U*R*B*Y*   -  Jul 22, 2005

thnxs

 Respond  
aaslyfox   -  Jul 21, 2005

Looks good. nicely scripted

 Respond  
F*U*R*B*Y*   -  Jul 11, 2005

i accidently double posted

 Respond  
DarthReven   -  Jul 10, 2005

please don\'t double post your snippets

 Respond  
LIQUID_NiTrO   -  Jul 10, 2005

fergot the closing bracket at the end.
Other than that not bad, looks like ya didn\'t rip this one ;)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.