; from the table definition
;
text "Master Volume", 1044, 8 35 42 6
scroll "", 1045, 0 43 270 9, range 65535 horizontal bottom
text "*.mp3, *.wav", 1046, 9 55 42 6
scroll "", 1047, 0 63 270 9, range 65535 horizontal bottom
text "*.mid", 1048, 9 75 42 6
scroll "", 1049, 0 83 270 9, range 65535 horizontal bottom
check "Mute", 1050, 240 35 21 6, left
check "Mute", 1051, 240 55 21 6, left
check "Mute", 1052, 240 75 21 6, left
;
; and later, the events that "run" the scrollbars
on *:DIALOG:dMP3Player:init:*:{
did -c $dname 1045 $vol(master)
did -c $dname 1047 $vol(wave)
did -c $dname 1049 $vol(midi)
}
on *:DIALOG:dMP3Player:scroll:101:{
if ($timer(MoveDMP3Player)) .timerMoveDMP3Player off
did -ra dMP3Player 105 $gmt($did(dMP3Player,101).sel,n:ss)
.timerMP3Player -m 1 500 AdjustPosition
}
; Volume sliders
; Master Volume - MP3/Wave - MIDI
on *:DIALOG:dMP3Player:scroll:1045: .vol -v $did($did).sel
on *:DIALOG:dMP3Player:scroll:1047: .vol -w $did($did).sel
on *:DIALOG:dMP3Player:scroll:1049: .vol -m $did($did).sel
; Mute checkboxes
; Master Volume - MP3/Wave - MIDI
on *:DIALOG:dMP3Player:sclick:1050: .vol $+(-vu,$iif($did($did).state,1,2))
on *:DIALOG:dMP3Player:sclick:1051: .vol $+(-wu,$iif($did($did).state,1,2))
on *:DIALOG:dMP3Player:sclick:1052: .vol $+(-mu,$iif($did($did).state,1,2))
alias MoveDMP3Player {
if ($insong) && ($dialog(dMP3Player)) {
; Check the current positions for the sliders/checkboxes, in case they
; are altered by other processes (keyboard volume control/Windows
; volume control).
did -z dMP3Player 101 0 $int($calc($insong.length / 1000))
did -c dMP3Player 1045 $vol(master)
did -c dMP3Player 1047 $vol(wave)
did -c dMP3Player 1049 $vol(midi)
did $iif($vol(master).mute,-c,-u) dMP3Player 1050
did $iif($vol(wave).mute,-c,-u) dMP3Player 1051
did $iif($vol(midi).mute,-c,-u) dMP3Player 1052
did -c dMP3Player 101 $int($calc($insong.pos / 1000))
}
}