MP3 Player

By ^Neptune on Apr 09, 2008

Image
Made by Neptune and Daveoh.

The final version of my MP3 Player, has everything you can possibly think of! To get this baby loaded, slap it in remotes. You'll see the dialog pop up and close.. don't worry about it, it's just setting variables.

This MP3 Player features everything.. literally. Here's a list of features:
-Marquee now playing song
-Position Bar (change the position of the mp3)
-Previous, Stop, Next, Pause and Play buttons
-Volume Bar
-Add dir, remove all, add file and delete file options
-Random, coninuous and repeat functions
-Broadcasting (spam)
-Export to text
-Function Keys
-ID3 Tag Editor (Made by PR|MUS, credits in code)
-Mini Mode
-Style Changer
-Help topics

Updates since last version:
-When dialog is opened, Played: box shows the played number instead of "0"
-Normal radio box is unticked if continuous box is ticked
-The channel specification is fixed in broadvasting
-ID3 Tag Editor
-New tags! &year and &comment

ABOUT THE ID3 TAG EDITOR:
ID3 Tag Editor
Author: PR|MuS
Email: Shredplayer@email.com
Script Environment: Remotes
Comments: a mini ID3 editor for editing ID3 Tags

I have used this purely because I know NOTHING about binary things, I have given full credit, so it has not been ripped.

Updates!
-When dialog is opened, Played: box shows the played number instead of "0"
-Normal radio box is unticked if continuous box is ticked
-The channel specification is fixed in broadvasting
-ID3 Tag Editor
-New tags! &year and &comment

Please give me suggestions / error reports (shouldn't be any) on anything you can think of! Enjoy!

/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ MP3 Player | Chars: 40974 | Lines: 1208 @
@ Credits: Neptune: irc.PurpleSurge.com   @
@          Daveoh: irc.Quakenet.org       @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/

#fkeys on
;function key aliases
alias f10 { $run.mp3 }
alias f11 { if ($inmp3) { if ($inmp3.pause) splay resume | else splay pause } }
alias f12 { mp3broadcast }
#fkeys end

;on load events
on *:load: {
  set %dialog mp3
  echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/0,1 Thank you for downloading this MP3 Player.
  echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/0,1 To open, type /mp3 or right-click anywhere and select MP3.
}

;menu
menu * {
  .MP3 Player: { $run.mp3 }
}

;alias to open dialog
alias mp3 { $run.mp3 }

;mp3 player dialog
dialog mp3 {
  title "MP3 Player"
  size -1 -1 387 375
  option pixels %notheme
  list 1, 5 5 185 290, hsbar vsbar size
  edit "", 2, 203 25 170 20, read autohs
  button "<<", 5, 200 110 50 20, flat
  button "||", 6, 230 135 50 20, flat
  button "|>", 7, 300 135 50 20, flat
  button ">>", 8, 330 110 50 20, flat
  button "Directory", 9, 203 226 80 25, flat
  scroll "", 13, 203 70 170 16, horizontal range 0 100
  box "Now Playing", 10, 193 9 190 41
  box "Position", 11, 193 55 190 36
  button "[]", 22, 265 110 50 20, flat
  box "Control", 4, 193 95 190 65
  button "Remove All", 26, 293 226 80 25, flat
  button "Add File", 27, 203 264 80 25, flat
  button "Delete File", 28, 293 264 80 25, flat
  box "MP3's", 29, 193 211 190 83
  scroll "", 12, 203 183 170 16, horizontal range 0 65535
  box "Volume", 14, 193 166 190 40       
  edit "", 3, 5 325 185 20, read
  edit "", 34, 5 350 185 20, read
  button "Center", 20, 205 325 170 20, flat
  button "Hide", 19, 205 350 170 20, flat
  button "MP3 Information of what's playing", 18, 4 300 185 20, flat
  button "Broadcast Now!", 23, 205 300 170 20, flat
  menu "File", 15
  item "Options", 16, 15
  item "Broadcasting", 17, 15
  item "break", 30, 15
  item "Exit", 21, 15
  menu "Tools", 30
  menu "Export to Text", 33, 30
  item "Write to MP3 List", 36, 33
  item "View MP3 List", 35, 33
  menu "Function Keys", 45, 30
  item "On", 46, 45
  item "Off", 47, 45
  item "Status", 48, 45
  item "break", 51, 30
  item "Advertise", 49, 30
  item "break", 50, 30
  item "ID3 Tag Editor", 44, 30
  menu "View", 37
  item "Mini Mode", 39, 37
  menu "Style", 40, 37
  item "Themed", 41, 40
  item "Retro", 42, 40
  menu "Help", 24
  item "Topics", 31, 24
  item "break", 32, 24
  item "About", 25, 24
}

;advertising
on *:dialog:mp3:menu:49: {
  msg $active 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 I am using the MP3 Player, found @ http://www.hawkee.com/snippet/4267/
}

;enable function keys
on *:dialog:mp3:menu:46: { 
  enable #fkeys 
  echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 Function Keys are now on.
}

;disable function keys 
on *:dialog:mp3:menu:47: { 
  disable #fkeys 
  echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 Function Keys are now off.
}

;view status
on *:dialog:mp3:menu:48: { 
  if ($group(#fkeys) == on) { 
    echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 Function Keys are currently on. 
  }
  elseif ($group(#fkeys) == off) { 
    echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 Function Keys are currently off.
  }
}

;open id3 tag editor
on *:dialog:mp3:menu:44: { $id3.open }

;open mp3 info dialog
on *:dialog:mp3:sclick:18: { dialog -md mp3.info mp3.info }

;mp3 info dialog
dialog mp3.info {
  title "MP3 Information"
  size -1 -1 360 219
  option pixels notheme
  edit "", 1, 0 0 360 20, read
  edit "", 2, 0 20 360 20, read
  edit "", 3, 0 40 360 20, read
  edit "", 4, 0 60 360 20, read
  button "Close", 6, 0 200 360 18, flat
  edit "", 5, 0 80 360 20, read
  edit "", 8, 0 100 360 20, read
  edit "", 9, 0 140 360 20, read
  edit "", 10, 0 120 360 20, read
  edit "", 7, 1 160 360 20, read
  edit "", 11, 1 180 360 20, read
}

;mp3 info initialization
on *:dialog:mp3.info:init:0: {
  var %title2 = $iif($sound($read(playlist.txt,%songnum)).title,$v1,$regsubex($gettok($nopath($inmp3.fname),-1,45),/(.mp3)$/,)) 
  var %artist2 = $iif($sound($read(playlist.txt,$did(1).sel)).artist,$v1,$gettok($nopath($inmp3.fname),-2,45))
  var %len2 = $remove($duration($calc($inmp3.length /1000),3),00:)
  var %bit2 = $sound($read(playlist.txt,%songnum)).bitrate
  var %genre2 = $iif($sound($insong.fname).genre, $sound($insong.fname).genre, Unknown genre)
  var %album2 = $iif($sound($insong.fname).album, $sound($insong.fname).album, Unknown album)  
  var %size2 = $bytes($file($insong.fname).size).suf
  var %year2 = $iif($sound($insong.fname).year, $sound($insong.fname).year, Unknown year)
  var %comment2 = $iif($sound($insong.fname).comment, $sound($insong.fname).comment, No comment)
  did -a $dname 1 Title: %title2
  did -a $dname 2 Artist: %artist2
  did -a $dname 3 Length: %len2
  did -a $dname 4 Played: $readini(playcount.ini,plays,$replace($inmp3.fname,$chr(32),_))) time(s)
  did -a $dname 5 Album: %album2
  did -a $dname 8 Genre: %genre2
  did -a $dname 9 Year: %year2
  did -a $dname 10 Comment: %comment2
  did -a $dname 7 Size: %size2
  did -a $dname 11 Bitrate: %bit2 $+ kbps
}

;mp3 info close
on *:dialog:mp3.info:sclick:6: { dialog -x $dname }

;broadcast now button
on *:dialog:mp3:sclick:23: { mp3broadcast }

;dialog themes
on *:dialog:mp3:menu:41: {
  unset %notheme
  dialog -x $dname
  dialog -md mp3 mp3
}

on *:dialog:mp3:menu:42: {
  set %notheme notheme
  dialog -x $dname
  dialog -md mp3 mp3
}

;mp3 dialog initialisation
on *:dialog:mp3:init:0:{
  var %a = 1, %b = playlist.txt
  while ( %a <= $lines(%b) ) {
    did -a $dname 1 $left($nopath($read(%b,%a)),-4)
    inc %a
  }
  did -a $dname 34 Played: $readini(playcount.ini,plays,$replace($inmp3.fname,$chr(32),_)))
  did -z $dname 1
  did -a $dname 3 Total MP3's: $did(1).lines
  did -c $dname 12 $vol(master)
  if ( $readini(playcount.ini,plays,$replace($read(playlist.txt,%songnum),$chr(32),_)) ) did -o $dname 34 1 Played: $v1
  if ( $inmp3 ) {
    did -c $dname 1 %songnum
    did -o $dname 2 1 $left($nopath($inmp3.fname),-4)
    did -z $dname 13 0 10000
    did -c $dname 13 $calc(($inmp3.pos / $inmp3.length)*10000)
    .timerpos.update -r
    if ( %mp3.sm != none && $width($left($nopath($inmp3.fname),-4),Arial,10) > 150 ) .timerscrolltitle 0 1 scrolltitle
  }
}

;dialog close
on *:dialog:mp3:close:0: {
  .timerpos.update -p
  .timerscrolltitle off
  set %dialog mp3
}

;dialog buttons
;click in list
on *:dialog:mp3:dclick:1: {
  set %songnum $did(1).sel
  mp3play $read(playlist.txt,%songnum)
}

on *:dialog:mp3:sclick:1: {
  did -ra $dname 34 Played: $iif($readini(playcount.ini,plays,$replace($read(playlist.txt,$did(1).sel),$chr(32),_)),$v1,0) 
}

;position scrollbar
on *:dialog:mp3:scroll:13: {
  if ( !$inmp3 ) halt
  if ( !%mp3tseek ) { .timerpos.update -p | set %mp3tseek $true }
  .timermp3tseek -m 1 500 splay seek $int($calc(($did(13).sel /10000) * $inmp3.length)) $chr(124) unset %mp3tseek $chr(124) .timerpos.update -r
}

;back button
on *:dialog:mp3:sclick:5: {
  if ( %rplay ) did -c $dname 1 $r(1,$did($dname,1).lines)
  elseif ( $did($dname,1).sel == 1 ) halt
  did -c $dname 1 $calc($v1 - 1)
  set %songnum $did($dname,1).sel
  mp3play $read(playlist.txt,%songnum)
}

;stop button
on *:dialog:mp3:sclick:22: { mp3stop }

;forward button
on *:dialog:mp3:sclick:8: {
  if ( %rplay ) did -c $dname 1 $r(1,$did($dname,1).lines)
  else did -c $dname 1 $calc($did($dname,1).sel + 1)
  set %songnum $did($dname,1).sel
  mp3play $read(playlist.txt,%songnum)
}

;pause button
on *:dialog:mp3:sclick:6: {
  if ( $inmp3 ) {
    set %pauseb on
    if ( !$inmp3.pause ) splay pause
    else splay resume
    set %pauseb off
  }
}

;play button
on *:dialog:mp3:sclick:7: { 
  if ($inmp3.pause) { 
    splay resume
  }
  else {
    set %songnum $did(1).sel
    mp3play $read(playlist.txt,%songnum)
  }
}

;volume scrollbar
on *:dialog:mp3:scroll:12: { 
  vol -v $did($did).sel 
}

;directory button
on *:dialog:mp3:sclick:9: { mp3choosedir }

;remove all button
on *:dialog:mp3:sclick:26: { mp3remall }

;add file button
on *:dialog:mp3:sclick:27: { mp3addfile }

;delete file button
on *:dialog:mp3:sclick:28: { mp3remfile }

;close button
on *:dialog:mp3:sclick:19: {
  .timerpos.update -p
  .timerscrolltitle off
  set %dialog mp3
  dialog -x $dname
}

;menu item exit
on *:dialog:mp3:menu:21: {
  .timerpos.update -p
  set %dialog mp3
  dialog -x $dname
}

;center button
on *:dialog:mp3:sclick:20: { dialog -r mp3 }

;mp3end
on *:MP3END: {
  .timerscrolltitle off
  unset %mp3.scroll*
  if ( %cplay ) {
    if ( %songnum < $lines(playlist.txt) ) {
      inc %songnum
      if ( $dialog(mp3) ) did -c mp3 1 %songnum
      mp3play $read(playlist.txt,%songnum)
      halt
    }
    unset %songnum
    unset %cplay
  }
  elseif ( %rplay ) {
    if ( $lines(playlist.txt) !> 1 ) { unset %rplay | goto off }
    :picksong
    var %song = $read(playlist.txt)
    if ( $readn == %songnum ) goto picksong
    set %songnum $readn
    if ( $dialog(mp3) ) did -c mp3 1 $readn
    mp3play %song
    halt
  }
  elseif ( %repeat ) {
    mp3play $read(playlist.txt,%songnum)
    halt
  }
  if ( $dialog(mp3) ) {
    did -z mp3 13 0 0
    did -r mp3 2
    if ( $did(mp3,1).sel == %songnum ) did -ra mp3 34 $calc($did(mp3,34)+1)
  }
  :off
  timerpos off
  unset %songnum
}

;aliases
;id3 open alias
alias -l id3.open {
  var %input = $input(In order to edit ID3 tags you must stop using any files. Do you wish to continue?,y,Attention!)
  %input
  if (%input == $true) {
    splay stop
    dialog -md id3 id3
  }
  elseif (%input == $false) {
    dialog $iif($dialog(mp3),-v,-md) mp3 mp3
  }
}

;run.mp3 alias
alias -l run.mp3 {
  if (!%dialog) {
    set %dialog mp3
    dialog $iif($dialog(mp3),-v,-md) mp3 mp3
  }
  else {
    if (%dialog == mp3) {
      dialog $iif($dialog(mp3),-v,-md) mp3 mp3
    }
    if (%dialog == mini) {
      dialog $iif($dialog(mini),-v,-md) mini mini
    }
  }
}

;directory alias
alias -l mp3choosedir {
  if ( $sdir(.,Choose mp3 directory) ) {
    did -r mp3 1
    write -c playlist.txt
    var %x = 1, %d = $v1
    while ( $findfile(%d,*.mp3,%x) ) {
      write playlist.txt $v1
      did -a mp3 1 $left($nopath($v1),-4)
      inc %x
    }
    did -ra mp3 3 Total MP3's: $calc(%x -1)
  }
}

;add file alias
alias -l mp3addfile {
  if ( $sfile(*.mp3,Choose an mp3 file to add) ) {
    write playlist.txt $v1
    did -a mp3 1 $left($nopath($v1),-4)
    did -ra mp3 3 $did(mp3,1).lines
  }
}

;remove file alias
alias -l mp3remfile {
  if (!$did(1).sel) {
    noop $input(You did not specify a file to delete.,uwo,Error!)
  }
  else {
    if ( $exists(playlist.txt) && $did(mp3,1).sel ) {
      var %l = $did(mp3,1).lines, %s = $v1
      if ( %l == 1 ) .remove playlist.txt
      else write -dl playlist.txt %s
      did -d $dname 1 %s
      if ( %l ) {
        if ( %s <= %l ) did -c $dname 1 %s
        else did -c $dname 1 %l
      }
      did -ra mp3 3 %l
    }
  }
}

;remove all alias
alias -l mp3remall {
  .remove playlist.txt
  did -r mp3 1
  did -ra mp3 3 0
  if ( $inmp3 ) mp3stop
}

;play alias
alias -l mp3play {
  splay $$1-
  .timerscrolltitle off
  unset %mp3.scroll*
  writeini playcount.ini plays $replace($1-,$chr(32),_) $calc($readini(playcount.ini,plays,$replace($1-,$chr(32),_))+1)
  if ( %broadcasting ) mp3broadcast
  if ( $dialog(mp3) ) {
    did -c mp3 13 0
    did -o mp3 2 1 $left($nopath($1-),-4)
    did -z mp3 13 0 10000
    did -ra mp3 34 Played: $readini(playcount.ini,plays,$replace($1-,$chr(32),_))
    timerpos on
    if ( %mp3.sm != none && $width($left($nopath($1-),-4),Arial,10) > 120 ) .timerscrolltitle 0 1 scrolltitle
  }
  if ( $dialog(mini) ) {
    did -ra mini 3 $nopath($read(playlist.txt,%songnum))
  }
}

;stop alias
alias -l mp3stop {
  if ( $inmp3 ) {
    splay stop
    did -r mp3 2
    timerpos off
    did -z mp3 13 0 0
    unset %cplay
    unset %songnum
    unset %rplay
    .timerscrolltitle off
    unset %mp3.scroll*
  }
}

;timerpos alias
alias -l timerpos {
  if ( $1 == on ) .timerpos.update 0 1 did -c mp3 13 $!calc(( $!insong.pos / $!insong.length )*10000)
  elseif ( $1 == off ) .timerpos.update off
}

;backlength alias
alias -l backlength {
  if ( $inmp3 ) { return $+(-,$gmt($calc($calc($inmp3.length / 1000) - $calc($inmp3.pos / 1000)),nn:ss))
  }
}

;scroll title alias
alias -l scrolltitle {
  var %t = $did(mp3,1,%songnum) $iif(!%mp3.sm, $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $chr(160) $did(mp3,1,%songnum)), %l = $calc($len($did(mp3,1,%songnum))+7)
  if ( %mp3.scroll == $null ) {
    set %mp3.scroll.dir inc
    set %mp3.scroll 0
    set %mp3.scroll.len $len(%t)
    did -o mp3 2 1 $mid(%t,1,%mp3.scroll.len)
  }
  elseif ( %mp3.sm == two && %mp3.scroll !> 1 ) {
    set %mp3.scroll.dir inc
    set %mp3.scroll 2
    did -o mp3 2 1 $mid(%t,2,%mp3.scroll.len)
  }
  else {
    if ( !%mp3.sm ) && (%mp3.scroll > %l) set %mp3.scroll 1
    if ( !%mp3.sm ) did -o mp3 2 1 $mid(%t,%mp3.scroll,%mp3.scroll.len)
    %mp3.scroll.dir %mp3.scroll 2
    if ( %mp3.sm == two ) {
      if ( $width($mid(%t,%mp3.scroll,%mp3.scroll.len),Arial,10) > 120 ) did -o mp3 2 1 $mid(%t,%mp3.scroll,%mp3.scroll.len)
      else {
        set %mp3.scroll.dir dec
        dec %mp3.scroll 2
        did -o mp3 2 1 $mid(%t,$iif(%mp3.scroll,$v1,1),%mp3.scroll.len)
      }
    }
  }
}

;broadcasting alias
alias -l mp3broadcast {
  if ( !$inmp3 ) { echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 Player Broadcast: Cannot broadcast while no song is playing | return }
  if ( !%broadcastformat || !%broadcastchannels ) { echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 Player Broadcast: Broadcast options not set up correctly | return }
  var %title = $iif($sound($read(playlist.txt,%songnum)).title,$v1,$regsubex($gettok($nopath($inmp3.fname),-1,45),/(.mp3)$/,))
  %artist = $iif($sound($read(playlist.txt,%songnum)).artist,$v1,$gettok($nopath($inmp3.fname),-2,45))
  %len = $remove($duration($calc($inmp3.length /1000),3),00:)
  %rem = $remove($duration($calc(($inmp3.length -$inmp3.pos) /1000),3),00:)
  %bit = $sound($read(playlist.txt,%songnum)).bitrate
  %genre = $iif($sound($insong.fname).genre, $sound($insong.fname).genre, Unknown genre)
  %album = $iif($sound($insong.fname).album, $sound($insong.fname).album, Unknown album)
  %size = $bytes($file($insong.fname).size).suf
  %mode = $mp3($insong.fname).mode
  %frequency = $+($round($calc($mp3($insong.fname).sample / 1000),1)),kHz)
  %pos = $iif($int($calc(($inmp3.pos /1000)/60)) > 10,$int($calc(($inmp3.pos /1000)/60)), 0 $+ $int($calc(($inmp3.pos /1000)/60)) ) $+ : $+ $iif($round($calc(($inmp3.pos /1000) - $int($calc(($inmp3.pos /1000)/60))*60),0) > 10, $round($calc(($inmp3.pos /1000) - $int($calc(($inmp3.pos /1000)/60))*60),0), 0 $+ $round($calc(($inmp3.pos /1000) - $int($calc(($inmp3.pos /1000)/60))*60),0))
  %year = $iif($sound($insong.fname).year, $sound($insong.fname).year, Unknown year)
  %comment = $iif($sound($insong.fname).comment, $sound($insong.fname).comment, No comment)
  %msg = $replace(%broadcastformat,&title,%title,&year,%year,&mode,%mode,&genre,%genre,&artist,%artist,&len,%len,&album,%album,&comment,%comment,&size,%size,&rem,%rem,&pos,%pos,&frequency,%frequency,&bitrate,%bit,&playcount,$readini(playcount.ini,plays,$replace($inmp3.fname,$chr(32),_)))
  if ( %broadcastchannels == all ) $iif(%bc.msg == describe,ame,amsg) %msg
  if ( %broadcastchannels == active ) $iif(%bc.msg,%bc.msg,msg) $active %msg
  else {
    tokenize 44 %broadcastchannels
    var %i = 1
    while $(,$ $+ %i) {
      msg $v1 %msg
      inc %i
    }
    var %c = $addtok(%c,$iif(#* !iswm $v1,$chr(35) $+ $v2,$v2),44)
    inc %i
  }
}

;options dialog
on *:dialog:mp3:menu:16: { if (!$dialog(mp3.options)) dialog -md mp3.options mp3.options
  else dialog -v mp3.options
}

dialog mp3.options {
  title "Configuration Options"
  size -1 -1 295 110
  option pixels %notheme
  box "Play options", 1, 5 0 290 35
  radio "Normal", 2, 15 15 60 17
  radio "Continuous", 3, 80 15 80 17
  radio "Random", 4, 160 15 60 17
  button "Close", 5, 5 80 285 25
  box "Scrolling Method", 10, 5 40 285 35
  radio "None", 11, 15 55 60 17
  radio "Two-way", 12, 80 55 80 17
  radio "Forwards only", 13, 160 55 85 17
  radio "Repeat", 6, 225 15 66 17
}

;options initialization
on *:dialog:mp3.options:init:0: {
  if ( %cplay ) did -c $dname 3 | .timer 1 0 did -u $dname 2
  if ( %repeat ) did -c $dname 6
  elseif ( %rplay ) did -c $dname 4
  else did -c $dname 2
  if ( !%mp3.sm ) did -c $dname 13
  elseif ( %mp3.sm == two ) did -c $dname 12
  else did -c $dname 11
}

;options sclick events
on *:dialog:mp3.options:sclick:*: {
  if ( $did == 2 ) {
    unset %rplay
    unset %repeat
    unset %cplay
    did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  }
  if ( $did == 3 ) {
    unset %rplay
    unset %repeat
    set %cplay on
    set %songnum 1
    if ( $dialog(mp3) ) did -c mp3 1 1
    mp3play $read(playlist.txt,1)
    did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  }
  if ( $did == 6 ) {
    unset %rplay
    unset %cplay
    set %repeat 1
    did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  }
  if ( $did == 4 ) {
    unset %cplay
    unset %repeat
    set %rplay on
    var %song = $read(playlist.txt)
    set %songnum $readn
    if ( $dialog(mp3) ) did -c mp3 1 $readn
    mp3play %song
    did -c $dname $iif(!%mp3.sm,13,$iif(%mp3.sm == two,12,11))
  }
  if ( $did == 5 ) {
    dialog -x $dname
  }
  if ( $did == 11 ) {
    .timerscrolltitle off
    unset %mp3.scroll*
    set %mp3.sm none
    if ( $inmp3 ) did -o mp3 2 1 $did(mp3,1,%songnum)
    did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  }
  if ( $did == 12 ) {
    unset %mp3.scroll*
    set %mp3.sm two
    if ( $inmp3 ) .timerscrolltitle 0 1 scrolltitle
    did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  }
  if ( $did == 13 ) {
    unset %mp3.scroll*
    unset %mp3.sm
    if ( $inmp3 ) .timerscrolltitle 0 1 scrolltitle
    did -c $dname $iif(%cplay,3,$iif(%rplay,4,$iif(%repeat,6,2)))
  }
}

;about dialog
on *:dialog:mp3:menu:25: { if (!$dialog(mp3.about)) dialog -md mp3.about mp3.about | else dialog -v mp3.about }
dialog mp3.about {
  title "About"
  size -1 -1 220 156
  option pixels %notheme
  text "MP3 Player made by Neptune and Daveoh.", 1, 5 5 210 50
  text "You are free to use this MP3 Player script to help you build your own, but please don't take the script and just call it your own, as it isn't fair for the people who put hard work into making it.", 2, 5 50 210 70
  button "Close", 3, 5 125 210 25
}

;about dialog close
on *:dialog:mp3.about:sclick:3: { dialog -x $dname }

;broadcasting dialog
on *:dialog:mp3:menu:17:if (!$dialog(mp3.bc)) dialog -md mp3.bc mp3.bc | else dialog -v mp3.bc

dialog mp3.bc {
  title "Broadcasting"
  size -1 -1 400 297
  option pixels %notheme
  box "Now Playing Message", 1, 5 5 390 125
  edit "", 2, 10 20 380 80, read autovs multi vsbar
  edit %broadcastformat, 3, 10 105 290 20, autohs
  box "Channels to Broadcast", 10, 5 135 390 70
  text "Enter the channels you would like to broadcast to, separated by a comma. For all channels, type 'all'. To display to active channel only, type 'active'.", 11, 10 150 380 40
  edit %broadcastchannels, 12, 10 180 380 20
  box "Automatic broadcasting status", 20, 5 210 390 40
  radio "Enabled", 21, 20 225 65 17, group
  radio "Disabled", 22, 90 225 65 17
  button "Broadcast Now!", 23, 165 220 210 25
  button "Close", 40, 199 260 195 25
  radio "Message", 4, 20 265 65 15, group
  radio "Describe (/me)", 5, 90 265 100 15
  box "Method", 6, 5 250 190 40
  button "ASCII", 7, 300 105 89 20
}

on *:dialog:mp3.bc:init:0:{
  var %cmd = did -a $dname 2 $crlf $chr(32)
  did -a $dname 2 This is the format your broadcasting will be displayed in. Available dynamic tokens are:
  %cmd &title - The title of the playing song
  %cmd &artist - The artist of the playing song
  %cmd &album - Album of the playing song
  %cmd &genre - Genre of the playing song
  %cmd &year - Year of the playing song
  %cmd &len - The length of the playing song
  %cmd &rem - The remaining length of song
  %cmd &playcount - No. of times the song has been played
  %cmd &pos - The position of the song
  %cmd &bitrate - The song's bitrate
  %cmd &mode - How the song is being played
  %cmd &frequency - Frequency of the song
  %cmd &size - Size of the MP3 file
  %cmd &comment - Returns any comments on the song
  %cmd NOTE: &album and &genre will appear blank if it is not found
  if ( !%broadcasting ) did -c $dname 22
  else did -c $dname 21
  did -c $dname $iif(%bc.msg == describe,5,4)
}

;broadcasting sclick events
on *:dialog:mp3.bc:sclick:*:{
  if ($did == 7) { dialog -md ascii ascii }
  if ($did == 21) { set %broadcasting 1 }
  elseif ($did == 22) { unset %broadcasting }
  elseif ($did == 23) { mp3broadcast }
  elseif ($did == 40) { dialog -x $dname }
  elseif ( $did == 4 ) { set %bc.msg msg }
  elseif ( $did == 5 ) { set %bc.msg describe }
}

on *:dialog:mp3.bc:edit:*:{
  if ($did == 3) set %broadcastformat $did(mp3.bc,3).text
  if ($did == 12) set %broadcastchannels $remove($did($v1).text,$chr(32))
}

;FAQ dialog
on *:dialog:mp3:menu:31: { if (!$dialog(mp3.faq)) dialog -md mp3.faq mp3.faq | else dialog -v mp3.faq }
dialog mp3.faq {
  title "Topics"
  size -1 -1 318 85
  option pixels %notheme
  combo 1, 11 21 299 26, drop
  box "Select a Topic", 2, 3 6 312 48
  button "Close", 3, 3 57 312 25
}

;close FAQ dialog
on *:dialog:mp3.faq:sclick:3: { dialog -x $dname }

;FAQ dialog initialization
on *:dialog:mp3.faq:init:0: {
  did -a $dname 1 Modes of Play
  did -a $dname 1 Why don't some of my songs appear in the list?
  did -a $dname 1 List of Features
  did -a $dname 1 Broadcasting
  did -a $dname 1 Scrolling Methods
  did -a $dname 1 Function Keys
  did -a $dname 1 Export to Text
  did -a $dname 1 Mini Mode
  did -a $dname 1 Styles
  did -a $dname 1 ID3 Tag Editor
  did -c mp3.faq 1 1
}

;combo box selection
on *:dialog:mp3.faq:sclick:1: {
  var %d = faq $+ $did(1).sel
  if ( !$dialog(%d) ) dialog -md %d %d | else dialog -v %d
}

;faq1 dialog
dialog faq1 {
  title "Modes of Play"
  size -1 -1 260 315
  option pixels %notheme
  text "In this mode, the MP3 Player will only play what you have selected. At the end of each song, it will stop until you manually play another song.", 1, 15 20 230 50, center
  box "Normal", 2, 8 5 245 70
  text "In this mode, the MP3 Player will play what is next in the list after the current song is finished.", 3, 15 90 230 40, center
  box "Continuous", 4, 10 75 245 60
  text "In this mode, the MP3 Player will select a random song each time it plays a new one. When Random is set, it will automatically set continuous play as well.", 5, 15 150 230 60, center
  box "Random", 6, 10 135 245 85
  button "Close", 7, 10 285 240 25
  text "In this mode, the MP3 Player will play the same song over and over until interfered with.", 8, 20 235 225 40, center
  box "Repeat", 9, 10 220 245 60
}

;close dialog faq1
on *:dialog:faq1:sclick:7: { dialog -x $dname }

;faq2 dialog
dialog faq2 {
  title "Why don't some of my songs show in the list?"
  size -1 -1 328 175
  option pixels %notheme
  text "This is probably because the files are .mp4 or .m4a. This means they are MP4's and not MP3's, and mIRC will not recognize them.", 1, 10 15 300 40
  box "Problem", 2, 5 1 315 61
  text "Luckily, there is an online converter to turn MP4's into MP3's. Click the link below to go there.", 3, 10 80 299 30
  link "www.media-convert.com", 4, 100 115 124 17
  button "Close", 5, 10 145 310 25
  box "Solution", 6, 5 67 315 71
}

;close faq2 dialog
on *:dialog:faq2:sclick:5: { dialog -x $dname }

;faq3 dialog
dialog faq3 {
  title "List of Features"
  size -1 -1 310 220
  option pixels %notheme
  text "On the main MP3 Player, you'll see an array of buttons with symbols on. Here's a list of what they all do:", 1, 5 5 235 40
  list 2, 15 80 110 100, vsbar
  list 3, 135 80 160 100, vsbar hsbar
  button "Close", 4, 45 190 210 25
  text "Symbol", 5, 15 62 42 17
  text "Effect", 6, 135 62 100 17
  box "Key", 7, 5 46 300 140
}

;faq3 initialization
on *:dialog:faq3:init:0: {
  did -a $dname 2 List
  did -a $dname 3 Displays all MP3's available for play. Can be double clicked to play a song.
  did -a $dname 2 Now Playing Box
  did -a $dname 3 Displays what is currently playing.
  did -a $dname 2 Position Bar
  did -a $dname 3 Shows how far through the song is. Can be dragged to change the position of the song.
  did -a $dname 2 <<
  did -a $dname 3 Plays the track previous in the list. If Random Play is on, it will play a random song.
  did -a $dname 2 []
  did -a $dname 3 Stops what is currently playing.
  did -a $dname 2 >>
  did -a $dname 3 Plays the track next in the list. If Random Play is on, it will play a random song.
  did -a $dname 2 ||
  did -a $dname 3 Pauses the current track. When it is paused, press it again to resume.
  did -a $dname 2 |>
  did -a $dname 3 Plays what is selected in the list.
  did -a $dname 2 Volume Bar
  did -a $dname 3 Shows the volume. Can be altered by dragging it.
  did -a $dname 2 Directory
  did -a $dname 3 Adds all the playable files from a directory selected into the list.
  did -a $dname 2 Remove All
  did -a $dname 3 Removes every file from the list.
  did -a $dname 2 Add File
  did -a $dname 3 Adds the selected file to the list.
  did -a $dname 2 Remove File
  did -a $dname 3 Removes the selected file from the list.
  did -a $dname 2 Total MP3's Box
  did -a $dname 3 Displays how many MP3's are in the list.
  did -a $dname 2 Play Count Box
  did -a $dname 3 Displays how many times you have played the song.
  did -a $dname 2 Center
  did -a $dname 3 Makes the MP3 Player reposition itself in the middle of your screen.
  did -a $dname 2 Hide
  did -a $dname 3 Closes the MP3 Player. Please note that it will still play songs whilst closed.
  did -a $dname 2 Broadcast Now
  did -a $dname 3 Broadcasts what is in your broadcasting options.
  did -a $dname 2 MP3 Information
  did -a $dname 3 Displays info about the playing MP3.
  did -z $dname 3
}

;faq3 sclick events
on *:dialog:faq3:sclick:*: {
  if ( $did == 4 ) dialog -x $dname
  ;make lists allign when highlighted
  if ( $did == 2 ) || ($did == 3) { did -c faq3 2,3 $did($dname,$did).sel }
}

;faq4 dialog
dialog faq4 {
  title "Broadcasting"
  size -1 -1 340 470
  option pixels %notheme
  text "Broadcasting is a very important part of an MP3 Player, as it allows you to show other people what you're playing. The Broadcasting options can be found under File -> Broadcasting.", 1, 10 20 320 40
  text "In the Broadcasting Options, you'll find an area of where to set your play message and a place to alter what channels it shows in.", 2, 10 65 320 30
  box "About", 3, 5 5 330 95
  text "The Now Playing Message is what is going to be displayed to the channels. You can use dynamic tokens to say what you are listening to, like &&title, &&artist, and &&len. The dynamic tokens are listed in the Broadcasting Options. Remember, you can use colours (CTRL+K), so make it pretty!", 4, 10 116 320 70
  box "Now Playing Message", 5, 5 100 330 90
  text "The channels box is, clearly, where your Now Playing Message is going to be sent. To set multiple channels, separate them with a comma.", 6, 10 210 320 40
  text "Example: #horses,#cows,#sheep,#pigz", 7, 10 250 320 17
  text "If you type 'all' into the box, it will display your Now Playing Message into every channel you are on (amsg).", 8, 10 265 320 30
  box "Channels", 9, 5 195 330 105
  button "Close", 10, 5 440 330 25
  text "A quick click on the ASCII button will bring up a list of characters that you can use in your now playing message. Simply select a character and then press 'copy to clipboard' to copy it.", 11, 10 315 320 40
  box "ASCII", 12, 5 300 330 60
  text "Select which box according to how you want to display your Now Playing message. If you tick Message, it will use message the channel in normal format. If you tick Describe, it will use the /me format of messaging.", 13, 10 375 320 55
  box "Method", 14, 5 360 330 75
}

;faq4 dialog close
on *:dialog:faq4:sclick:10: { dialog -x $dname }

;faq5 dialog
dialog faq5 {
  title "Scrolling Methods"
  size -1 -1 300 184
  option pixels %notheme
  text "On this mode, the Now Playing box does not scroll.", 1, 10 20 280 20
  box "None", 2, 5 5 290 40
  text "In this mode, the song will marquee back and forth both ways.", 3, 10 60 280 30
  box "Two-Way", 4, 5 45 290 50
  text "In this mode, the song will marquee across the box from left to right continuously.", 5, 10 115 280 30
  box "Forwards", 6, 4 100 290 50
  button "Close", 7, 5 155 290 25
}

;faq5 close
on *:dialog:faq5:sclick:7: { dialog -x $dname }

;faq6 dialog
dialog faq6 {
  title "Function Keys"
  size -1 -1 295 383
  option pixels notheme
  text "Function Keys (F Keys), such as F1, F2 etc, can be useful if you don't want to continually open the MP3 Player. ", 1, 10 20 275 40
  box "Introduction", 2, 5 5 285 60
  text "These are the default F Key settings:", 3, 10 80 275 15
  box "Default Settings", 7, 5 65 285 85
  text "If you want to change which F Keys do what, open the script up in your editor and look at lines 2-4. Here you'll find the aliases that can be easily changed. ", 8, 10 170 275 40
  text "So if I want the MP3 Player to open with F5, I would simply change the 'alias F10' part on Line 11 to 'alias f5'.", 12, 10 270 275 30
  box "Changing the Function Keys", 13, 5 155 285 155
  button "Close", 14, 5 360 284 20
  text "F10 - Open MP3 Player", 4, 10 97 160 17
  text "F11 - Pause/Resume song", 5, 10 112 160 17
  text "F12 - Broadcast", 6, 10 128 160 17
  list 9, 15 215 265 69
  text "You can turn the Function Keys on or off using the tool menu.", 10, 10 325 275 35
  box "Enable/Disable Function Keys", 11, 5 310 285 45
}

;faq initialization
on *:dialog:faq6:init:0: {
  did -a $dname 9 Line 11 - Open MP3 Player
  did -a $dname 9 Line 12 - Pause/Resume song
  did -a $dname 9 Line 13 - Broadcast
}

;faq6 close
on *:dialog:faq6:sclick:14: { dialog -x $dname }

;faq7 dialog
dialog faq7 {
  title "Export to Text"
  size -1 -1 330 155
  option pixels %notheme
  box "Exporting", 1, 10 5 316 75
  text "Exporting to Text simply means writing what you have in your MP3 Player list into a .txt document. This allows you to C+P things that you want to. Please note that it might freeze your mIRC for a couple of seconds.", 2, 15 20 300 55
  text "This will simply view the .txt file you have written to.", 3, 15 100 305 15
  box "View MP3 List", 4, 10 85 315 35
  button "Close", 5, 10 125 315 25
}

;close faq7
on *:dialog:faq7:sclick:5: { dialog -x $dname }

;faq8 dialog
dialog faq8 {
  title "Mini Mode"
  size -1 -1 365 145
  option pixels %notheme
  text "Mini Mode is a neat little function that allows you to make the MP3 Player more smaller and compact. Note that there isn't an MP3 List there, so you won't be able to pick a song you want to play. This is why it should only be used with Continuous and Random Play. To go back to viewing the Normal Player (/mp3/F keys open what mode was used last), simply go to View -> Normal Mode.", 1, 10 20 345 85
  button "Close", 2, 10 115 345 25
  box "Mini Mode", 3, 5 5 355 105
}

;close faq8
on *:dialog:faq8:sclick:2: { dialog -x $dname }

;faq9 dialog
dialog faq9 {
  title "Styles"
  size -1 -1 320 210
  option pixels %notheme
  text "The Styles feature allows you to change between two modes of theme. It just adds a nicer touch so you can customize your MP3 Player to your liking.", 1, 10 20 300 45
  box "What is it?", 2, 5 5 310 65
  text "Themed mode sets the MP3 Player to work with your current computer theme.", 3, 10 90 300 30
  box "Themed", 4, 5 75 310 50
  text "Retro mode makes the MP3 Player use mIRC's own internal style.", 5, 10 140 300 30
  box "Retro", 6, 5 125 310 50
  button "Close", 7, 5 180 310 25
}

;faq9 close
on *:dialog:faq9:sclick:7: { dialog -x $dname }

;faq10 dialog
dialog faq10 {
  title "ID3 Tag Editor"
  size -1 -1 242 170
  option pixels %notheme
  text "To use the ID3 Tag Editor, simply click the Browse button and select an .mp3 file to edit. Once selected, use the dropdown menu to select which ID3 Tag you wish to edit. When done, click the Update button.", 1, 10 15 225 70
  text "When editing the Genre tag, use the other dropdown menu to select which Genre you want to change it to.", 2, 10 90 225 45
  box "Using the ID3 Tag Editor", 3, 5 0 235 140
  button "Close", 4, 5 142 235 25, flat
}

;close faq10 dialog
on *:dialog:faq10:sclick:4: { dialog -x $dname }

;Export
on *:dialog:mp3:menu:36: {
  write -c mp3list.txt
  var %m = $lines(playlist.txt)
  while ( %m ) {
    var %l = $read(playlist.txt,%m)
    write mp3list.txt $iif($sound(%l).title,$v1,$regsubex($gettok($nopath(%l),-1,45),/(.mp3)$/,)) - $&
      $iif($sound(%l).artist,$v1,$gettok($nopath(%l),-2,45)) - $&
      $remove($duration($calc($sound(%l).length /1000),3),00:)
    dec %m
  }
  echo -a 0,0/11,0/0,11/12,11/11,12/2,12/12,2/1,2/2,1/1,1/0,1 MP3 list updated!
}

;Open MP3List.txt
on *:dialog:mp3:menu:35: { run mp3list.txt }

;change to mini mp3 player
on *:dialog:mp3:menu:39: {
  .timerpos.update -p
  .timerscrolltitle off
  dialog -x $dname
  dialog -md mini mini
}

;mini dialog
dialog mini {
  title "MP3 Player - Mini Mode"
  size -1 -1 359 45
  option pixels %notheme
  edit "", 3, 0 0 360 20, read
  scroll "Volume", 2, 230 25 120 16, horizontal top range 0 66535
  button "[]", 7, 55 20 55 25
  button "||", 8, 110 20 55 25
  button ">>", 9, 165 20 55 25
  button "<<", 15, 0 20 55 25
  menu "File", 5
  item "Options", 13, 5
  item "Broadcasting", 14, 5
  item "break", 12, 5
  item "Exit", 11, 5
  menu "View", 1
  item "Normal Mode", 10, 1
}

;mini initialization
on *:dialog:mini:init:0: {
  did -c $dname 2 $vol(master)
  did -ra mini 3 $nopath($read(playlist.txt,%songnum))
}

;stop button
on *:dialog:mini:sclick:7: { mp3stop }

;pause button
on *:dialog:mini:sclick:8: {
  if ( $inmp3 ) { if ($inmp3.pause) splay resume
    else splay pause
  }
}

;next button
on *:dialog:mini:sclick:9: {
  if ( %rplay ) set %songnum $rand(1,$lines(playlist.txt)) | mp3play $read(playlist.txt,%songnum)
  else inc %songnum | mp3play $read(playlist.txt,%songnum)
}

;previous button
on *:dialog:mini:sclick:15: {
  if ( %rplay ) set %songnum $rand(1,$lines(playlist.txt)) | mp3play $read(playlist.txt,%songnum)
  else dec %songnum | mp3play $read(playlist.txt,%songnum)
}

;exit
on *:dialog:mini:menu:11: {
  set %dialog mini
  dialog -x $dname
}

;on close
on *:dialog:mini:close:0: {
  set %dialog mini
}

;volume scrollbar
on *:dialog:mini:scroll:2: { vol -v $did($did).sel }

;back to normal MP3 Player
on *:dialog:mini:menu:10: {
  dialog -x $dname
  dialog -md mp3 mp3
}

;open options dialog
on *:dialog:mini:menu:13: { dialog -md mp3.options mp3.options }

;open broadcasting dialog
on *:dialog:mini:menu:14: { dialog -md mp3.bc mp3.bc }

;ASCII dialog
dialog ASCII {
  title "ASCII"
  size -1 -1 115 140
  option pixels %notheme
  list 1, 1 1 115 100, vsbar size
  button "Copy to Clipboard", 2, 1 100 115 20, flat
  button "Close", 3, 1 120 115 20, flat
}

;ascii alias
alias -l chars {
  did -a $dname 1 -----------------
  did -a $dname 1 NOT ALL ASCII 
  did -a $dname 1 CHARACTERS
  did -a $dname 1 WORK IN mIRC,
  did -a $dname 1 SO EXPERIMENT!
  did -a $dname 1 -----------------
  var %x = 1, %y = 255
  while (%x <= %y) {
    did -a $dname 1 $chr(%x)
    inc %x
  }
}

;ascii initialization (adding characters)
on *:dialog:ascii:init:0: {
  chars
}

;close ascii dialog
on *:dialog:ascii:sclick:3: { dialog -x $dname }

;clipboard from ascii dialog
on *:dialog:ascii:sclick:2: { clipboard $did(ascii,1).seltext }

/*
ID3 Tag Editor
Author: PR|MuS
Email: Shredplayer@email.com
Script Environment: Remotes
Comments: a mini ID3 editor for editing ID3 Tags
*/

;id3 dialog
dialog ID3 {
  title "ID3 Tag Editor"
  size -1 -1 295 93
  option pixels
  edit "", 1, 3 2 200 20, read autohs
  button "Browse", 2, 208 2 85 20
  edit "", 3, 3 24 285 22, autohs
  combo 4, 123 47 110 120, size drop
  button "Update", 5, 3 70 150 20
  button "", 7, 0 0 0 0, hide ok
  combo 8, 3 47 120 180, size drop
}

;dialog events
on *:dialog:ID3:*:*:{
  if $devent == init {
    did -a $dname 1 No file selected.
    did -f $dname 2
    genre
    did -b $dname 8,5
    didtok -a $dname 4 32 Title Artist Album Year Comment Genre
  }
  if $devent == sclick {
    if $did == 2 {
      did -ra $dname 1 $file="Choose an .mp3" *.mp3
      if .mp3 !isin $did(1) { did -ra $dname 1 | did -b $dname 5 }
      else { did -e $dname 5 }
    }
    if $did == 4 {
      did -f $dname 3
      dialog -t $dname $+(ID3 Tag Editor:,$chr(32),$did(4).seltext)
      did -ra $dname 3 $PR0P($did(1),$did(4).sel)
      if $did(4).sel == 6 { did -c $dname 8 $didwm(8,$did(3)) }
    }
    if $did == 5 && $did(4).sel {
      var %file = $shortfn($did(ID3,1))
      $EDIT(%file,$did(4).sel)
    }
    if $did(4).sel == 6 { did -e $dname 8 | did -m $dname 3 }
    else { did -b $dname 8 | did -n $dname 3 }
    if $did == 8 && $did(4).sel == 6 { did -ra $dname 3 $did(8).seltext  }
  }
}

;prop alias
alias -l PR0P {
  if $2 == 1 return $mp3($1).title
  elseif $2 == 2 return $mp3($1).artist
  elseif $2 == 3 return $mp3($1).album
  elseif $2 == 4 return $mp3($1).year
  elseif $2 == 5 return $mp3($1).comment
  elseif $2 == 6 return $mp3($1).genre
}

;edit alias
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 ($mp3($1).version == MPEG 1.0 Layer 3) {
    if ($did(ID3,3)) {
      bset &val $N_BYTE($2) $iif($2 == 6,$calc($did(ID3,8).sel - 1),$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
    dialog -t $dname $+(ID3 Tag Editor:,$chr(32),Updated!)
  }
}

;B_CALC alias
alias -l B_CALC {
  return $calc($file($1).size - $2)
}

;N_BYTE alias
alias -l N_BYTE {
  return $gettok(30 30 30 4 30 1,$1,32)
}

;S_BYTE alias
alias -l S_BYTE {
  return $calc($file($1).size - $gettok(125 95 65 35 31 1,$2,32))
}

;genre alias
alias -l genre {
  didtok ID3 8 44 Blues,Classic Rock,Country,Dance,Disco,Funk,Grunge,Hip-Hop,Jazz,Metal,New Age,Oldies,Other,Pop,R&B,Rap,Reggae,Rock,Techno,Industrial,Alternative,Ska,Death Metal,Pranks,SoundTrack,Euro-Techno,Ambient,Trip-Hop,Vocal,Jazz+Funk,Fusion,Trance,Classical,Instrumental,Acid,House,Game,Sound Clip,Gospel,Noise,Alternative Rock $&
    ,Bass,Soul,Punk,Space,Meditative,Instrumental Pop,Instrumental Rock,Ethnic,Gothic,Darkwave,Techno-Industrial,Electronic,Pop-Folk,Euro Dance,Dream,Southern Rock,Comedy,Cult,Gangsta Rap,Top 40,Christian Rap,Pop/Funk,Jungle,Native American,Cabaret,New Wave,Psychedelic,Rave,Showtunes,Trailer,Lo-Fi,Tribal,Acid Punk,Acid Jazz,Polka,Retro,Musical,Rock n' Roll
  didtok ID3 8 44 Hard Rock,Folk,Folk-Rock,National Folk,Swing,Fast Fusion,Bebop,Latin,Revival,Celtic,Bluegrass,Avantgarde,Gothic Rock,Progressive Rock,Psychedelic Rock,Symphonic Rock,Slow Rock,Big Band,Chorus,Easy Listening,Acoustic,Humour,Speech,Chanson,Opera,Chamber Music,Sonata,Symphony,Booty Bass,Primus,Porn Groove,Satire,Slow Jam,Club,Tango $&
    ,Samba,Folklore,Ballad,Power Ballad,Rhythmic Soul,Freestyle,Duet,Punk Rock,Drum Solo,Acapella,Euro-House,Dance Hall, 
}

Comments

Sign in to comment.
Chinshy   -  Jul 22, 2012

it is but not all function work

 Respond  
`Kazuma   -  Aug 08, 2011

Does this even work with the latest mIRC?

 Respond  
Savage_CL   -  Jun 02, 2011

Good, but the marquee doesn't work well at all and I cant seem to get Broadcast to work correctly at all. Also, in the options dialog, some options are messed up. for example clicking none on the second row screws up the top row. easy fix, just a small bug

 Respond  
Twistedmetal   -  Jun 02, 2011

i would vote 10/10 but it says i got to be a member for atleast 3 days

 Respond  
Slyvar   -  Mar 27, 2011

It takes ages to load if you put on it a songs dir >_>

 Respond  
Lord-Harlot   -  Jan 28, 2011

I'll pass the comment on to him.

 Respond  
Jonesy44   -  Jan 07, 2011

Not sure if this dev is still on here :(

 Respond  
NickAd   -  Jan 07, 2011

Compatibility problem and bugs Windows 7 x64 using mIRC v7.17

  1. Play buttons incorrectly labeled
  2. Volume control absent
  3. Scroll text absent
  4. When adding single files and playing, it ignores them and uses the playlist instead
  5. On the colour schemes dialogue, the scroll bar for Blue doesn't show the value and resets to zero when released
  6. mp3 Information button shows an empty dialogue when clicked
  7. The PlayCount number doesn't update
  8. Changing or setting the font empties the playlist

I have used the previous version of this mp3player, when it consisted of just a .mrc file, completely successfully on my current system. With the new additions it promises to be an even better mp3 player than it already was. IF it worked.

Suggested improvements =

  1. Set a directory for playlists which will be remembered. Saving multiple playlists which can be loaded by browsing to the playlist directory.

  2. Removing the restriction on played items which stops broadcasting after a certain number. Or perhaps adding a function to "clear" the playcount and reset it to zero

  3. The ability to set an initial "base" or "root" directory which opens when browsing for mp3's to avoid having to go through a number of folders every time you add a file

  4. On the main dialogue when you choose to add a directory, it replaces the current list of mp3's with the ones from the newly selected directory. An improvement would be to choose whether to replace or combine the two lists of mp3's

  5. Adding the version number to the "about" dialogue, along with a link to the Hawkee page for this mp3 player

At this time, I will continue to use the older version as it works seamlessly and is by far the best mp3 player for mIRC that I have found. In fact, with the exception of points 1-5 above it would be just about perfect.

Hope this helps and you fix the bugs as well as looking into the suggestions, which I have seen implemented on other players.

I look forward to an updated version.

 Respond  
silent.nahid   -  Aug 19, 2010

Best one i've ever seen! Loved it!10/10

 Respond  
animalnitrate   -  Apr 15, 2010

hmmmmm can someone help me.Ive slapped the code in Remote and nothings happened?to i have to type a command to enable it? :P

 Respond  
DragonHeart   -  Sep 27, 2009

With over 30k tracks, it crashed when adding the directory.

 Respond  
miniCruzer   -  Sep 04, 2009

Would be nice to be able to add multiple directories rather than one.

 Respond  
Adamon   -  Sep 04, 2009

grffles 9/10 only because if i have more than 1 server open and 'active' is in the broadcasting box I have to REOPEN the mp3 player for it to work on that server. other that it's nice.

To Fix this: Look for these lines:

if ( %broadcastchannels == active ) $iif(%bc.msg,%bc.msg,msg) $active %msg

Change it to:

if ( %broadcastchannels == active ) scid $activecid $iif(%bc.msg,%bc.msg,msg) $active %msg

:)

 Respond  
Viper01   -  Aug 01, 2009

Works excellent with Windows XP, however on Windows 7 the volume bar messes up. Might be because I had to put MS Agent into Windows 7 after it was installed since it lacks it be default, or it might just be Windows 7. Just a minor annoyance. At any rate, great script, the only mp3 script I use.

 Respond  
Jonesy44   -  May 13, 2009

/me pegs napalm's nose

 Respond  
napalm`   -  May 13, 2009

SNORE

 Respond  
Jonesy44   -  May 12, 2009

getting some good music would be a good start :p

 Respond  
^Neptune   -  May 11, 2009

Image

All hail Neptune. Additional ideas for the shoutbox would be nice though...

 Respond  
PuNkTuReD   -  May 10, 2009

Complete sexage. looks very nice ^Neptune.

 Respond  
^Neptune   -  May 10, 2009

Sexage.

 Respond  
^Neptune   -  May 10, 2009

That'd not be my fault as mIRC's codecs don't allow playing of some songs.

Image

Image

Image

Meh I just felt like making a completely new one. Yeah the layout is kinda the same as Omega's, but it wasn't actually initially meant to look like that. Oh well, it's nice.

The colors on the ID3 tag editor are that way cause I changed them with a color editor that is now in the player. :) It was a later screenshot than when I had it white/black

Before you say anything, I'm allowed to use those icons - Lindrian told me I could. :3

This one will have FAR more awesomeness than Omega's one though. :D

Speaking of codecs.. if anyone knows of a DLL that allows you to play MP3s, lemme know.

 Respond  
Eugenio   -  Apr 26, 2009

rofl

 Respond  
ParanoiaComplex   -  Apr 25, 2009

Doesn't seem to play the music...

 Respond  
^Neptune   -  Nov 28, 2008

Incase you're wondering, I've pretty much abandoned this. You can find this as an addon with lots of extra features.

http://www.hawkee.com/view.php?file_id=1714

 Respond  
Eugenio   -  Nov 28, 2008

rofl do j00 think he cares bullet
ffs this code was err0r infested that "all" err0r would be the last of hes worries
plus its such a lil err0r I dont see how that could change j00 rating
smh

 Respond  
Bullet_Dodger   -  Nov 28, 2008

Still needs to fix the 'all' thing tho so my rating drops to a 8

 Respond  
xplo   -  Nov 27, 2008

best mp3 player ever for mirc, 10/10 +like
Keep it up buddy

 Respond  
Eugenio   -  Nov 27, 2008

LMFAO @ AHBARAR
nuff said

 Respond  
Jonesy44   -  Nov 27, 2008

I rated 10 x]

 Respond  
AHBARAR   -  Nov 27, 2008

Man 32 rate and its just 7.4 O_o who in the heck rate small rates here show his face if he she is man women enough to face the courge >:P .. oh i remind of (Courage the Cowardly Dog) thing >:| missed that cartoon was damn funny >:{

 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.