Media Player for mIRC 5.8 — File Browser

MediaPlayerformIRC5.8v1.0 / MediaPlayerformIRC5.8v1.0 / mplayer.mrc

mplayer.mrc — 8.08 KB — Download this file

; The contents of this script file are copyrighted by INSIDES, 2000.
; Definitions hereby supplied are owned by INSIDES, the script author.
; Please contact the author of the script for any questions you might have.
; Thanks for understanding.

On *:LOAD:{
  if ($version < 5.8) {
    echo $colour(Normal) -s MPLAYER - Media Player Is Designed For And Works Only With mIRC 5.8.
    echo $colour(Normal) -s MPLAYER - Please Download mIRC 5.8 Or Newer.
    linesep -s
    .unload -rs mplayer.mrc
  }
  echo $colour(Normal) -s MPLAYER - Thanks For Using Media Player By INSIDES.
  echo $colour(Normal) -s MPLAYER - Please Contact The Author - insides@freemail.org.mk For Comments & Suggestions.
  linesep -s
set %mp3.repeat 0
}


alias mp3.play {
  .timermp3 off
  if ($1 != $null) { set %mp3.file $1 | goto playfile }
  if (%mp3.file != $null) { goto playfile }
  set %mp3.file $file="Please Select MP3 File ..." "C:\*.mp3" 
  set %mp3.file " $+ %mp3.file $+ "
  :playfile
  if (%mp3.file == $null) { return }
  mp3.stop
  splay -q %mp3.file
  mp3.pstatus PLAYING
  unset %mp3.pause
  .timermp3 0 1 mp3.slider
}

alias mp3.status { return $calc(($inmp3.pos / $inmp3.length) * 100) }

alias mp3.pstatus { 
  titlebar @Media Player - $1
  set %mp3.pstatus $1
}

alias mp3.time {
  drawtext -o @Media $cnor Tahoma 24 13 41 $mp3.length($inmp3.pos)
}

alias mp3.stop { 
  .timermp3 off
  splay stop
  mp3.pstatus STOPPED
  mp3.slider
  unset %mp3.pause
}

alias mp3.id3 {
  echo -a Album : $mp3($inmp3.fname).album
  echo -a Title : $mp3($inmp3.fname).title
  echo -a Artist : $mp3($inmp3.fname).artist
}

alias mp3.player {
  if ($window(@Media) != $null) { window -a @Media | return }
  var %mp.left $calc(($window(-1).w / 2) - 130)
  var %mp.top $calc(($window(-1).h / 2) - 70)
  window -pkdo +tn @Media %mp.left %mp.top 260 140
  titlebar @Media Player
  drawpic @Media 0 0 $scriptdirmplayer.bmp
  mp3.pstatus STOPPED
  unset %mp3.pause
  if ($vol(master).mute == 1) { drawrect @Media $cnor 1 200 37 43 24 }
  if (%mp3.repeat == 1) { drawrect @Media 1 1 200 85 43 24 | return }
  mp3.vol
  mp3.slider
}

menu @Media {
  sclick:{ 
    if ($mouse.x >= 13) && ($mouse.x <= 57) && ($mouse.y >= 27) && ($mouse.y <= 35) { mp3.info }
    if ($mouse.x >= 23) && ($mouse.x <= 44) && ($mouse.y >= 86) && ($mouse.y <= 102) { mp3.prev }
    if ($mouse.x >= 61) && ($mouse.x <= 71) && ($mouse.y >= 86) && ($mouse.y <= 102) { mp3.play }
    if ($mouse.x >= 89) && ($mouse.x <= 105) && ($mouse.y >= 86) && ($mouse.y <= 102) { mp3.pause }
    if ($mouse.x >= 123) && ($mouse.x <= 139) && ($mouse.y >= 86) && ($mouse.y <= 102) { mp3.stop }
    if ($mouse.x >= 158) && ($mouse.x <= 176) && ($mouse.y >= 86) && ($mouse.y <= 102) { mp3.next }
    if ($mouse.x >= 203) && ($mouse.x <= 239) && ($mouse.y >= 14) && ($mouse.y <= 32) { unset %mp3.file | mp3.play }
    if ($mouse.x >= 203) && ($mouse.x <= 239) && ($mouse.y >= 40) && ($mouse.y <= 56) { mp3.mute }
    if ($mouse.x >= 203) && ($mouse.x <= 239) && ($mouse.y >= 86) && ($mouse.y <= 107) { mp3.repeat }
  }
  uclick:{
    if ($mouse.x >= 35) && ($mouse.x <= 205) && ($mouse.y >= 70) && ($mouse.y <= 78) { mp3.seek $calc($mouse.x - 35) }
    if ($mouse.x >= 118) && ($mouse.x <= 126) && ($mouse.y >= 12) && ($mouse.y <= 42) { mp3.vmset $calc(($mouse.y - 42) * (1 - 2)) }
    if ($mouse.x >= 139) && ($mouse.x <= 147) && ($mouse.y >= 12) && ($mouse.y <= 42) { mp3.vpset $calc(($mouse.y - 42) * (1 - 2)) }
    if ($mouse.x >= 162) && ($mouse.x <= 180) && ($mouse.y >= 12) && ($mouse.y <= 42) { mp3.vwset $calc(($mouse.y - 42) * (1 - 2)) }
    if ($mouse.x >= 182) && ($mouse.x <= 190) && ($mouse.y >= 12) && ($mouse.y <= 42) { mp3.vdset $calc(($mouse.y - 42) * (1 - 2)) }
  }
}

alias mp3.pause { 
  if ($inmp3 != $true) { goto proceed }
  set %mp3.pause $inmp3.pos
  splay stop
  .timermp3 off
  mp3.pstatus PAUSED
  return
  :proceed
  splay -p %mp3.file seek %mp3.pause
  mp3.pstatus PLAYING
  .timermp3 0 1 mp3.slider
}

alias mp3.mute {
  if ($vol(master).mute == 0) { drawrect @Media $cnor 1 200 37 43 24 | vol -vu1 | return }
  if ($vol(master).mute == 1) { drawrect @Media 1 1 200 37 43 24 | vol -vu2 | return }
}

alias mp3.repeat {
  if (%mp3.repeat == 0) { drawrect @Media $cnor 1 200 85 43 24 | set %mp3.repeat 1 | return }
  if (%mp3.repeat == 1) { drawrect @Media 1 1 200 85 43 24 | set %mp3.repeat 0 | return }
}

alias mp3.slider {
  var %mp3.slider $calc($mp3.status * 1.7 + 30)
  clear -n @Media
  drawpic -n @Media 0 0 $scriptdirmplayer.bmp
  mp3.pstatus %mp3.pstatus
  if ($vol(master).mute == 1) { drawrect -n @Media $cnor 1 200 37 43 24 }
  if (%mp3.repeat == 1) { drawrect -n @Media $cnor 1 200 85 43 24 }
  drawrect -fn @Media $cnor 1 %mp3.slider 71 25 9
  mp3.vol
  mp3.time
  drawdot @Media
}

alias mp3.vol {
  var %mp3.vvol $calc(43 - 30 * $vol(master) / 65535)
  var %mp3.pvol $calc(43 - 30 * $vol(mp3) / 65535)
  var %mp3.wvol $calc(43 - 30 * $vol(wave) / 65535)
  var %mp3.mvol $calc(43 - 30 * $vol(midi) / 65535)
  drawrect -f @Media $cnor 1 117 %mp3.vvol 11 5
  drawrect -f @Media $cnor 1 138 %mp3.pvol 11 5
  drawrect -f @Media $cnor 1 160 %mp3.wvol 11 5
  drawrect -f @Media $cnor 1 181 %mp3.mvol 11 5
}

alias mp3.seek { 
  if ($inmp3 == $false) { return }
  var %mp3.seek $int($calc((100 / 170) * $1 * ($mp3($inmp3.fname).length /100)))
  mp3.pstatus SEEKING
  splay -p %mp3.file seek %mp3.seek
  mp3.pstatus PLAYING
  unset %mp3.pause
}

alias mp3.vmset { 
  var %mp3.vmset $int($calc((100 / 30) * $1 * (65535 /100)))
  vol -v %mp3.vmset
  if ($inmp3 == $false) { mp3.vset }
}

alias mp3.vpset { 
  var %mp3.vpset $int($calc((100 / 30) * $1 * (65535 /100)))
  vol -p %mp3.vpset
  if ($inmp3 == $false) { mp3.vset }
}

alias mp3.vwset { 
  var %mp3.vwset $int($calc((100 / 30) * $1 * (65535 /100)))
  vol -w %mp3.vwset
  if ($inmp3 == $false) { mp3.vset }
}

alias mp3.vdset { 
  var %mp3.vdset $int($calc((100 / 30) * $1 * (65535 /100)))
  vol -m %mp3.vdset
  if ($inmp3 == $false) { mp3.vset }
}

alias mp3.vset {
  clear -n @Media
  drawpic -n @Media 0 0 $scriptdirmplayer.bmp
  if ($vol(master).mute == 1) { drawrect -n @Media $cnor 1 200 37 43 24 }
  if (%mp3.repeat == 1) { drawrect -n @Media $cnor 1 200 85 43 24 }
  mp3.vol
  mp3.pstatus %mp3.pstatus
  drawdot @Media
}

alias mp3.info {
  if ($inmp3 != $true) { return }
  window -lbk +et @ID3 35 40 260 150 Tahoma 11
  titlebar @ID3 - $mp3($inmp3.fname).title By $mp3($inmp3.fname).artist 
  clear @ID3
  .aline @ID3  $+ $mp3($inmp3.fname).title By $mp3($inmp3.fname).artist
  .aline @ID3 ...
  .aline @ID3 Title : $mp3($inmp3.fname).title - $mp3($inmp3.fname).mode
  .aline @ID3 Artist : $mp3($inmp3.fname).artist
  .aline @ID3 Length : $mp3.length($mp3($inmp3.fname).length) - $mp3($inmp3.fname).sample Hz @ $mp3($inmp3.fname).bitrate BPS
  .aline @ID3 Album : $mp3($inmp3.fname).album
  .aline @ID3 Year : $mp3($inmp3.fname).year
  .aline @ID3 Genre : $mp3($inmp3.fname).genre
  .aline @ID3 Comment : $mp3($inmp3.fname).comment
}

alias mp3.length { 
  var %mp3.len $int($calc($1 / 1000))
  var %mp3.min $int($calc(%mp3.len / 60))
  var %mp3.sec $calc(%mp3.len - (%mp3.min * 60))
  if (%mp3.sec < 10) { set %mp3.sec 0 $+ %mp3.sec }
  set %mp3.len %mp3.min $+ : $+ %mp3.sec
  return %mp3.len
}

On *:CLOSE:@Media:{ mp3.stop | unset %mp3.pause | .timermp3 off }

On *:MP3END:{ mp3.pstatus FINISHED | if (%mp3.repeat == 1) { mp3.play } }

menu menubar,status,channel {
  Media Player ...
  .Media Player ...:mp3.player
  .About Media Player ...:mp3.about
  .-
  .Unload Media Player ...:mp3.unload
}

alias mp3.about {
  echo $colour(Normal) -s MPLAYER - Thanks For Using Media Player By INSIDES.
  echo $colour(Normal) -s MPLAYER - Please Contact The Author - insides@freemail.org.mk For Comments & Suggestions.
  linesep -s
}

alias mp3.unload {
  echo $colour(Normal) -s MPLAYER - Thanks For Using Media Player By INSIDES.
  echo $colour(Normal) -s MPLAYER - Procceding With Unloading.
  linesep -s
  .unload -rs mplayer.mrc
}

alias cnor { return $colour(Normal) }