Volume Window

By Jonesy44 on May 12, 2008

Bored and needed more practive in picwins.
Bleh, self explanatory.

Thanks to BlueThen, i stole his picwin styles, sorry:P x

Image

menu * {
  Volume: volwin
}
alias volwin {
  window -paoCzdk0 +tnbL @volwin -1 -1 400 400
  window -poCzdhk0 +tnbL @volwin.buf -1 -1 400 400
  .timervolwin 0 0 volwin.ini
  volwin.ini
}
alias volwin.ini {
  if (%sclick.vol) {
    if ($mouse.x >= 10 && $mouse.x <= 110 && $mouse.y >= 10 && $mouse.y <= 320) {
      set %vol.x $calc(300 - $mouse.y - 10)
    }
    if (vol.x) {
      vol -v $calc(%vol.x / 300 * 65535)
      unset %vol.x
    }
  }
  clear @volwin.buf
  drawrect -f @volwin.buf 14 14 10 10 100 300
  drawline @volwin.buf 0 120 170 10 40 400
  drawline @volwin.buf 11 5 10 $calc(300 - (($vol(master) / 65535 * 300) + 10)) 110 $calc(300 - (($vol(master) / 65535 * 300) + 10))
  drawtext @volwin.buf 5 Arial 50 240 10 $round($calc($vol(master) / 65535 * 100),0) $+ %
  drawcopy -m @volwin.buf 0 0 400 400 @volwin 0 0 400 400
}
on *:CLOSE:@volwin: {
  .timervolwin off
  window -c @volwin.buf
}
menu @volwin {
  sclick {
    set %sclick.vol 1
    .timerdragvol 0 0 volwin.ini
  }
  drop {
    unset %sclick.vol
    .timerdragvol off
  }
}

Comments

Sign in to comment.
pokemaster23   -  Jun 09, 2008

Is there any way for me to learn how to do these types of things?

 Respond  
Jonesy44   -  May 13, 2008

EL, agreed, i think i\'ll make a smaller, more useful window. :P

BlueThen, i was lazy at the time, lol, i\'ll edit to channel/menu w/e :D

Hawkee, will do after i post this comment.

I\'m not sure what\'s up with the calculations atm, and the disappearing at the end. prolly a calc error there too, hehe. okay, i\'ll make a v2 soonish :D

 Respond  
EL   -  May 12, 2008

Yeah have the same issue as everyone else an that pic win is to damn big for its purpose really.

 Respond  
Hawkee   -  May 12, 2008

Should add your screenshot to your Introduction.

 Respond  
foobar   -  May 12, 2008

Delightful :)

A few things:

A- What about adjusting wave, midi, song, AND master volumes? (checkboxes/buttons(?))
B- Mute button/checkbox/option
C- When I open up the picwin (if on 100% volume) it displays 100%; however, after adjusting it again, it only displays the maximum volume as 93%.. perhaps a calculation error?

Good luck on this! I really do enjoy the idea and it\'d be an interesting addition to say.. an mp3 player? :P

 Respond  
BlueThen   -  May 12, 2008

Nais!

I suggest that you shouldn\'t use

on menu:*:

because people tend to get really mad when they find a link to their script everywhere. I personally only have hte menu on the channel and status.

Also, a good tip, is that you should have the buffer atleast twice the size as the actual window. Indeed it might make calculating a little harder, but the output is good because it\'s pretty much anti-aliasing.

 Respond  
guest598594   -  May 12, 2008

Eh I take that back^^

When I go to 94% and up, the blue bar goes off the gray scale thing., and I\'m only able to set the volume to 93% with the blue bar.

 Respond  
guest598594   -  May 12, 2008

Looks like there\'s a 7% difference, now when it\'s 100% in the volume control, it says 93% in your window :P

 Respond  
Jonesy44   -  May 12, 2008

Solved the prob hah, my bad :P

 Respond  
guest598594   -  May 12, 2008

If I control the volume from the real volume settings and put it all the way up, it appears to be 107% :/

 Respond  
juhapuha   -  May 12, 2008

Lazy commentators here.... :)

 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.