Tur-Another Idle Volume Adjuster by Turranius

Purpose: Lowers or mutes the master volume after a defined amount of time.

Reason : Originally ment for HyperSpin to lower/mute the volume after you have not touched anything for some time.
         It is totally stand-alone though, so any reason you can think of.

Usage  : You only need the exe file. The first time you run it, it will create the Settings.ini file and quit.
         Change the Settings.ini file as you want it configured and restart it. All the options are described below.

Disclamer: You configure the volume in this app. If you blow your eardrums by configuring it to raise the volume
           to 100% or similar, I can not be held responsible. Please read through the options.

Changes: 1.0 - 2014-12-15 - First public release.

Settings:

[General Settings]

Time_To_Idle=
Number of seconds before being considered idle. Any keypress or mousemove should reset this timer.
Valid: Any number of seconds.
Default: 360

Debug=
When this is enabled, a traytip will be used to describe what it is doing. If you run into problems or are
interested in what the options you set modify how it works, set this to True.
Note: There are a few more sleep functions while in debug mode to be able to see the messages so it might feel
      a bit sluggish when debug is on. Its detects keypresses and similar faster without debug on.
Valid: True/False
Default: True


[Sounds Options]

Simply_Mute_Audio=
When this is enabled, audio will simply be muted when the idle time kicks in. No fading will occur or similar
just mute or unmute instantly.
When this is enabled, all other options in [Sound Options] are non-valid and do nothing.
Valid: True/False
Default: False

Set_Volume_at_Startup=
This program has one big problem. It has NO idea what you're current volume is at startup. Therefor, it
is a bit hard to fade out sounds by percentage or similar. However, this setting ensures that your volume
is always set to the value define when the program starts. It does this by simply lowering the volume 100
times at startup, then raising it to the defined value. Then we know what the volume is.
If you set this to False, your volume is not touched at startup.

It is strongly adviced to set to a value so it can force that volume at startup.

Valid: False/0-100  - where 0 is lowest and 100 is max volume.
Default: 80

Set_Volume_at_Idle=
This setting works in two different ways.
1: If Set_Volume_at_Startup is set to False (Dont touch the volume at startup), this setting is the number of
   "volume down" clicks the program will do on idle time.
   For example, if your volume is set to 80% and this setting is set to 20, your volume, at idle time, will
   be lowered to 60% (80-20 = 60% volume).
   So if your volume is set to 30% and you enter 30 or more in this value, your volume will be 0 at idle time.

   Since we have no idea what your volume really is set to, the volume will be lowered and raised back again to
   this value. That means, if you set this to, say 80 and your current volume is 50%, it will lower it to 0%
   volume when the idle time kicks in and raise it to 80% when no longer in idle time. Be careful.

2: If Set_Volume_At_Startup is set to a value, this will act as the percentage you want your volume set to
   instead. Much better.
   Example: Set_Volume_At_Startup is set to 80, so your volume will be forced to 80% at startup.
            Set_Volume_At_Idle is set to 30, so when idle time kicks in, your volume will be set to 30%.

Valid: 0-100
Default: 30

FadeOut_Delay=
The delay when fading out. This setting defines how fast the volume is lowered in milliseconds between each
click of "Volume down".
If you have problems with the volume not being controlled as it should by this program, try raising or lowering
this value to see if that fixes it.

NOTE: You CAN abort the fade out process and raise the volume back up, but only by moving the mouse. Pressing
keys will not help and it will keep lowering the volume until its done. I'll see if I can find a way to detect
a keypress. I can not use the default idle check that is used otherwise in this script since it is reset the moment
it presses the volume-down "buttons".

Valid: 0-10000
Default: 450

FadeIn_Delay=
Same as above, but how fast to raise the volume again when you are no longer idle.
Valid: 0-10000
Default: 20


[Advanced]
Advanced settings in here. Should not need to use them really.

KeyPressDelay=
Only used if Set_Volume_at_Startup is set to a value. Delay between each keypress when lowering the volume
to 0 and back up to the defined value. In general, this should be as fast as possible.
Valid: 0-10000
Default: 0

ForceMuteOff=
Only used if Simply_Mute_Audio is set to True. If this setting is True, it will ensure that mute is not on
when starting the program by lowering the volume one step and raising it once again.
Otherwise, if mute is on when you start the program and when idle time kicks in, it actually unmutes.
Valid: True/False
Default: True

ExitWithShiftESC=
The default exit key to quit this program is Shift-Escape.
If you wish to disable this setting, set this to False. Perhaps you use those keys for something else.
When in debug mode, it can be a bit hard to kill the program in the traybar so I left the Shift-Escape in here
to kill it.
Valid: True/False
Default: True

AbortIdleUsingFadeIn_Delay=
If you abort the fade out process when its lowering the volume by moving the mouse, do you want to instantly
raise the volume back up or fade it back in using the FadeIn_Delay value?
Valid: True/False
Default: True

