Jump to content

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

Volume OSD - updated


  • Please log in to reply
68 replies to this topic
compuboy_r
  • Members
  • 68 posts
  • Last active: Oct 29 2005 03:17 PM
  • Joined: 04 May 2004
Try the above script with this line added at top

CoordMode, ToolTip, Screen

Now click on the taskbar and fire the script with volumeup or down key.

Now click on the desktop and again fire the script.

In my pc the tooltip changed its position according to the active window but it should not happen as the CoordMode for Tooltip is set to Screen.

Is this a problem in AHK or what ???


compuboy_r

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I think since that script was written before CoordMode existed, it adjusts the ToolTip based on the active window. Therefore, if you change to absolute coordinates, it gets messed up because it tries to adjust something that's already been adjusted.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Chris is right... actually i didn't bother updating the script with the new feature, once it was added.

anyways i've updated it now.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


compuboy_r
  • Members
  • 68 posts
  • Last active: Oct 29 2005 03:17 PM
  • Joined: 04 May 2004
Well, I have made some modifications to the script

*** Display Mode Changed to TrayTip
*** Added Mute Detection

Try This

;_________________________________________________ 
;_______Volume OSD Script   - Rajat_______________ 
;_________________________________________________ 


;_________________________________________________ 
;_______User Settings_____________________________ 

;Make customisation only in this area or 
;hotkey area only!! 


   ;change characters for empty & full bar here 
   Full = | 
   Empty = - 
    
   
;Customise Hotkeys in Hotkey Customisation Section 
;(below the next section) 



;___________________________________________ 
;_____Auto Execute Section__________________ 

; DON'T CHANGE ANYTHING HERE!! 
; (unless u know what u're doing) 

   SetFormat, float, 0.0 
   SetTimer, splashoff, 1000 
   SoundGet, currsnd1 
   SetTimer, CheckMute, 1000


   ;Building Empty Bar 
   Loop, 100 
      EmptyBar = %EmptyBar%%Empty% 

   Display: 
      SoundGet, currsnd 
      if currsnd1 <> %currsnd% 
      { 
         TrayTip,Volume, %curr%  %currsnd1%`% ,,17
         currsnd1 = %currsnd% 
      } 

      setenv, presstime, %A_MDay%%A_hour%%A_Min%%A_Sec% 
      envadd, presstime, 2 
      SetTimer, SplashOff, On 
   return 


   Splashoff: 
      setenv, presstime2, %A_MDay%%A_hour%%A_Min%%A_Sec% 
      ifgreaterorequal, presstime2, %presstime% 
      { 
         TrayTip
         SetTimer, SplashOff, off 
      } 
   return 



;___________________________________________ 
;_____Hotkey Customisation Section__________ 

; User defined hotkeys here 


Volume_Up::         ;comment this line if u uncomment the ones below. 
;#up::            ;Uncomment to assign Vol Up to Win-Up 
   #MaxHotkeysPerInterval 50 
   SoundSet, +1
   SoundGet, currsnd 
   mark=0 
   curr=%EmptyBar% 
   loopup: 
   mark += 1 
   iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full% 
   iflessorequal,mark, %currsnd%, goto, loopup 
   gosub, display 
return 


Volume_Down::         ;comment this line if u uncomment the ones below. 
;#down::         ;Uncomment to assign Vol Down to Win-Down 
   #MaxHotkeysPerInterval 50 
   SoundSet, -1       
   SoundGet, currsnd 
   mark=0 
   curr=%EmptyBar% 
   loopdown: 
   mark += 1 
   iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full% 
   iflessorequal,mark, %currsnd%, goto, loopdown 
   gosub, display 
return 

;___________________________________________ 




;__________MUTE DETECTION BY COMPUBOY_R


CheckMute:
SoundGet,checkmute,,MUTE
	if checkmute = On
	{
		TrayTip,Volume,MUTE,,1
		mutetray = yes
	}

	else
	{
		if mutetray = yes
		{
		TrayTip
		mutetray = no
		}

	}

return


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
nice!

i'd also tried replacing tooltips with traytips but i've also used traytips for other purposes... and when 2 programs try to use traytips at the same time then strange things happen!

like if an au3 script and an ahk script use them at the same time then traytips get totally confused!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The MSDN docs state that if a TrayTip (balloon) is already displayed, any new one must wait until the other one expires before it will show up.

However, the MSDN docs are also fairly wrong about the timeout feature, so it wouldn't surprise me if competing traytips aren't well behaved.

compuboy_r
  • Members
  • 68 posts
  • Last active: Oct 29 2005 03:17 PM
  • Joined: 04 May 2004
I have added mouse support for lowering and increasing the volume.

With This Script u can lower the volume by mouse

Volume Up : Ctrl+Shift+WheelUp
Volume Down : Ctrl+Shift+WheelDown

I have also deactivated the Mute Detection, but for anyone who needs it just uncomment the lines

Line No. 32 : SetTimer, CheckMute, 1000
Line No. 104 : Remove /*
Line No. 128 : Remove */

compuboy_r

;_________________________________________________ 
;_______Volume OSD Script   - Rajat_______________ 
;_________________________________________________ 


;_________________________________________________ 
;_______User Settings_____________________________ 

;Make customisation only in this area or 
;hotkey area only!! 


   ;change characters for empty & full bar here 
   Full = | 
   Empty = - 
    
    
;Customise Hotkeys in Hotkey Customisation Section 
;(below the next section) 



;___________________________________________ 
;_____Auto Execute Section__________________ 

; DON'T CHANGE ANYTHING HERE!! 
; (unless u know what u're doing) 

   SetFormat, float, 0.0 
   SetTimer, splashoff, 1000 
   SoundGet, currsnd1 
   ;SetTimer, CheckMute, 1000 //Remove Comment Mark here to enable Mute Detection


   ;Building Empty Bar 
   Loop, 100 
      EmptyBar = %EmptyBar%%Empty% 

   Display: 
      SoundGet, currsnd 
      if currsnd1 <> %currsnd% 
      { 
         TrayTip,Volume, %curr%  %currsnd1%`% ,,17 
         currsnd1 = %currsnd% 
      } 

      setenv, presstime, %A_MDay%%A_hour%%A_Min%%A_Sec% 
      envadd, presstime, 2 
      SetTimer, SplashOff, On 
   return 


   Splashoff: 
      setenv, presstime2, %A_MDay%%A_hour%%A_Min%%A_Sec% 
      ifgreaterorequal, presstime2, %presstime% 
      { 
         TrayTip 
         SetTimer, SplashOff, off 
      } 
   return 



;___________________________________________ 
;_____Hotkey Customisation Section__________ 

; User defined hotkeys here 

^+WheelUp::       
Volume_Up::         ;comment this line if u uncomment the ones below. 
;#up::            ;Uncomment to assign Vol Up to Win-Up 
   #MaxHotkeysPerInterval 50 
   SoundSet, +1 
   SoundGet, currsnd 
   mark=0 
   curr=%EmptyBar% 
   loopup: 
   mark += 1 
   iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full% 
   iflessorequal,mark, %currsnd%, goto, loopup 
   gosub, display 
return 

^+WheelDown::
Volume_Down::         ;comment this line if u uncomment the ones below. 
;#down::         ;Uncomment to assign Vol Down to Win-Down 
   #MaxHotkeysPerInterval 50 
   SoundSet, -1        
   SoundGet, currsnd 
   mark=0 
   curr=%EmptyBar% 
   loopdown: 
   mark += 1 
   iflessorequal,mark, %currsnd%,StringReplace, curr, curr,%Empty%,%Full% 
   iflessorequal,mark, %currsnd%, goto, loopdown 
   gosub, display 
return 

;___________________________________________ 


;Also Remove Comment Marks /* and */ to enable mute detection

/*
;__________MUTE DETECTION BY COMPUBOY_R 


CheckMute: 
SoundGet,checkmute,,MUTE 
   if checkmute = On 
   { 
      TrayTip,Volume,MUTE,,1 
      mutetray = yes 
   } 

   else 
   { 
      if mutetray = yes 
      { 
      TrayTip 
      mutetray = no 
      } 

   } 

return

*/


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
nice!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Script Updated:

Now you can change Master Volume AND Wave Volume, both showing OSD.

Also, hotkeys section is moved to top of script to allow easy customisation to newbies.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


PerezDeQueya80
  • Guests
  • Last active:
  • Joined: --

Display: 
      SoundGet, currsnd 
      if currsnd1 <> %currsnd% 
      { 
         TrayTip,Volume, %curr%  %currsnd1%`% ,,17 
         currsnd1 = %currsnd% 
      } 

      setenv, presstime, %A_MDay%%A_hour%%A_Min%%A_Sec% 
      envadd, presstime, 2 
      SetTimer, SplashOff, On 
   return 

A little bug in compuboy_r code:
TrayTip,Volume, %curr% %currsnd1%`% ,,17
TrayTip,Volume, %curr% %currsnd%`% ,,17
(%currsnd% and not %currsnd1%) ;)

however great program, great script, great all and you are great :)

oxymor0n
  • Members
  • 2 posts
  • Last active: Mar 23 2005 01:14 AM
  • Joined: 22 Mar 2005
hi, I'm new here, so please be gently ;)

i added a special mute function, which i was inspired to by the cd-player in my car: it doesn't mute to zero but to a lower level.
maybe someone prefers this version of "mute".

; Silence value
silence = 20

HotKey, #., vol_MasterSilence

vol_MasterUp:
Clip = 
SoundSet, +%vol_Step%
Gosub, vol_ShowBars
return

vol_MasterDown:
Clip = 
SoundSet, -%vol_Step%
Gosub, vol_ShowBars
return

vol_MasterMute:
Clip = 
SoundSet, +1, , mute
return

vol_MasterSilence:
If Clip = 
   { 
   SoundGet, tmp, Master
   SoundSet, %silence%
   Clip = 1 
   } 
Else 
   { 
   SoundSet, %tmp%
   Clip = 
   } 
Gosub, vol_ShowBars
return

i also have a little question:
is it possible to multiply the current volume level by a factor, e.g. by 0,1 for 10% of current volume level?
thanks

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Make sure you return after the auto-execute, or else it will run into the first label. And for the 10%, simply run it on the tmp variable (the current volume):

tmp/=10


oxymor0n
  • Members
  • 2 posts
  • Last active: Mar 23 2005 01:14 AM
  • Joined: 22 Mar 2005
thanks for the fast reply jonny, have changed it to:
HotKey, #Up, vol_MasterUp      ; Win+UpArrow
HotKey, #Down, vol_MasterDown
HotKey, #-, vol_MasterMute
HotKey, #., vol_MasterSilence 

vol_MasterUp: 
Clip = 
SoundSet, +%vol_Step% 
Gosub, vol_ShowBars 
return 

vol_MasterDown: 
Clip = 
SoundSet, -%vol_Step% 
Gosub, vol_ShowBars 
return 

vol_MasterMute: 
Clip = 
SoundSet, +1, , mute 
return 

vol_MasterSilence: 
If Clip = 
   { 
   SoundGet, tmp, Master 
   tmp/=5
   SoundSet, %tmp%
   Clip = 1 
   } 
Else 
   { 
   tmp*=5
   SoundSet, %tmp% 
   Clip = 
   } 
Gosub, vol_ShowBars 
return 

btw. this is not the whole script, just the part, that i changed

tinypig
  • Members
  • 16 posts
  • Last active: Aug 29 2014 12:36 AM
  • Joined: 12 Mar 2005
Rajat--

I still use your other volume control script with the progress bars (love it, by the way, thanks). What's the advantage of this one over the other one you wrote?

--David

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
there have been many mods since the original VolOSD i wrote... some add mute detection, some use gui etc. use the one u prefer.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat