Adds a scrollbar for your mp3 player that users can use to see position as well as seek back/forth in the song.
1-) You will need to make (in your dialog) your horizontal scrollbar with a range of 100.
2-) whatever alias you use to play your mp3's with, add the alias 'pos.seek' to the end of it.
3-) And finally, the code: Here it is.
I hope it works for everyone! worked fine for me and tested on mIRC v6.03 and used in my mp3 script for several months now during development.
Any questions feel free to send me a PM.
; Alias for Position/Seek Scroll Bar (checking where in the mp3 you are, moving back/forward)
alias -l pos.seek {
if ($dialog(dialog_name_here) != $null) && ($inmp3 == $true) {
did -c dialog_name_here ID $round($calc($calc($insong.pos / $insong.length) * 100),0)
}
elseif ($dialog(dialog_name_here) == $null) {
.timer.pos.seek off
}
}
; Add this to your on dialog events. This looks to see if the scroll
; bar has been manually changed. Replace 'dialog_name_here' & 'ID'.
on *:dialog:dialog_name_here:scroll:ID: {
if ($devent == scroll) {
if ($did == ID) {
if ($inmp3 == $true) {
var %t = $round($calc($did(dialog_name_here,ID).sel / 22000 * $inmp3.length),0)
.splay seek $calc((%t + $did(dialog_name_here,ID).sel) * 200)
}
}
}
}