topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday December 2, 2024, 8:55 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Volume Mixer instead of Master Volume Control  (Read 16674 times)

guerillablood

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
DONE: Volume Mixer instead of Master Volume Control
« on: July 03, 2014, 10:20 AM »
I'm looking for a better way to get to my volume mixer in one click, preferably without having to run another volume control program.

I was wondering if it's possible a AutoHotKey script could change this behavior to where I can click the volume icon in the tray and instead of getting the master volume control, it'd display the mixer, but in a window that functions like the master volume control in that, it is undecorated (no title bar/window borders) and hides/closes when it loses focus. If not a script perhaps a safe registry hack? ;)

I already have a simple AHK script that allows me to hold control and click the middle mouse button on the taskbar to get mixer to pop up in a new window (as it normally functions when you click the master volume control and click "Mixer") but I'm wondering if someone could put together a better way to accomplish this.

I'm willing to bet there is another 3rd party mixer that will do this for me, but I'd rather not install another program since the Windows 7 volume mixer does the job just fine and portability in something like an AHK script is preferred. Though I am open to suggestions of programs (with a focus on being as lightweight and portable as possible) if this request is simply too picky.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #1 on: July 03, 2014, 04:15 PM »
See if this works as expected.

~LButton  Up::
Sleep 250
If  (WinActive("ahk_exe SndVol.exe") )
    Send,!x
return

The 250 is a quarter second delay to allow the window to open.  I've found 250 ms to be a good value for this purpose generally.

If you notice any delay or strange behavior in left button mouse click then it may need to be modified.  But the tilde prefix on the hotkey should allow the system to process mouse clicks normally... I hope.   :)

Edit:  I put a shortcut on my desktop because it can be difficult to click on a tray icon when the system is loading.  I forget where I got the Target line from.  But it opens the mixer:

%windir%\System32\SndVol.exe -T 49490633

« Last Edit: July 03, 2014, 05:28 PM by MilesAhead »

guerillablood

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #2 on: July 04, 2014, 08:39 AM »
Thanks Miles, the script works fine, but it didn't quite achieve what I was going for.

I already have a hotkey to open the mixer, I was just looking for something that changed the behavior of the mixer window slightly so that it would auto close when it lost focus.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #3 on: July 04, 2014, 09:21 AM »
Thanks Miles, the script works fine, but it didn't quite achieve what I was going for.

I already have a hotkey to open the mixer, I was just looking for something that changed the behavior of the mixer window slightly so that it would auto close when it lost focus.
-guerillablood (July 04, 2014, 08:39 AM)

OK.  Let me see if I can add that.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #4 on: July 04, 2014, 10:36 AM »
Please try this one

#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

GotFocus := false

~LButton  Up::
Sleep 250
If  (WinActive("ahk_exe SndVol.exe") )
{
    Send,!x
    GotFocus := true
    Settimer, CheckFocus
}
return

CheckFocus:
If  (WinActive("ahk_exe SndVol.exe") )
    return
    SetTimer,,Off
   ; If GotFocus is false window is likely not open anyway
    if (GotFocus)
    {
      WinClose, ahk_exe SndVol.exe
     GotFocus := false
    }
return
« Last Edit: May 20, 2015, 07:20 AM by MilesAhead »

guerillablood

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #5 on: July 04, 2014, 01:59 PM »
Outstanding, works magnificently. Thank you!

The wonderful people over here at DonationCoder never cease to surprise me. Any suggestion for getting a borderless/undecorated/no title bar appearance?

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #6 on: July 04, 2014, 03:01 PM »
Nice work, MilesAhead.  I'll move this to the finished section.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #7 on: July 04, 2014, 03:21 PM »
Outstanding, works magnificently. Thank you!

The wonderful people over here at DonationCoder never cease to surprise me. Any suggestion for getting a borderless/undecorated/no title bar appearance?
-guerillablood (July 04, 2014, 01:59 PM)

Glad you like it.  You could play around with WinGet and WinSet changing the window style and exstyle attributes.  TopMost Toggle does it for Topmost style.  It has source and you can download here:
milesaheadsoftware.tk

The ahk help has a chart with the styles.  What you describe sounds like Toolbar but I'm not sure.


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #8 on: July 04, 2014, 03:22 PM »
Nice work, MilesAhead.  I'll move this to the finished section.


horroq

  • Participant
  • Joined in 2015
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #9 on: May 19, 2015, 07:52 PM »
Please help me . I want to have volume mixer instead of master volume but I didn't understood What I have to do . Coul you place help me ?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #10 on: May 20, 2015, 06:04 AM »
Please help me . I want to have volume mixer instead of master volume but I didn't understood What I have to do . Coul you place help me ?

hi horroq,
download AutoHotKey (AHK) from this page:
http://ahkscript.org/
(there's portable and installable versions there)

Now save the script below (click the copy or print link and save with a .ahk file-ending e.g. VolumeMixer.ahk

Please try this one

#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

GotFocus := false

~LButton  Up::
Sleep 250
If  (WinActive("ahk_exe SndVol.exe") )
{
    Send,!x
    GotFocus := true
    Settimer, CheckFocus
}
return

CheckFocus:
If  (WinActive("ahk_exe SndVol.exe") )
    return
    SetTimer,,Off
    WinClose, ahk_exe SndVol.exe
return

Open the script with AutoHotKey.
I havent used this script so not sure what it does.
It will show in the system tray - you can right-click the icon there for options
Tom

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #11 on: May 20, 2015, 07:14 AM »
I havent used this script so not sure what it does.
-tomos

I forgot what it did myself.  After trying it I remembered.  If it is running and you click the mouse on the speaker in the task tray, as soon as the volume control comes up it sends alt x to make the mixer come up.  Then if you click somewhere else, like on the desktop, it closes the mixer window.  Hmmm, I think I should add that to my general purpose hotkey file and use it myself.  :)


Edit: I see where I didn't use the variable GotFocus for anything.  I guess I should check it before bothering to close SndVol.exe.  I'll edit the script.  :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #12 on: May 20, 2015, 08:47 AM »
Here is the script with a few enhancements and a custom icon, compiled to exe.
The source and icon are included.  I added a global hotkey, control shift v
to open the volume mixer.  Also single clicking on the SoundMixer.exe tray icon
will do it.

See about command in tray menu and/or Readme.txt file included in the .zip

You may download SoundMixer.zip from my page:
http://milesaheadsoftware.org

Edit: seems the upload is corrupt.  The connection died in the middle.  I'll add another edit when I get the file to the page and check the MD5 to make sure it's OK.

Edit2:  Been trying since 8:47 AM to upload a 365 kb zip file.  Goes all the way until I click Upload Button.  T"hen it's time for the spinning circle.  I'll let you know if it ever gets there.  :)

Edit3:  I finally got through.  I downloaded and the MD5Sum is a match.  I'm running the program from the download now.  It should be OK.   :Thmbsup:

Edit4: I am back in the same boat.  I tried to upload a revised zip file and it connects just long enough to corrupt the file on the server.  As soon as I try to upload then I cannot upload or download anything.  All I get is the dreaded spinning circle.  If I get the file on I'll post Edit #5.  :)


Edit5:  OK. Uploaded new zip.  Download it and checked MD5Sum.  Seems we are good now.  :)

« Last Edit: May 21, 2015, 08:54 AM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Volume Mixer instead of Master Volume Control
« Reply #13 on: May 22, 2015, 12:22 PM »
Updated to version 1.1.0.0.  I redesigned it to be a bit more automatic.  You should notice after opening the Volume Mixer using it, when you click someplace else, it closes the window more consistently.  Also I removed the test for the Volume Mixer Window after every Left Mouse Button release.  It uses polling at1/4 second intervals.  Much smoother.  Less chance of side effects.

Also it ignores commands while the About Box is open.  See Readme.txt file included in the zip for the gory details.  :)