All pastes #556938 Raw Edit

mIRC mp3 player

public text v1 · immutable
·published 2007-06-10 20:17 UTC
rendered paste body
;copy everything here
;go to mIRC
;press alt + r
;paste everything in there
;click ok
;right click the active chat window and go to mp3 player
;This is still incomplete. some things don't do anything yet..
;Written by Clipso

menu * {
  MP3 Player:dialog -md mp3 mp3
}
dialog -l mp3 {
  title "MP3 player, Written by Clipso"
  option dbu
  size -1 -1 300 200
  menu "File" 1
  item "Get song list" 2, 1
  list 3, 1 0 90 90, hsbar vsbar sort
  list 6, 148 0 90 90, hsbar vsbar
  list 12, 1 93 90 90, hsbar vsbar
  button "Play" 4, 93 54 25 20
  button "Stop" 5, 120 54 25 20
  button "Add to Playlist" 7, 93 0 54 15
  button "Remove from playlist" 8, 93 18 54 15
  button "Clear the playlist" 9, 93 36 54 15
  button "Search" 11, 72 82 20 10
  edit "" 10, 1 82 70 10
  check "Shuffle Playlist" 13, 148 92 45 10
  check "Automatically play next song" 14, 148 82 85 10
  check "Mute" 15, 
}
alias -l GetSongs { if (%songdir != $null) { var %a = 0, %b = 1 | while (%a <= $nopath($findfile(%songdir,*.mp3,0))) { inc %a | did -a mp3 3 $remove($nopath($findfile(%Songdir,*.mp3,%a)),.mp3) } | while ($read(playlist.txt,%b) != $null) { did -a mp3 6 $read(playlist.txt,%b) | inc %b } | if ($did(mp3,3,1).text == $null) { did -d mp3 3 1 } } }
alias -l Playsong { if ($did(mp3,3).seltext != $null) { .splay %Songdir $+ $did(mp3,3).seltext $+ .mp3 } | if ($did(mp3,6).seltext != $null) { .splay %Songdir $+ $did(mp3,6).seltext $+ .mp3 } | if ($did(mp3,12).seltext != $null) { .splay %Songdir $+ $did(mp3,12).seltext $+ .mp3 } | echo -a 5.:4Now Playing5:. .:4 $+ $remove($nopath($insong.fname),.mp3) $+ 5:. } }
alias -l PlaylistAdd { if ($did(mp3,3).seltext != $null) { write playlist.txt $did(mp3,3).seltext | did -a mp3 6 $did(mp3,3).seltext } }
alias -l PlaylistDel { if ($did(mp3,6).seltext != $null) { var %a = 1 | while ($read(playlist.txt,%a) != $Null) { if ($did(mp3,6).seltext == $read(playlist.txt,%a)) { write -dl $+ %a playlist.txt | did -d mp3 6 $did(mp3,6).sel } | inc %a } } }
alias -l Listfilter { if ($did(mp3,10,1).text != $null) { did -r mp3 12 | var %a = 0 | While (%a <= $did(mp3,3).lines) { if ($did(mp3,10,1).text isin $did(mp3,3,%a).text) { did -a mp3 12 $did(mp3,3,%a).text } | inc %a } } }
alias -l Deselect { if ($did == 3) { did -u mp3 6,12 } | if ($did == 6) { did -u mp3 3,12 } | if ($did == 12) { did -u mp3 3,6 } }
alias -l Stopplay { if ($insong.fname == $null) { echo -a 5.:4No song is currently playing5:. | halt } | else { echo -a 5.:4Stopped playing $remove($nopath($insong.fname),.mp3) $+ 5:. | .splay stop } }
alias -l Nextsong { if ($did(mp3,6).lines <= 1) { .splay %songdir $+ $did(mp3,6,$rand(1,$did(mp3,6).lines)) $+ .mp3 | echo -a 5.:4Now Playing5:. .:4 $+ $remove($nopath($insong.fname),.mp3) $+ 5:. } }
on 1:dialog:mp3:menu:2: set %Songdir $sdir(C:\,Select your music folder) | $getsongs
on 1:dialog:mp3:init:*: $GetSongs 
on 1:dialog:mp3:sclick:4: $Playsong 
on 1:dialog:mp3:sclick:5: $Stopplay
on 1:dialog:mp3:sclick:7: $PlaylistAdd
on 1:dialog:mp3:sclick:8: $PlaylistDel
on 1:dialog:mp3:sclick:9: write -c playlist.txt | did -r mp3 6
on 1:dialog:mp3:dclick:3,6,12: $Playsong
on 1:dialog:mp3:sclick:11: $listfilter
on 1:dialog:mp3:sclick:3,6,12: $deselect
on 1:mp3end: $Nextsong