Basic Volume Control Dialog

By Scakk on Jun 04, 2011

This is a very simple volume control dialog. You can raise or lower the volume. You can also mute it if you want.

*This controls the volume of your computer itself not the sounds of mIRC

alias voll { dialog $iif($dialog(volume),-v,-am) volume volume }
dialog volume {
  title "Toggle Volume"
  size -1 -1 220 30
  scroll "", 2, 7 7 145 19, horizontal top range 0 100
  button "Mute", 5, 160 7 55 19
}
on *:dialog:volume:*:*: {
  var %volume $round($calc($vol(master) * 100 / 65535),0)
  if ($devent = init) { 
    did -c volume 2 %volume
    dialog -t volume Toggle Volume $chr(160) $+(%volume,/100%)
  }
  if ($devent = scroll && $did = 2) { 
    vol -v $calc(653.5 * $did($dname,2).sel) 
    var %sound $iif($did($dname,2).sel = 0, $chr(160) No Sound,$+($did($dname,2).sel,/100%))
    dialog -t volume Toggle Volume $chr(160) %sound
  }
  if ($devent = sclick && $did = 5) { 
    if ($vol(master).mute) { 
      vol -vu2 | did -ra volume 5 Mute 
      dialog -t volume Toggle Volume $chr(160) $+(%volume,/100%) 
    }
    else { vol -vu1 | did -ra volume 5 UnMute | dialog -t volume Toggle Volume $chr(160) $chr(160) @Muted@ }
  }
}

Comments

Sign in to comment.
irchainscriptz   -  Jun 09, 2011

oh nice work Scakk

 Respond  
Jethro   -  Jun 04, 2011

Cool.

 Respond  
blackvenomm666   -  Jun 04, 2011

nicely done scakk i concur with napa mmhmm

 Respond  
napa182   -  Jun 04, 2011

Nice work Scakk, now don't lose it this time =P
9/10 +like

 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.