#
# winamp announce with swamp.dll
#
# SWAMP MP3: The mIRC's Sonique/Winamp Controller! v1.0.5 (601 lines)
#--------------------------------------
# Author: LightStrike
# e-mail: LightStrike@mail.pt
# edited by Rez
# ------------------------------------------------
menu channel,query,nicklist {
-
+- M.P.3 -+: mp3
-
}
alias mp3 {
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, INSTALLED) == $false) { echo $active $mp3noinstal | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, RUNNING) == $false) { echo $active $mp3quit | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Playing) { set %mp3.path $nofile($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) | say $mp3playing | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Paused) { echo $active $mp3stopped | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Stopped) { echo $active $mp3stopped | halt }
}
alias mp3b {
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, INSTALLED) == $false) { echo $active $mp3noinstal | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, RUNNING) == $false) { echo $active $mp3quit | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Playing) { set %mp3.path $nofile($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) | say $mp3playingb | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Paused) { echo $active $mp3stopped | halt }
if ($dll($shortfn($mircdir\swamp.dll), WinAmpGet, STATE) == Stopped) { echo $active $mp3stopped | halt }
}
alias mp3playingb { return 03playing: " $+ $mp3artist - $mp3title $+ " 03Genre: $mp3genre }
alias mp3playing { return 14,1playing: 15" $+ $mp3title $+ " 14From:15 $mp3path 14Genre:15 $mp3genre }
alias mp3stopped { return winamp $dll($shortfn($mircdir\swamp.dll), WinAmpGet, VERSION) not playing }
alias mp3quit { return winamp stone dead }
alias mp3noinstal { return winamp not installed }
alias mp3get { return $dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) }
alias mp3get { return $dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKFILENAME)) }
alias mp3time { return $int($calc(($dll($shortfn($mircdir\swamp.dll), WinAmpGet, PLAYEDTIME) / $calc($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKTIME) * 1000)) * 100)) $+ $chr(37) of $replace($duration($dll($shortfn($mircdir\swamp.dll), WinAmpGet, TRACKTIME)),hrs,h,hr,h,mins,m,secs,s,sec,s)) }
alias mp3path {
var %x = %mp3.path
return $gettok(%x,$calc($gettok(%x,0,92) 1) $+ -,92)
}
alias mlen {
if ($1) {
if (!$exists($1-)) { return 1 | halt }
var %x = $calc($sound($1-).length /1000)
return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
}
if (!$1) {
if (!$insong) { return 2 | halt }
var %x = $calc($insong.length /1000)
return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
}
}
alias mpos {
if (!$insong) { return 2 | halt }
var %x = $calc($insong.pos /1000)
return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
}
alias mrem {
if (!$insong) { return 2 | halt }
var %x = $calc(($insong.length - $insong.pos) / 1000)
return $gmt(%x,$iif(%x >= 3600,hh:nn:ss,nn:ss))
}
alias -l mp3title {
var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).title
if (%tmp == $null) {
%tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).title }
if (%tmp == $null) {
%tmp = $replace($remove($nopath($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)),.mp3),_,$chr(32))
}
return %tmp
}
alias -l mp3artist {
var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).artist
if (%tmp == $null) {
%tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).artist }
if (%tmp == $null) {
%tmp = $replace($remove($nopath($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)),.mp3),_,$chr(32))
}
return %tmp
}
alias -l mp3genre {
var %tmp = $id3v2($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).genre
if (%tmp == $null) {
%tmp = $mp3($dll($shortfn($mircdir $+ swamp.dll), WinAmpGet, TRACKFILENAME)).genre
}
if (%tmp == $null) {
%tmp = N/A
}
return %tmp
}
}
}