menu * { MP3 Player:dialog -md mp3 mp3 } dialog -l mp3 { title "MP3 player, v1.3, Written by Clipso" option dbu size -1 -1 240 185 menu "Stuff" 1 item "Information" 2 item "Select a new music directory" 23 item "Help" 22 list 3, 1 0 90 85, vsbar sort list 6, 148 0 90 85, vsbar list 12, 1 93 90 85, 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 "Volume +" 17, 93 77 53 10 button "Volume -" 18, 93 97 53 10 button "Skip Song" 20, 180 102 53 10 button "Previous Song" 21, 180 112 53 10 button "Fix check boxes", 27, 93 110 53 15 edit "" 19, 110 87 17 10, center edit "Search for a song" 10, 1 82 90 10 check "Shuffle Playlist" 13, 148 92 85 10 check "Automatically play next song" 14, 148 82 85 10 check "Mute" 15, 148 102 30 10 check "Pause" 16, 148 112 30 10 combo 24, 148 130 50 10, drop scroll "test", 28, 58 182 120 1, horizontal range 1 1000 text "Inform style" 25, 148 122 30 7 text "The inform style is if you want to amsg/message the active channel/echo the .:Now Playing:. messages, (Some messages are locked on Echo)" 26, 147 142 93 33 text "00:00", 29, 4 176 53 7, right text "00:00", 30, 180 176 103 7 } dialog -l MP3Progress { title "MP3 Player, Loading..." size -1 -1 100 64 option dbu text "", 1, 1 1 100 37 text "", 2, 25 25 50 7 } alias F2 { dialog -md mp3 mp3 } alias -l MVer { return v1.3 } alias -l GetSongs { if (%songdir != $null) { var %a = 0, %b = 1, %c = 0 | while (%a <= $nopath($findfile(%songdir,*.mp3,0))) { inc %a | did -a mp3 3 $remove($nopath($findfile(%Songdir,*.mp3,%a)),.mp3) | $MP3Progress } | while ($read(playlist.txt,%b) != $null) { did -a mp3 6 $read(playlist.txt,%b) | $MP3Progress | 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 } | $Playinfo } | did -o MP3 30 1 $remove($duration($calc($Insong.length /1000),3),00:) | $scroll } alias -l PlaylistAdd { if ($did(mp3,3).seltext != $null) { write playlist.txt $did(mp3,3).seltext | did -a mp3 6 $did(mp3,3).seltext } | if ($did(mp3,12).seltext != $null) { write playlist.txt $did(mp3,12).seltext | did -a mp3 6 $did(mp3,12).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 { $infostyle 5.:4Stopped playing $songname $+ 5:. | .splay stop } } alias -l Nextsong { if ($lines(playlist.txt) >= 1 && %MP3.Check.14 != $null || $did == 20) { if (%MP3.Check.13 != $null) { .splay %songdir $+ $read(playlist.txt,$rand(1,$lines(playlist.txt))) $+ .mp3 } | if ($read(playlist.txt,%PlayNo) == $null) { set %PlayNo 1 } | if (%MP3.Check.13 == $null && $read(playlist.txt,%playno) != $null) { .splay %Songdir $+ $read(playlist.txt,%playno) $+ .mp3 } | $Playinfo | did -o MP3 30 1 $duration($calc($insong.length /1000),3) | $Scroll } } alias -l Songname { var %z = $remove($nopath($insong.fname),.mp3) | return %z } alias -l Playinfo { if (%Infostyle == off) { halt } | $infostyle 5.:4Now playing5:. .:4 $+ $remove($nopath($insong.fname),.mp3) $+ 5:. .:4Length: $iif($left($duration($calc($insong.length /1000),3),2) == 00,$right($duration($calc($insong.length /1000),3),5),$duration($calc($insong.length /1000),3)) $+ , Bit Rate: $sound($insong.fname).bitrate $+ 5:. } alias -l Startup { if (%MP3.Check.13 != $null) { did -c mp3 13 } | if (%MP3.Check.14 != $null) { did -c mp3 14 } | if (%MP3.Check.15 != $null) { did -c mp3 15 } | if (%MP3.Check.16 != $null) { did -c mp3 16 } | did -a mp3 19 $round($calc($vol(wave) /655.35),0) | did -a mp3 24 echo | did -a mp3 24 amsg | did -a mp3 24 msg active | did -a mp3 24 off | unset %C | unset %D | dialog -x MP3Progress } alias -l Mute { if ($insong.fname == $null) { echo -a 5.:4No song is currently playing5:. | did -u mp3 15 | halt } | if (%MP3.Check.15 != $null) { vol -w %oldvol | unset %oldvol } | if (%MP3.Check.15 == $null) { set %oldvol $vol(wave) | vol -w 0 } } alias -l Pause { if ($insong.fname == $null) { echo -a 5.:4No song is currently playing5:. | did -u mp3 16 | halt } | if (%MP3.Check.16 == $null) { .splay pause } | if (%MP3.Check.16 != $null) { .splay resume } } alias -l Volup { if ($vol(wave) == 65535) { echo -a 5.:4Volume is already 1005:. | halt } | if ($vol(wave) < 65535) { vol -w $calc($vol(wave) + 655.35) | did -o mp3 19 1 $round($calc($vol(wave) /655.35),0) | halt } } alias -l Voldown { if ($vol(wave) == 0) { echo -a 5.:4Volume is already at 05:. | halt } | if ($vol(wave) > 0) { vol -w $calc($vol(wave) - 655.35) | did -o mp3 19 1 $round($calc($vol(wave) /655.35),0) | halt } } alias -l Volchange { if ($did(mp3,19) > 100) { echo -a 5.:4100 is the max volume5:. | did -o mp3 19 1 100 | vol -w 65535 | halt } | if ($did(mp3,19) < 0) { echo -a 5.:40 is the lowest volume5:. | did -o mp3 19 1 0 | vol -w 0 | halt } | vol -w $round($calc(655.35 * $did(mp3,19)),0) } alias -l Prevsong { if ($lines(playlist.txt) >= 1) { if (%MP3.Check.13 != $null) { .splay %songdir $+ $read(playlist.txt,$rand(1,$lines(playlist.txt))) $+ .mp3 } | if (%PlayNo == 0) { set %PlayNo $Lines(Playlist.txt) } | if ($read(playlist.txt,%PlayNo) == $null) { set %PlayNo 1 } | if (%MP3.Check.13 == $null && $read(playlist.txt,%playno) != $null) { .splay %Songdir $+ $read(playlist.txt,%playno) $+ .mp3 } | $Playinfo | did -o MP3 30 1 $duration($calc($insong.length /1000),3) | $Scroll } } alias -l Infostyle { if (%Infostyle == msg active && $active != Status Window) { return msg $active } | if ($active == Status Window) { return echo -a } | if (%infostyle == off) { return ; } | else { return %infostyle } } alias -l MP3Progress { var %a = $did(mp3,3).lines, %b = $did(mp3,6).lines | if (%c == $null) { set %c $lines(playlist.txt) | set %d $nopath($findfile(%Songdir,*.mp3,0)) } | did -ra MP3Progress 2 Loaded: $int($Calc(( %a + %b ) / ( %c + %d ) * 100)) $+ $Chr(37) } alias -l Scroll { did -c MP3 28 $Calc($insong.pos / $insong.length *1000) | did -o MP3 29 1 $iif($left($duration($calc($insong.length /1000),3),2) == 00,$right($duration($calc($insong.pos /1000),3),5),$duration($calc($insong.pos /1000),3)) } on 1:dialog:mp3:menu:23: set %Songdir $sdir(C:\,Select your music folder) | did -r mp3 3 | $getsongs on 1:dialog:mp3:menu:2: echo -a 10This mp3 player was written by Clipso. Fe elfree to contact me on irc.swiftirc.net if you need help, or have found a glitch. This is $MVer of this mp3 player. | echo -a 10Enjoy! on 1:dialog:mp3:menu:22: echo -a 10In order for this MP3 player to work, you must tell it where your music is, this can be done by going to File -> Select new music directory. | echo -a 10You can quickly open this mp3 player by pressing the F2 key (Assuming your F2 key doesn't do anything already) | echo -a 10The fix check boxes button is what you should use if your check boxes break, rare, but it happens. (Maybe your song is paused when the Pause is unchecked) on 1:dialog:mp3:init:*: if (%Songdir == $null) { set %Songdir $sdir(C:\,Select your music folder) } | dialog -mdo MP3Progress MP3Progress | did -ra MP3Progress 1 This progress box is just to let you know how much of the mp3 player has been loaded. | did -ra MP3Progress 2 Loaded: 0 $+ $chr(37) | $GetSongs $startup | did -o MP3 30 1 $duration($calc($insong.length /1000),3) | .timerscroll 0 1 /Scroll | /scroll on 1:dialog:MP3Progress:close:*: unset %c | unset %d on 1:dialog:mp3:close:*: .timerscroll off 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: if ($Confirm(Are you sure you want to clear the playlist?) == $True) { write -c playlist.txt | did -r mp3 6 } on 1:dialog:mp3:dclick:3,6,12: $Playsong on 1:dialog:mp3:sclick:3,6,12: $deselect on 1:dialog:mp3:sclick:13,14: if (%MP3.Check. [ $+ [ $did ] ] == $null) { set %MP3.Check. [ $+ [ $did ] ] 1 | halt } | if (%MP3.Check. [ $+ [ $did ] ] != $null) { unset %MP3.Check. [ $+ [ $did ] ] } on 1:dialog:mp3:sclick:15: $mute | if (%MP3.Check.15 == $null) { set %MP3.Check.15 1 | halt } | if (%MP3.Check.15 != $null) { unset %MP3.Check.15 } on 1:dialog:mp3:sclick:16: $Pause | if (%MP3.Check.16 == $null) { set %MP3.Check.16 1 | halt } | if (%MP3.Check.16 != $Nulll) { unset %MP3.Check.16 } on 1:dialog:mp3:sclick:17: $Volup on 1:dialog:mp3:sclick:18: $Voldown on 1:dialog:mp3:sclick:20: inc %PlayNo | $nextsong on 1:dialog:mp3:sclick:21: dec %PlayNo | $PrevSong on 1:dialog:mp3:edit:10: $listfilter on 1:dialog:mp3:edit:19: $volchange on 1:dialog:mp3:sclick:24: if ($did(mp3,24) == echo) { set %infostyle echo -a } | if ($did(mp3,24) == amsg) { set %infostyle amsg } | if ($did(mp3,24) == msg active) | if $chan == #Booty { halt } | { set %infostyle msg active } | if ($did(mp3,24) == off) { set %infostyle off } on 1:dialog:mp3:sclick:27: unset %MP3.Check.* | did -u mp3 13,14,15,16 | if ($insong.fname != $null) { .splay resume | vol -w %oldvol } on 1:dialog:mp3:scroll:28: .splay seek $int($Calc($insong.length / 1000 * $did(mp3,28).sel)) on 1:mp3end: inc %PlayNo | $Nextsong