Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Volume in tray


  • Please log in to reply
13 replies to this topic
PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005
One of my occasional script...
It is a volume control with an icon in tray.
You can download it from here
([#np] = number from numeric pad)
[Ctrl]+[3np] = toggle mute
[Ctrl]+[7np] = +2 volume
[Ctrl]+[1np] = -2 volume
[Shift]+[Ctrl]+[7np] = +0.5 volume
[Shift]+[Ctrl]+[1np] = -0.5 volume
[Ctrl]+[3] = tray test

What think about it? :)

PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005
No comments? :(

not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
It's nice...

Why don't you post the code here, a bit more information on what it does, and offer some screenshots of the icon changing?

:wink:

PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005
ok :)
the code is this:
#HotkeyInterval 100  ; Increase this value slightly to reduce the problem.
#MaxHotkeysPerInterval 1000  ; Decreasing this value (milliseconds) should also help.
#Persistent
#SingleInstance

Gosub, refreshvol
^Numpad3::Gosub, volMute
^Numpad7::Gosub, volUpUp
^Numpad1::Gosub, volDownDown
^NumpadHome::Gosub, volUp
^NumpadEnd::Gosub, volDown
^3::Gosub, test
return

; _________ ICON VOLUME _________

volMute:
SoundSet, -1, MASTER, MUTE ; Toggle mute
Gosub, refreshvol
return 
volUp:
SoundSet, +0.5, MASTER, VOLUME ; Volume Up
Gosub, refreshvol
return 
volDown:
SoundSet, -0.5, MASTER, VOLUME ; Volume Down
Gosub, refreshvol
return 
volUpUp:
SoundSet, +2, MASTER, VOLUME ; Volume Up
Gosub, refreshvol
return 
volDownDown:
SoundSet, -2, MASTER, VOLUME ; Volume Down
Gosub, refreshvol
return
refreshvol:
volico=1;
SoundGet, vol, MASTER, MUTE
if vol = OFF
{
  SoundGet, vol, MASTER, VOLUME
  if vol=0 
  {
    volico = 1
  }
  else
  {
    volico := (vol * 0.15)
    volico := volico + 2
  }
}
;MSgBox %volico%
Menu, tray, Icon, volicos.icl, %volico%
return
test:
menu, tray, Icon, volicos.icl, 1
Sleep, 500
menu, tray, Icon, volicos.icl, 2
Sleep, 100
menu, tray, Icon, volicos.icl, 3
Sleep, 100
menu, tray, Icon, volicos.icl, 4
Sleep, 100
menu, tray, Icon, volicos.icl, 5
Sleep, 100
menu, tray, Icon, volicos.icl, 6
Sleep, 100
menu, tray, Icon, volicos.icl, 7
Sleep, 100
menu, tray, Icon, volicos.icl, 8
Sleep, 100
menu, tray, Icon, volicos.icl, 9
Sleep, 100
menu, tray, Icon, volicos.icl, 10
Sleep, 100
menu, tray, Icon, volicos.icl, 11
Sleep, 100
menu, tray, Icon, volicos.icl, 12
Sleep, 100
menu, tray, Icon, volicos.icl, 13
Sleep, 100
menu, tray, Icon, volicos.icl, 14
Sleep, 100
menu, tray, Icon, volicos.icl, 15
Sleep, 100
menu, tray, Icon, volicos.icl, 16
Sleep, 100
menu, tray, Icon, volicos.icl, 17
return
and the effect on tray is this (simulate): Posted Image

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
It would be nice if the tray icon reflected the position of the volume slider in Volume Control.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005

It would be nice if the tray icon reflected the position of the volume slider in Volume Control.

The tray already reflect the position of the master volume...

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
To clarify what I meant, the icon should change if I move the volume control slider in Volume Control.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005

To clarify what I meant, the icon should change if I move the volume control slider in Volume Control.

In effect this not work :)
But I don't know how to do this... :( maybe with a constant refresh?

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
I added this before the gosub in the autoexecute section:

settimer, refreshvol, 500

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

PerezDeQueya80
  • Members
  • 6 posts
  • Last active: Dec 28 2005 07:40 AM
  • Joined: 20 Dec 2005
Very nice! Thanks! :D

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
I like the tray icon effect, thank you for sharing. :) I shortened the refreshvol section a little:

refreshvol:
soundget, vol, master
soundget, mute, master, mute
if (vol = 0 or mute = "on")
  menu, tray, icon, volicos.icl, 1
else
{
  volico := ((vol * 0.15) + 2)
  menu, tray, icon, volicos.icl, %volico%
}
return

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

TheNewOne
  • Members
  • 2 posts
  • Last active: Mar 21 2009 09:06 PM
  • Joined: 21 Dec 2005
I like the script very much, but I changed the icons to:

https://ahknet.autoh...One/volicos.icl

It's better to see full volume level and I like these colors more.

Also I added this(from another script) for Wheelcontrol of volume level with the taskbar:


WheelDown::
    CoordMode, mouse, screen
    MouseGetPos, x, y
    SysGet, sy, 1
    if (y>sy-30)
        {
        SoundSet, -5
        GoSub, refreshvol
        } 
    else
        Send {WheelDown}
return

WheelUp::
    CoordMode, mouse, screen
    MouseGetPos, x, y
    SysGet, sy, 1
    if (y>sy-30)
        {
        SoundSet, +5
        GoSub, refreshvol
        }
    else
        Send {WheelUp}
return


Judo
  • Guests
  • Last active:
  • Joined: --
Sorry for question in Scripts & Functions section.

WheelDown::
    CoordMode, mouse, screen
    MouseGetPos, x, y
    SysGet, sy, 1
    SysGet, sx, 0
    if (y>sy-30); cant figure out how to make likex>sx-30 and y>sy-30
    if (x>sx-30);^
        {
blabla..
        }

how to make action if mouse is detected in bottom right corner.
example
--------
|      |
|    __|
|    | |
--------


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

if (y>sy-30); cant figure out how to make likex>sx-30 and y>sy-30
if (x>sx-30);^

Assuming I understand correctly, I think you would write it as:

if (y > sy-30 AND x > sx-30)
...