Another Idle Volume Adjuster

Turranius

Member
Supporter
RL Member
I made, and posted this, for Hyperspin, but seeing that RocketLauncher can take more then one front end and this program cares little of your front end, why not post it here as well =)

http://grandis.nu:81/software/Tur-AnotherIdleVolumeAdjuster

Basically, this little program is full of features, but its main purpose is to lower (or mute) the volume after a time of idle and to bring it back when you move or press anything.
Any suggestions? Let me know.

Some features.
  • Set the volume to a percent of the current volume after an amount of time (This is the default).
  • Just mute the audio after an amount of time (Works on XP)
  • Force the volume to a certain percent at startup.
  • Force the volume to a certain percent when going idle (A definable percent instead of a percent of current volume).
  • Definable FadeOut delay and FadeIn delay.
  • Full-fledged application launcher with working dir, delay and restart options.
  • Exceptions. You specify the exe file(s) you want. If one of them is active, it will not go idle.
  • Volume per program. has the ability to change the volume to a certain percent if a process (program) is running.
  • Splashscreen. By default, a progress bar is shown. You can also use images (included examples) that are shown when going idle and when it is idle. Or use message boxes instead. Or disable the splashscreen.
  • Right click it in the traybar for a menu.
  • And a few advanced options.

Ps. if anyone wants the source for it to verify that I don't do anything silly, please ask. I plan on letting that go free in the future, but, I want to clean it up and make better descriptions for it first.

Limitations/Sideeffects: Pause in RocketLauncher. See this thread: http://www.rlauncher.com/forum/show...le-Volume-Adjuster&p=8061&viewfull=1#post8061
tl;dr? Set this in Settings.ini for TAIVA for full functionality with Pause.
FadeIn_Delay=False

Readme:

Changelog:
Code:
1.4.1	2016-05-13
	Chg:	Changed the look of the Basic Configuration GUI to look more like the Advanced Configuration in that you
		can hold over the text to get details.

	Add:	Added "Idle Flash Move" and "Idle Flash All Screens" to the Basic Configuration GUI.

	Chg:	Default value for ManualVolumeStep changed from 5 to 1.

	Chg:	If ProgramSpecificVolumeIfActiveOnly=True and a program is closed or lose focus, it will do a check
		if the process still exists before restoring the volume up. If it exists, it will wait a maximum of 2
		seconds before restoring the volume up. It will stop waiting if its closed sooner.
		Why? If you have a fadeout screen active in RocketLauncher, it will show before the emulator that you
		set a specific volume on is closed, thus making it lose focus and restoring the volume too soon otherwise.
		As always, if the volume should go down, it will not delay. Only on up.

	Add:	Added [Advanced] option ProgramLaunchCloseOnExit=True/False.
		With it set to True (default), any program launched at startup with [ProgramLaunch] will be closed when
		TAIVA is closed. That way you can use TAIVA as the main launcher for all your apps and just restart TAIVA
		to restart them all. Available in the Advanced Configuration GUI.

	Add:	Added [Advanced] option RestartKey. Pressing this key will restart TAIVA. If you have programs being
		launched from [ProgramLaunch] and ProgramLaunchCloseOnExit=True, all programs will be restarted as well.
		Default is empty so its disabled. Can be set via the Advanced Configuration GUI.

		Also added a "Restart TAIVA" option directly from the tray icon.

	Chg:	Applications in [ProgramLaunch] will no longer start again if they are running already. Actually rewrote
		much of how [ProgramLaunch] programs work. Check the bottom of the ReadMe.txt. You can now replace
		your startup scripts, if you have them, and just let TAIVA do the work.

1.4.0	 2016-04-13
	Chg:	Big change. Now uses the Windows API to control volume and mute. Works a lot better as it can now
		check, for example, if mute is on or not. Plus no more external dll files and similar to manage.
		Thanks to bleasby for the idea =)

	Fix:	Fixed crash that occured when the volume was at 0% during startup.

	Fix:	Setting either Fade Delay to False did not instantly change the volume as it should have (in or out).

	Chg:	Added a GUI for configuring the basic options. This will be shown at first startup or if no Settings.ini
		file exists. You can also reach it by clicking the TAIVA icon in the traybar and selecting "Configure".
		I moved the Edit and Reload Settings.ini functions from the trayicon in here as well. 
		You can change all the settings in here without having to restart the application, and test how your 
		transparency / volume bar will look etc.
		You may test your settings for a while without saving with the "Apply and Test" button.
		If you like your new settings, do not forget to click "Apply and Save".

		While testing stuff in there, you can always click the "Reapply Settings.ini" button to go back to the
		settings in your Settings.ini directly, provided you have not yet clicked "Apply and Save".

	Chg:	Moved all the ManualVolume* settings from the [Advanced] section to a new [Manual Volume] section.
		They will be created there automatically with the default settings if you do nothing. The ManualVolume
		settings in [Advanced], if you leave them there, will do nothing. I suggest you move them over.

	Chg:	If moving the volume down to 0%, it will automatically mute.
		Basically, there is a new check in place. If volume is at 0%, mute. If the volume is not at 0%, always
		make sure it is not muted.

	Chg:	If you shut down your computer/cab while it is in idle mode, it will do one quick attempt to restore
		the volume. That way, it should not start up muted or at low volume next bootup.
		The same is true if you close TAIVA while it is muted or in the process of restoring the volume.
		This can be controlled with the new [Advanced] setting RestoreVolumeOnExit.
		It defaults to "Fade", meaning that it will try to fade the volume back in quickly.

	Add:	Added a [ProgramLaunch] section to Settings.ini. You can have TAIVA automatically launch other
		programs after it is done with its initialization. Once again, see Readme.txt.
		If upgrading, you'll have to add the [ProgramLaunch] section yourself somewhere in the INI file.

		Not sure if this function will ever be used but here it is..

	Chg:	FadeOutNow hotkey disabled while volume is fading down so you can not press it twice by mistake.

	Chg:	Manual Volume Up and Down no longer uses the built in function in Autoit to raise or lower the volume so
		it no longer counts as a keypress. They now use the Windows API as the rest of the system.

		This is unless you are on Windows XP. If using that old OS, it still uses the built in functions. No
		Windows API functions are used if you're on XP.

		If you would rather use the old system that actually press the VolumeUp and VolumeDn buttons instead of the
		Windows API, I've added ManualVolumeUseAPI to the Settings.ini. Normally its True, but change it to False to
		go back to using the old system.

	Chg:	Manual Volume Up and Down buttons are now disabled while in idle mode or while its restoring the volume.

	Add:	New [Advanced] option: ManualVolumeShowProgressBar=2
		A volume slider will be displayed when using the Volume Up and Volume Down buttons. This is the number of
		seconds to show this slider. Set it to False to disable it.
		The slider has the same look as when its fading in/out, providing you have IdleFlashProgressBar=True

	Add:	New [Advanced] option: IdleExceptionIfActiveOnly=True/False.
		Works in the same way as ProgramSpecificVolumeIfActiveOnly does, but for programs in [IdleException].
		If set to False (Old default method), as long as the process is started, it will idle forever until it closes.
		If set to True however, the process must exist AND be the active window for TAIVA to wait for it. As soon
		as it loses focus or is closed, TAIVA will resume operations.

	Chg:	The volume slider shown for IdleFlashProgressBar and ManualVolumeShowProgressBar is now thinner and
		looks better IMO. This is the new default setting anyway. I've added 5 options to it so you can make
		it look however you want:
		IdleFlashProgressBarWidth=665
		IdleFlashProgressBarHeight=19
		IdleFlashProgressBarLeft=-1
		IdleFlashProgressBarTop=-1
		IdleFlashProgressBarVertical=False

		You can reach these settings in the new GUI and even test it out from there. You can even have the
		bar cover the whole screen by setting your screen resolution to IdleFlashProgressBarWidth and 
		IdleFlashProgressBarHeight. Makes for a rather cool effect.

	Chg:	The volume slider shown for IdleFlashProgressBar and ManualVolumeShowProgressBar does now use the
		IdleFlashTransparency setting to be transparent. I do not think it needs its own transparency setting.
		Anyone objects?

	Chg:	Rewrote parts of the Program Specific Volume function to be more effective when ProgramSpecificVolumeIfActiveOnly
		is set to True.

	Chg:	When restoring volume from a Program Specific Volume (it's not running anymore), it will fade the volume
		back up with a delay of 20 which is quite fast. It will NOT show a volume bar when that happens.
		Previously, it just set the new volume instantly which could be a bit painful.

		If it needs to restore the volume down though, it will still be instantly set as before.

	Add:	If a program in [IdleException] or [ProgramSpecificVolume] causes TAIVA to idle or set a specific volume, the traybar
		icon tooltip will reflect this. Simply hover over the icon.

	Add:	Added option ForceFocusSetup to the [Advanced] section. 
		It is not added to your Settings.ini automatically. It takes two keys that you hold for a number of seconds
		to force a specific Windows Title back into focus.
		See Readme if this is something you need, otherwise don't bother.
		It was created for those times that HyperSpin lost focus for some reason.

	Chg:	Trimmed the various messages that pop up in the center of the screen to look better (for example when forcing fade out).

1.13.1   2016-02-11
	Del:	Removed the ForceMuteOff function. Since 1.13.0, it used the built in "press keys to unmute"
		functions, but if it does that while HyperSpin starts, HyperSpin will skip the intro.
		This means that if your volume is muted, it will stay muted, even when changing volume.
		One exception is the ManualVolumeUp and ManualVolumeDn functions which still sends commands
		to raise and lower the volume. Should you press those, it will unmute automatically.

	Add:	Added a little check when it starts running. If, at startup, the idle time is high enough to
		go idle immidiatly, it will move the mouse one pixel to reset the idle timer. This will prevent
		it from going idle when (re)booting your cab and no input has happened yet. It will not cause
		HyperSpin to skip the intro.		  

1.13.0   2016-02-04
	Add:	Added advanced option ProgramSpecificVolumeIfActiveOnly=True. It controls how the programs in
		[ProgramSpecificVolume] works. If its set to True, the the process specified must be running
		AND be the active window. So you can add, for example, HyperSpin.exe=100 to [ProgramSpecificVolume]
		to make sure the volume is always 100% while hyperspin is the active running window.

		If this does not work out, we can change [ProgramSpecificVolume] to use part of the windows title
		instead of the process name.

	Add:	Added option in Settings.ini: IdleFlashAllScreens=True. 
		With this to True, the image or text shown while idle will jump across all screens, if you have more
		then one. If False, it only jumps around the first screen, as before.

	Chg:	The IdleFlash image or text now moves between locations on screen instead of teleporting. I selected
		to move it rather fast since while it is moving, it will not break out of idle when you move or press
		a key (It will still break out of idle once the window stopped moving). It looks a lot better though.

	Fix:	The splashscreen images now uses the scriptdir instead of workdir. Should work better if TAIVA is
		executed from some other script that sends the wrong workingdir, etc.

	Fix:	Since we moved away from the Volume Mixer, the function ForceMuteOff=True stopped working. We used
		the new method to lower the volume by 1 and up by 1 again, but it does not remove the mute anymore.
		Its now changed to use the built in VolumeDown and VolumeUp instead, but depending on drivers, it
		might show a volume meter on screen for a second during startup.
		If you don't like it, set ForceMuteOff=False.

	Chg:	A lot more cleaning of unneeded code done. Rewrote the whole lower/raise volume and "break out of idle
		if you move something" functions to be more efficient. Previosly, it was three different places where
		it modified the volume. Now it just uses one function for it, so easier to maintain (for me).

1.12.0b1 2016-02-03
	Chg:	Major change. We no longer need the Volume Mixer so the number of problems it caused should now be gone!
		This caused a major rewrite and I got rid of a few hundred lines of code (yeah yeah.. script code).
		Instead, a W7VVol.dll file will be extracted to your TAIVA directory, should it not already exist.

		Another nice function this brings is that when it changes volume, Windows no longer plays the 
		"Default Beep" sound that you previously had to disable to not go nuts.

	Chg:	The FadeOut_Delay and FadeIn_Delay functions was a bit slow when you set it really low. Even setting
		either of them to 0 was a bit to slow IMO. You can still set them to FALSE to directly set the volume
		without fading, but I've now trimmed it even more when they are set below 30.

		If either one of them are set between 20-29, it will move the volume 3 steps each time, speeding it up.
		10-19 = 5 steps each time.
		0-9 = 7 steps each time.

		From 30 and up, it still moves the volume 1 step at a time. No difference there.

		This might be changed in the future depending on your wishes.

	Del:	Removing VolumeMixerName from Settings.ini the first time you run this version. Not needed.
	Del:	Removing CheckVolumeControlActive
	Del:	Removed the function [Programs To Launch At Startup]. While this is a nice feature, I see no
		reason why you want TAIVA to launch other programs any more. Use a HyperSpin launch script or
		something instead. More code gone!
	Del:	NeverCloseSndVol is gone too.

1.11.0b7 2016-02-02
	Fix:	Was obviously tired last night. Forgot an "exit" in the script so it did not do much..

	Chg:	Changed [Programs To Launch At Startup].
		It now checks that the program to launch is not already running. If it is, it will not run it and not
		pause for the delay set for that program.

		If the program you are starting is not the one you want to check on (say you launch HyperSpin.exe from
		a VBS file or similar, then we can not really check if the VBS file is running already since it exits
		once its launched HyperSpin.exe), you can now specify the filename to check for if its already running
		as well.

		Example 1: Just run HyperSpin.exe and wait 60 seconds.
		[Programs To Launch At Startup]
		I:\Arcade\HyperSpin\HyperSpin.exe = 60

		Example 2: Launch a VBS file but check for HyperSpin.exe. If its already started, do not run the VBS.
		[Programs To Launch At Startup]
		I:\Arcade\HyperSpin\HyperSpinStartup.vbs,HyperSpin.exe = 60

		So, just add a , and the program you want it to check if its already running.

1.11.0b6 2016-02-01
	Chg:	Removed the startup delay thingy I had going. It previously waited and did nothing if you just started
                your cab and had not yet pressed any buttons or moved the mouse. It caused more problems then it solved.

	Add:	Added a section to Settings.ini called [Programs To Launch At Startup].
		In here you can add full paths to applications you want to run after TAIVA has launched and set itself
                up. You must also set a delay for how long to wait before continuing after launching the program.
		You can add more then one program, one on each line. See Readme.txt for more.

		Here is a nice thing: If you set TAIVA to launch, say, hyperspin.exe, you can add a file called
		StandBy.jpg in the same folder as TAIVA. It will then be displayed in fullscreen until all the
		programs have launched and their delay is over. This is NOT shown "on top", so when HyperSpin
		launches, it will be on top of the image. Set a high enough delay and you'll get a nice transition.

		A StandBy.jpg will be extracted the first time you run TAIVA. If you are upgrading and want it,
		delete or temporarily rename your Settings.ini.

1.11.0b5 2016-01-30
	Chg:	Previously, it checked if the Volume Mixer name exists and was correct once at startup. It now checks
		it every time the Volume Mixer is started and waits up to 120 seconds from seeing SndVol.exe but not
		the Volume Mixer window before aborting. Sometimes it might lag between the process SndVol.exe
		existing and the Volume Mixer window appearing.

	Chg:	More tweaking to the CheckVolumeControlActive = "TRUE" function.

1.11.0b4 2016-01-23
	Add:	Added more logging if CheckVolumeControlActive = "TRUE" in Settings.ini to find a possible problem.

	Fix:	Changed the CheckVolumeControlActive to always read its status in uppercase. (TRUE/FALSE, even if set
		to true/false or any variant in between. Should not matter but looks better.

1.11.0b3 2016-01-20
	Fix:	It kept the volume mixer open in some instances when NeverCloseSndVol was set to False.
		It should close it when its done with that setting so added few more "check if I should close it".

1.11.0b2 2016-01-19
	Add:	Added shortcut key Shift-Alt-D to show a debug window of the current active window in an attempt to find
		a rare error. If you can not see the window after pressing the combination, close the current emulator you
		have running and it should be in the background somewhere. 

1.11.0b1 2015-09-16
	Add:	Added option CheckVolumeControlActive to Settings.ini. This function, when set to True, checks that the
		Volume Mixer is NOT the active window. Apparently, the Volume Mixer might pop up visible and will not go
		away. Probably only happens if you shell HyperSpin. Anyway, if you open Volume Mixer in any way except for
		the ShowHiddenSndVolKey hotkey and with "Show/Hide Volume Mixer" from the tray icon , it will be hidden again.
		If TAIVA knows which window was the active one before it popped up, it will switch back to that application.
		If TAIVA has no idea which window was the active one, it will simply press Alt-Tab once.

1.10.0	2015-05-09
	Chg:	Rewrote a few parts to better facilitate debugging. I've had it crash a few times in testing previously
		because I did not check if, for example, something actually was an array before starting working on it, etc.

	Fix:	The function to reload SndVol.exe if it becomes unresponsive crashed. Actually, the entire function that I
		called to restart it was missing from 1.9.3 entirely... not sure where it went =)
		In other words, the function to restart SndVol.exe, should it become unresponsive, crashed TAIVA.

	Chg:	With ManualVolumeAutoSave=True and ManualVolumeAutoAdd=True, the message that pops up, asking you if you
		are sure that you want to add the program to the [ProgramSpecificVolume] section has been changed to 
		always be on top. Default button has been changed to "No".
		Default time until it automatically answers "No" if you do not respond changed to 60 seconds.

	Fix:	If you have Simply_Mute_Audio = True, it would still launch the Volume Mixer and probably fail on XP.
		I've now disabled all executions of the Volume Mixer in this case. Also, Program Specific Volume is
		totally disabled (how is that going to work when it simply mutes?).

	Chg:	Default value for IdleFlashLoopsToMove changed from 1 to 5 (From 1 second to 5 seconds) as the animation
		was moving a bit too fast IMO. Only impacts new creations of Settings.ini.

1.9.3	2015-03-13
	Fix:	With FadeIn_Delay=False (to instantly fade in volume again) and AbortIdleUsingFadeIn_Delay=True, it would
		fade in the volume with a delay of 0 instead of just raising it instantly. Now, AbortIdleUsingFadeIn_Delay
		is not used at all if FadeIn_Delay=False.

	Fix:	More work went into the startup-delay. If you moved your mouse cursor while starting TAIVA, it did not
		abort the startup-delay as it was supposed to. Now the initial delay only kicks in if the system has
		been idle for longer then 10 seconds at startup.

	Chg:	Moved the startup-delay before checking the Volume Mixer. This should also give the system more
		time to finish loading everything before doing the first start of SndVol.exe when lauched on
		system bootup.

	Fix:	If IdleFlashProgressBar was True then the Progress Bar was still showing when fading back in, even if
		EnableIdleFlash was set to False.

	Chg:	When doing the initial launch of SndVol.exe (The volume mixer) and it can not find the Volume Mixer
		window, it will wait 20 seconds before trying again. This might help with those getting and error
		mixer that the volume mixer can not be found when the system starts. If that is not enough, you
		may also try the ForceDelay (below).

	Add:	Added ForceDelay to Settings.ini. The default is 0 (disabled) but you can set it to the number or seconds
		before the application will do anything at all. Use this if you have problems finding the volume mixer
		when you restart your machine. It allows your system more time to finish loading everything.

	Fix:	During setup, when trying to find the windows title for your Volume Mixer, if you have a slow machine, the
		process for SndVol.exe started but there is a delay before the Volume Mixer window pops up. A retry was
		added if it detects the SndVol.exe process but can not find its window title. It will retry once more
		after 5 seconds.

	Chg:	Added a quick error message if you tried to force fadeout (Shift-Alt-F or with the tray icon) while either
		the program has not started yet (ForceDelay or other delay) and if an Exception program is running.
		In other words, you can not initiate a force fadeout if the program has not fully initialized OR a program
		in your exceptionslist is running.

	Chg:	Added checks to make sure the Volume Mixer is working. If we attempt to change the volume but it does not move
		then it will restart the Volume Mixer. Hung process perhaps?

	Chg:	If you closed the Volume Mixer when it was restoring the volume after being idle, it would behave very badly.
		An extra check for this was added to restart it if, for some reason, the Volume Mixer would close in the middle
		of being accessed.

	Chg:	Setting VolumeMixerName=AUTO will check for the windows title of the Volume Mixer each time its trying to access
		it and not just at startup. Under some circumstances, the window title of the Volume Mixer changes
		(for example, if you connect to your cabinet with RDP, the Volume Mixer windows title changes 
		to "Volume Mixer - Remote Audio").

		Still, in reality, only a selected few should ever have this set to AUTO. Its best to use a partial match for the
		VolumeMixerName. For example, set it to "Volume Mixer -" on an English system.

	Add:	Added some sanity checks to the Settings.ini file, making sure some critical values are valid.

	Add:	Added a warning message when you edit Settings.ini from the traybar. Changing a few settings can actually cause a
		crash.

	Fix:	Fix for "No disk in drive H:" during startup.

1.9.2	2015-03-11
	Chg:	Changed the startup-delay introduced in 1.9.1. Now, if you press or move anything, the startup-delay
		is aborted and it starts working at once.

	Fix:	Initial extraction of muted.jpg and muting.jpg stopped working some time ago. Fixed.

1.9.1	2015-03-06
	Chg:	When it starts, it will automatically wait Time_To_Idle before doing anything.
		If you have autologin to your box (basically, you do not press or move anything for it to start) then
		it would start idling as soon as TAIVA is automatically loaded.
		I do not want to press any keys at startup, which would also fix it, since that will break the
		HyperSpin intro movie.

1.9	2015-02-19
	Add:	Added IdleFlashTransparency (0-255) for making the idle flash animation transparent. Looks better.
                0 = Fully transparent, 255 = Not transparent at all.

	Add:	Added IdleFlashProgressBar. Instead of the ugly muting.jpg image when the volume is fading out, you
		can now have a nice progress bar instead, showing current volume as it goes down (and up again).
		That means you now have 3 different ways of showing that the volume is fading out.
		1: IdleFlashProgressBar=True = only show current volume nicely.
		2: IdleFlashProgressBar=False + muting.jpg exists = Show muting.jpg centered when volume fades out.
		3: IdleFlashProgressBar=False + muting.jpg does not exist - Show the IdleFlashTextDuring text box.
		The IdleFlashProgressBar accepts 4 settings.
		False		= muting.jpg will be shown, if it exists. Otherwise show IdleFlashTextDuring.
		True		= Will show the volume when fading out and fading back in.
		FadeOutOnly	= Will only show the volume when fading out, not back in.
		FadeInOnly	= Will only show the volume when fading back in, not out.

	Add:	You can now right click the tray icon and select Read/Follow logfile. A program called "cmtrace.exe"
		will be extracted and executed, showing the logfile in realtime.

	Fix:	Set_Volume_at_Startup tried to set the volume at startup, even if it was already at the value you wanted.
		Did not affect anything really.

	Add:	You can now right click the icon in the traybar and selecting "Fade out now". It'll then ask you not to
		touch anything for 2 seconds and then initiate the fade out. This is good if you want to test your
		IdleSplash or just lower the volume manually if you are going to dinner or something and don't want to
		wait for the timeout =). Also available from hotkey (next entry).

	Add:	Added FadeOutNowKey to Settings.ini. It allows you to hit a keycombination that forces it to fade out
		now. The default is +!f which is Shift-Alt-F.

	Del:	Deleted IdleFlashDebug from Settings.ini. Its easier to right click the tray icon and selecting "Fade out now" or
		using the FadeOutNowKey key combination to test your IdleFlash.


1.8	2015-02-17
	Add:	Added LogLevel to Settings.ini. It has 4 levels of logging you can set.

	Del:	Debug setting in Settings.ini removed.

	Fix:	ManualVolumeAutoAdd=True crashed the program if you had no programs in ProgramSpecificVolume from before.

        Chg:    The ShowHiddenSndVolKey setting now both hides and shows the Volume Mixer, depending on its current state.
                Removed "Hide Volume Mixer" from trayicon and added a "Show/Hide Volume Mixer" instead.

        Fix:    Perhaps a fix anyway. When starting SndVol.exe, it first checks what program has focus. After SndVol.exe is
                started, it restores focus back to the previous program.

1.7	2015-02-15
	Add:	Added two options used with the shortcut keys to raise or lower volume.
     		ManualVolumeAutoSave= Sames the new volume for the program if its added as a ProgramSpecificVolume.
     		ManualVolumeAutoAdd= Automatically adds the current process to ProgramSpecificVolume.

1.6	2015-02-07
	Chg:	ProgramSpecificVolume should now work with Exceptions. If a program is added to both ProgramSpecificVolume
     		and as an exception, it will first set the volume defined for that program and then wait for it to close
     		before doing anything else.

	Add:	Added shortcut keys to raise or lower the volume. By default its Alt-Up and Alt-Down.

1.5	2015-01-08
	Add:	Added ability to set specific volumes if a program is running. This will not fade in or out for now.
		See Readme for [ProgramSpecificVolume]

1.4.1	2015-01-08
	Del:	Deleted ExitWithQuitKey option from Settings.ini. Not really needed. Just set QuitKey= or
		QuitKey=False to disable the quitkey instead.

	Chg:	Default setting Debug changed to False on creation of Settings.ini.

	Chg:	Default setting NeverCloseSndVol changed to True on creation of Settings.ini.

	Chg:	ShowHiddenSndVolKey can be set to "" or False to disable it.

	Chg:	Changed how ForceMuteOff=True disables mute on startup. It should no longer actually press keys
		to do this. It caused HyperSpin to cancel its intro if they started at the same time.

1.4	2014-12-23
	Add:	You can now right click the little icon in the traybar and select some options.
		About/Pause       - Shows a little about menu. Will also pause the program as long as its up.
		Show Volume Mixer - If you have NeverCloseSndVol=True, you can use this function to
                                    bring up the hidden volume mixer again.
		Hide Volume Mixer - Hide it again.
		Edit Settings.ini - Opens notepad.exe with the Settings.ini file.
		Reload Settings.ini - Reloads all settings from the ini file so you do not have to restart it.
		Check Latest Version - Opens a link to my FTP with all the versions.
		Exit - Quits the program.

	Chg:	Cleaned up the code a bit. 

1.3.1	2014-12-21
	Add:	Added NeverCloseSndVol to Settings.ini in [Advanced]

	Add:	Added ShowHiddenSndVolKey to Settings.ini in [Advanced]

1.3	2014-12-18
	Add:	Added the [IdleSplash] section to be able to show a moving message or image on screen
		when the volume is muted/faded.

	Add:	Added a check so that only one occurance can be running at a time.

	Add:	Added VolumeMixerName in [Advanced] where you specify the name of the Volume Mixer window.
		It did not work at all if it did not start with "Volume Mixer" before (language dependent).
		It will help set this up the first time your run this version.

	Del:	MaxDelayIfExceptionFound removed. There are no max delay anymore as it was not really needed.


1.2	2014-12-17
	Add:	[IdleException] added to config. See Readme for explanation. Makes it possible
		to skip going idle when, for example, starting a movie or something. Defined by process.

	Add:	MaxDelayIfExceptionFound added to be able to force how long it should wait for the 
		excluded process to close if its running. It will then try again. Default is 0 for 
		indefinate and you should never have to touch it really, unless it does not resume 
		as it should when all the excluded processes closes.

	Add:	Name and version of the program will now be in its tooltip when hovering over it.
		It will also show the status (waiting for idle, currently idle, waiting for excluded
		process to close etc).

1.1	2014-12-16
	Chg:	Should now be better to work with the volume as it can detect current volume and set
		absolute values to it. Only works on Windows 7 or better now though. Perhaps Vista.
		If you set it to Simply_Mute_Audio=True, it might work in XP. Not tested.

		You can now abort the volume fading out when going idle by clicking any key or moving
		the mouse. 

		Smoother fade. 1.0 moved the volume 2% at a time. This moves it 1% at a time.

		Volume can now be set to a percent of current volume, leaving you free to modify the
		volume at will manually.

		Changed settings are

	Add:	Set_Volume_at_Idle_to_Percent. Will set the volume to a percent of current volume.

	Chg:	ForceMuteOff. Only worked if Simply_Mute_Audio was True. Now also used if 
		Set_Volume_at_Startup is set to False.

	Chg:	Set_Volume_at_Idle. It is now always the value you set it to.

	Add:	QuitKey added. This lets you set your own key to exit the application.

	Del:	ExitWithShiftESC option removed because of the above.

	Add:	ExitWithQuitKey added. If you do not want to quit with the QuitKey, set this to False.

	Del:	KeyPressDelay option removed. No longer used.

	Add:	LoopDelay added.

	Chg:	FadeOut_Delay and FadeIn_Delay can now be set to "False" to instantly change volume
		without fading.

1.0	2014-12-15
	First public release.

Readme
Code:
Tur-Another Idle Volume Adjuster by Turranius

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

First hints: You do not really need to go through all the settings in this file. Start the program and accept the default settings to get
             a feel for it. If you THEN want to tinker, you can read through this document before editing Settings.ini or configuring it
             from the tray icon.

Features: * Set the volume to a percent of the current volume after an amount of time (This is the default).
          * Just mute the audio after an amount of time (Works on XP)
          * Force the volume to a certain percent at startup.
          * Force the volume to a certain percent when going idle (A definable percent instead of a percent of current volume).
          * Definable FadeOut delay and FadeIn delay.
          * Full-fledged application launcher with working dir, delay and restart options.
          * Exceptions. You specify the exe file(s) you want. If one of them is active, it will not go idle.
          * Volume per program. has the ability to change the volume to a certain percent if a process (program) is running.
          * Splashscreen when idle. Shows some fancy graphics (optionally) that works like a screensaver when idle.
          * Right click it in the traybar for a menu.
          * A few more advanced options.

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 it works for anything really.

Usage  : You only need the exe file. The first time you run it, it will create:
         * The Settings.ini file with default values.
	 * muted.jpg & muting.jpg. Default splashscreen images if you want them.
         * Tur-Another Idle Volume Adjuster.log - The logfile. The default loglevel is 1 (info).
         * If you ever right click its icon in the traybar and select "Read/Follow logfile", then
           cmtrace.exe will be extracted as well and used to load the logfile.

         If you mess something up in Settings.ini, delete and and a new one will be created on next run.

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.

Compability: Tested on Windows 10 x64, Windows 7 x64 and Windows 8.1 x64. Should work on Vista. It works on XP, but only to
             totally mute. No fading of the volume is possible. Set Simply_Mute_Audio=True if running on XP.

Limitations: Thanks to Microsofts infinite wisdom, moving or pressing on a game controller does not reset the "how long have the user
             been idle" timer, which is what this program uses. Your volume might therefor be lowered if you are playing only with a 
             game controller. This is rather individual and might not happen to you though. It depends on Windows version and patch level.

Extras:      In the Extras folder, you can run Test_Idle_Time.exe. It will display the time the system has been idle and should reset itself
             if you move or do anything. If you find that TAIVA never goes idle, run it and make sure it rises when you do not touch anything.
             If it keeps resettings, you have some device that resets the Windows idle time. Unplug devices (probably a keyboard or controller) until
             you find the culprit.

Thanks: Thanks to Dime333 and Metalzoic for being patient and testing it. My biggest supporters =)

Settings:

[General Settings]

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

LogLevel=
Set level of logging to "Tur-Another Idle Volume Adjuster.log".
0: Logging disabled.
1: Informational logging only.
2: Debug logging.
3: Debug2 logging. Will spam a lot, showing idle time etc.
Valid:0-3
Default: 1


[Sounds Options]

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

Set_Volume_at_Startup=
Set this volume (0-100) when starting the program. This ensures that the volume is always at the defined level when this
app starts and resuming from idle. Set to False to disable this function.

If set, it should be set higher then "Set_Volume_at_Idle" below, but should work anyway. In fact, if you set it
lower then Set_Volume_at_Idle, this program will work in reverse (Increase volume when idle)!

If this is set to False, your volume is not touched at startup. When recovering from idle mode, it will then go
back to the volume it had before going idle.

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

Set_Volume_at_Idle_to_Percent=
Lower the volume by this Percent when going idle. If this is set to 50 and your volume, when going idle, is 80%, your volume
will be set to 40% (50% of 80 is 40).
If you set Set_Volume_at_Startup to False (Do not enforce a volume at startup), you are free to change the volume as you want
and it will always recalculate the percentage when its time to idle.

Valid: False/1-99
Default: 20
Requirement: Set_Volume_at_Idle=False

Set_Volume_at_Idle=
Set this volume when going idle. If you set this to 20, your idle volume will always be 20%, no matter what the normal
volume was. Both this and Set_Volume_at_Idle_to_Percent can not be set at the same time. Set one of them to False.

Valid: 0-100
Default: False
Requirement: Set_Volume_at_Idle_to_Percent=False

FadeOut_Delay=
The delay when fading out. This setting defines how fast the volume is lowered in milliseconds between each
percent of "Volume down".
While 0 delay is quite fast, you can also set it to "False" to instantly change the volume.

NOTE: You CAN abort the fade out process and raise the volume back up by clicking any key or moving the mouse.
NOTE2: The default is to move the volume 1% at a time for a nice fade. However, for those that really want to
speed it up, setting it to 0-9 will move the volume 7 steps at a time. 10-19 is 5 steps. 20-29 is 3 steps.

Valid: False/0-10000
Default: 450

FadeIn_Delay=
Same as above, but how fast to raise the volume again when you are no longer idle.

NOTE: If you are using Pause (Previously HyperPause) a lot, you may want to set this to False. 
If you enter Pause while the volume is faded out, the volume will be faded out again when you exit Pause, but TAIVA does not think its idle.
This is a feature of Pause. "Check what the volume is when entering Pause, restore it to that level on exit".
NOTE2: The default is to move the volume 1% at a time for a nice fade. However, for those that really want to
speed it up, setting it to 0-9 will move the volume 7 steps at a time. 10-19 is 5 steps. 20-29 is 3 steps.

Valid: False/0-10000
Default: 20



[IdleException]

This section is only used to define processes that should pause the idle process.
You specify one Exception<#>= per line (basically the .exe file).
If it finds one of the processes defined here as running, it will pause until its gone.
You can add as many Exception<#> as you want.

Example:
Exception1=notepad.exe
Exception2=calc.exe
Exception3=somethingelse.exe

Valid: Exception<#> entries. You can either have the first exception set to NONE or delete it to disable.
Default: Empty (disabled).



[ProgramSpecificVolume]

This section defines one or more processes to check if they are running. If one of them are running it will set
the volume to that which is defined for that process. If the volume should go down from current volume, it will
be lowered instantly. If it should go up though, it will fade it with a delay of 20 (fast).
Leave it empty to disable (Do not leave crap in here as it has to check all processes each "loop" so it will
take a little more resources if you have lots of programs in here).

Example:
calc.exe=50
notepad.exe=30
That will set the volume to 50% if calc.exe is running and 30% if notepad is running.
If both programs are running at the same time, the first hit will be the dominating program it sets the volume to.
Also check the advanced setting "ProgramSpecificVolumeIfActiveOnly" below as it decides how this function works.
Valid: processes=volume_to_set. Leave it empty to disable.
Default: Empty (disabled).



[IdleSplash]

This function has two settings (well, three with IdleFlashProgressBar below). 
It either shows an image or text. Lets call the modes Image or Text mode from now on.
To enable image mode, put one or two .jpg images in the same folder as the application.
muting.jpg = Shown when the volume is fading down.
muted.jpg  = Shows when the volume is faded/muted. This one moves around.

Please note, some emulators does not allow the image to be shown. It works fine in HyperSpin and MAME for example, but
not in Daphne. It wont break anything, just not show the IdleSplash in those emulators as it will be shown behind the game.

EnableIdleFlash=
Enable the Flash/Splash system. This will enable this function.
Settings this to False disables all other values in [IdleSplash] and no indication will be given when going idle.
Valid: True/False
Default: True

IdleFlashTransparency=
Sets the transparency of the different splash windows. Range is 0-255 where 0 is fully transparent (invisible) and 255 is
not transparent at all. Set 255 to disable transparency. Setting 0 is useless. Might just as well set EnableIdleFlash=False.
Valid: 0-255
Default: 150

IdleFlashProgressBar=
With this enabled, the current volume will be shown in a progress bar when the volume fades out or in. It has multiple options.
Any setting other then "False" will override the "muting.jpg" image. That will not be shown if its not False.
False		= Disabled. Show "muting.jpg" if it exists, otherwise show IdleFlashTextDuring text box.
True		= Show the volume when fading out or in.
FadeOutOnly	= Show the volume when fading out only.
FadeInOnly	= Show the volume when fading in only.
Valid: True/False/FadeOutOnly/FadeInOnly
Default: True

IdleFlashProgressBarWidth=
This controls the width in pixels of the IdleFlashProgressBar.
Default: 665

IdleFlashProgressBarHeight=
This controls the Height in pixels of the IdleFlashProgressBar.
Default: 19

IdleFlashProgressBarLeft=
How many pixels from the left should the IdleFlashProgressBar appear? Set -1 for the center of the screen.
Default: -1

IdleFlashProgressBarTop=
How many pixels from the top should the IdleFlashProgressBar appear? Set -1 for the center of the screen.
Default: -1

IdleFlashProgressBarVertical=
Set this to True if you want a vertical volume bar instead of the default horizontal one.
Note that if changing this, you should switch the IdleFlashProgressBarWidth and IdleFlashProgressBarHeight 
values around of course.
Default: False

IdleFlashText=
The text to show when it its idle in text mode. To enable Image mode instead, put a muted.jpg file in the 
same folder as the program itself. To enable Text mode again, rename or remove muted.jpg
Valid: Any text. No quotes needed.
Default: Volume faded. Press any key to resume

IdleFlashTextWinSizeW=
IdleFlashTextWinSizeH=
The width and height of the window showing the IdleFlashText or Image. If you are using an image, it should be
the resolution of the image itself (check properties on it). In Text mode, it also controls the size
of the window.
Valid: Pixels
Default: 400, 291 (for the "muted.jpg" image that comes with the program. If you use the default text, 
         set it to 400, 42.)

IdleFlashTextDuring=
While the audio is fading out, this message is showing, in Text mode. To enable image mode instead 
put a muting.jpg image file in the same folder as the progam itself.
Will be replaced by IdleFlashText when fading is complete.
This is not used when IdleFlashProgressBar is set to anything other then False.
Valid: Any text. No quotes needed.
Default: Volume is fading. Press any key to abort

IdleFlashTextWinSizeDuringW=
IdleFlashTextWinSizeDuringH=
The width and height of the above window. In Image mode, it should match the size of muting.jpg.
Valid: Pixels
Default: 170, 170 (for the "muting.jpg" image that comes with the program. 400, 42 for the default text.

IdleFlashLoopsToMove=
The IdleFlashText (or image) can move around on screen, like a screensaver.
How many loops of the program do you want to wait before it moves?
The default looptime is 1 second (Controlled by LoopDelay in [Advanced]), so setting this to 5 means that it will wait 5
seconds before moving the window.
Valid=0-infinite. Set 0 to keep it centered at all time.
Default: 1

IdleFlashAllScreens=
When set to True, the IdleFlashText or image will move across all screens, if you have them.
When set to False, it will only move around on the primary screen.
Valid=True/False
Default: True

IdleFlashTextFontName=
The name of the font to use. Set "default" to use the system font. This is only used in Text mode.
Valid: Any (?!) installed font name. No quotes needed. When looking at your fonts, select properties on the one you want. Check the
       "Title" name. That is the name to use.
Default: default

IdleFlashTextFontSize=
The size of the font. default is 12. This is only used in Text mode.
Valid: 6 8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72
Default: default

IdleFlashTextFontWeight=
The weight of the font from 1-900. This is only used in Text mode.
Normal is 400 so under it will make the font thinner. Over 400 will make it bolder.
Valid: 0-900 where 0 is the default weight for the selected font.
Default: default



[Manual Volume]
Here are settings that concern the manual Volume Up and Down functions.

ManualVolumeUp=
This key raises the volume one step. Please note that each notch is 2%.
Valid: Any command acceptable. See QuitKey above. Same as with that one. Leave it empty to disable.
Default: !{UP} (meaning Alt-Up)

ManualVolumeDn=
This key lowers the volume one step. Please note that each notch is 2%.
Valid: Any command acceptable. See QuitKey above. Same as with that one. Leave it empty to disable.
Default: !{DOWN} (meaning Alt-Down)

ManualVolumeStep=
How many steps do you want to raise or lower the volume for each click?
Note that each step is 2% so setting this to 5 raises or lowers the volume by 10%.
Valid:1-50
Default: 1 (2%)

ManualVolumeAutoSave=
With this set to True, it will automatically save the new volume set to ProgramSpecificVolume for that process. That means that it will remember
the volume you set with ManualVolumeUp and ManualVolumeDn for the next time this process is started, but only if the program is already added
to [ProgramSpecificVolume].
Valid: True/False
Default: False

ManualVolumeAutoAdd=
When this is set to True and you use ManualVolumeUp or ManualVolumeDn and the current process is NOT in the [ProgramSpecificVolume] settings, it will
automatically be added to it. A question will pop up, asking you if you are sure and show you the process it will add.
If you do NOT say "Yes" to that question, nothing will be added. This question only pops up once, since after you say "Yes", it will be added
to the ProgramSpecificVolume settings and the normal procedure will follow (always save new volume).
If you set this to AUTO, the active process when you use ManualVolumeUp or ManualVolumeDn will always be saved. No questions asked (dangerous).
Requires: ManualVolumeAutoSave=True
Valid: True/False/AUTO
Default: False

ManualVolumeUseAPI=
Normally, when manually changing the volume up and down, we use the Windows API for that. If you'd rather use the alternate method to do that
set this to False. It will then use the internal system to raise and lower volume. When False, there is a good chance that the volume will be
displayed on screen by your sound drivers. Some people prefer to show that. Matter of taste.
Valid: True/False
Default: False

ManualVolumeShowProgressBar=
When changing the volume, a volume "progress bar" will be shown with the current volume. This is the number of seconds to show this volume bar.
Set it to False to disable it. If you want it to blink really fast, set it to 0.3 or similar although it will "slide" nicely when volume goes
up and you'll miss that if you set it to quick. 2 seconds is recommended minumum.
If you use ManualVolumeUseAPI=False above, you might want to set this one to False too so you do not get two volume bars. Try it out.
NOTE: This is the same volume bar as when fading in our and out when you have IdleFlashProgressBar=True, so you can control the look its using:
IdleFlashProgressBarWidth=
IdleFlashProgressBarHeight=
IdleFlashProgressBarLeft=
IdleFlashProgressBarTop=
IdleFlashProgressBarVertical=
Valid: False/0.1-10
Default: 2



[Advanced]
Advanced settings in here. 

ProgramSpecificVolumeIfActiveOnly=
This controls how [ProgramSpecificVolume] works. If you have no program specific settings, it has no effect.
With it set to False, if the process is running, the volume will be set with the first "hit" winning. Example:
[ProgramSpecificVolume]
notepad.exe=100
Firefox.exe=50
With this option set to false, the first program to start (notepad or firefox) will set the volume to that.
If a volume is set for a particular program, it will not set another volume until the first one is closed.

If it is set to True however, the process must be running AND be the active window. If it is not the active window
then the volume will not be set. An example could be to set HyperSpin.exe=100 in the [ProgramSpecificVolume] list and
set this option to True. It will then always set the volume to 100% as soon as HyperSpin.exe is the active window.
Valid: True/False
Default: True

IdleExceptionIfActiveOnly=
This controls how [IdleException] works in the same way as ProgramSpecificVolumeIfActiveOnly.
False = The process must be running somewhere for TAIVA to go idle and wait for it to close.
True = The process must be running and its window must be the active one for TAIVA to go idle.
Valid: True/False
Default: True

ProgramLaunchCloseOnExit=
When this is True, any application launched with [ProgramLaunch] will be closed if they are still running when
TAIVA is closed. That way, you can have TAIVA launch all other applications and just close/restart TAIVA to
restart them all. More info in [ProgramLaunch] further down.
Valid: True/False
Default: True

QuitKey=
The key to use to quit the program. The default is +{ESC} which means Shift-ESC.
You can read this page for usage: https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm or just 
configure the keys in the Advanced Configuration GUI that you can reach from the TAIVA tray icon.
To disable it, leave it empty or set it to False
Valid: False / Any Autoit3 key from URL above.
Default: +{ESC}

RestartKey=
The key to use to restart TAIVA. This might be good in some instances. Say you use TAIVA to launch all
your applications in [ProgramLaunch] and you have ProgramLaunchCloseOnExit=True, meaning it will close
all the applications when TAIVA exits, you can use this key to restart all of them at once.
You can also restart from the TAIVA tray icon.
Valid: False / Auto Autoit3 key from URL above.
Default: Empty (Disabled).

AbortIdleUsingFadeIn_Delay=
If you abort the fade out process when its lowering the volume, 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

RestoreVolumeOnExit=
If its in idle mode when you shutdown your system or exit TAIVA, do you want it to try and restore the volume first?
Instant = Instantly restore the volume.
Fade = Fades the volume back in with a forced FadeIn Delay of 20 (Quickly).
Disabled = Do not force the volume back. If you have Set_Volume_at_Startup set, its fine to leave it at Disabled since
it will be restored the next bootup anyway.
Valid: Instant/Fade/Disabled
Default: Fade

LoopDelay=
This program is basically one big loop where it checks idle time and volume. The default is 1000 ms meaning that 
it does its thing every second. If you want it to be more responsive, you can lower this value. If it eats all
your CPU (no, it wont), you can raise it.
Be careful with this option. Setting it to low will most likely cause problems. Setting it too high will cause
it to miss when you are no longer idle. Actually, dont touch it at all!
Valid: 0-infinte (Do not set 0 though).
Default: 1000 (one second).

ForceDelay=
This is the number of seconds to wait, when loaded, before doing anything basically. In some cases, you might
want to wait before TAIVA activates itself on startup.
Valid:0-infinite.
Default: 0 (Disabled)

ShowHiddenSndVolKey=
This is a keycombination to run or kill the Volume Mixer. Might be useful to have a shortcut to it IMO.
Valid: Any command acceptable. See QuitKey above. Same as with that one.
Set it empty or to False to disable the key combination.
Default: +!v (meaning Shift-Alt-V)

FadeOutNowKey=
This is the keycombination that forces TAIVA to fade out volume NOW instead of waiting for the idle timer.
It is the same function as if you right click the TAIVA icon in the traybar and selecting "Fade out now".
Valid: Any command acceptable. See QuitKey above. Same as with that one.
Set it empty or to False to disable the key combination.
Default: +!f (meaning Shift-Alt-F)

ForceFocusSetup=
This function is not added by default to the Settings.ini file. If you want to use it, you have to add it manually
in the [Advanced] section.
It allows you to hold two keys for a number of seconds to force a window/program into focus. It was created to force
HyperSpin back into focus if it got lost somehow, but can be used for any window that has a title really. Kind of like an emergency key.
It requires 4 settings, separated by |.
Key1|Key2|Seconds|WindowsTitle

In the Extras folder, read the KeyList for ForceFocusSetup.txt file to see the keyvalues to use for Key1 and Key2.
Example: ForceFocusSetup=0x12|0x24|2|HyperSpin
That means, if you hold ALT and HOME for 2 seconds, it will force focus back to a window titled "HyperSpin".

Default: Not set at all. Might cause more problems then its worth so..


[ProgramLaunch]
Here you can add applications you want launched after TAIVA has started and is ready for action.

TAIVA is actually a full-fledged application launcher and you can use it as a startup script for your whole cab.
Separate arguments with a = sign.
The syntax is: <Exe To Run>=[Working Dir]=[Seconds before starting]=[ProcessToKillOnRestart and CheckForOnStartup]
Simplest Example:
C:\HyperSpin\HyperSpin.exe=
That will simply run HyperSpin.exe from that path. Note that ONE = is required afterwards at minumum.

Specify Working dir example:
C:\HyperSpin\HyperSpin.exe=C:\
That will run C:\HyperSpin.exe with a workingdir of C:\ (bad example to use HyperSpin, but some programs require it).

Or you may use:
HyperSpin.exe=C:\HyperSpin
That will run C:\HyperSpin\HyperSpin.exe and a workingdir of C:\HyperSpin. It automatically applies the workingdir to the
path if no path is specified in the first argument.

Delayed start example:
C:\HyperSpin\HyperSpin.exe==5
That will launch C:\HyperSpin\HyperSpin.exe, with no workingdir, 5 seconds after TAIVA is started.

The programs will be launched in the order defined in Settings.ini.

Example:
HyperSpin.exe=I:\Arcade\HyperSpin
C:\Windows\System32\NotePad.exe==10

That will run HyperSpin as soon as possible, then wait 10 seconds and launch Notepad.

If you've set ProgramLaunchCloseOnExit=True, then all these programs will be closed when TAIVA is closed as well.

If you've ALSO set a restart key or restart from the tray icon, all the programs will be started again automatically
so you can restart all the applications that TAIVA launches if you restart TAIVA.

This is VERY useful and this is where the 4rth argument comes in. 
Say you launch one program with [ProgramLaunch] that actually launches something else. For example: I start
HyperSpinNotFullScreen.exe in TAIVA. That program actually launches HyperSpin.exe (in a window) and closes itself.
When its time to restart, it will look for HyperSpinNotFullScreen.exe to kill, but that is no longer running so HyperSpin
is not restarted. In this case, I can specify what it should kill as the 4rth argument.

Example:
C:\HyperSpin\HyperSpinNotFullScreen.exe===HyperSpin.exe
As you can see, it will start C:\HyperSpin\HyperSpinNotFullScreen.exe with no workingdir and no delay but when its time to
kill the process (ProgramLaunchCloseOnExit=True) it will look for, and kill, HyperSpin.exe. At startup, it will also not run
HyperSpinNotFullScreen.exe if HyperSpin.exe is already running.

Please note, if you launch HyperSpin shelled (for example), and have TAIVA in Startup, you can still launch HyperSpin
through TAIVA as well. TAIVA will not launch an application if it detects that it is running already, so what will happen is:
Bootup: HyperSpin launches shelled, TAIVA is launched as well, but will not start HyperSpin as its already started.
Restart TAIVA: HyperSpin (and any other programs in [ProgramLaunch] is killed and restarted automatically.

Hint: If you have one specific program that you do NOT want closed when TAIVA is closed, you can specify a dummy filename
as the 4rth argument. That way, it will check if the dummyfile is started, which is it not of course, and wont kill it.
It will also be started each time you restart TAIVA.

Example:
I:\Installed\putty.exe===dummyfile
That will launch I:\Installed\putty.exe every time TAIVA is restarted, even if its already started and it will NOT close it
when TAIVA is closed since, at startup, it will check if "dummyfile" is already started (its not) and at restart, it will try
and close the "dummyfile" process, which does not exist.
 

Attachments

  • Tur-Another Idle Volume Adjuster 1.4.1.zip
    1.9 MB · Views: 18
Last edited:

djvj

Administrator
Staff member
Developer
Hi turranius, nice little util. You do need a better description though. I'm curious what it does different than mine?
 

Turranius

Member
Supporter
RL Member
Updated first post with some features. I never got yours to work. It does not react to mouse movement. Dime333 on the HyperSpin forums had the same problem so I wrote this instead.
 

djvj

Administrator
Staff member
Developer
I'm pretty sure it detected mouse movement fine from what I remember testing. Did you ever try running as admin?
 

Turranius

Member
Supporter
RL Member
Yes. I can not remember all the specifics at the moment. We tested a whole lot of things.
 

Turranius

Member
Supporter
RL Member
Updated to 1.4.1

Code:
       1.4.1 - 2015-01-08   Del: Deleted ExitWithQuitKey option from Settings.ini. Not really needed. Just set QuitKey= or
                                 QuitKey=False to disable the quitkey instead.

                            Chg: Default setting Debug changed to False on creation of Settings.ini.
                            Chg: Default setting NeverCloseSndVol changed to True on creation of Settings.ini.
                            Chg: ShowHiddenSndVolKey can be set to "" or False to disable it.

                            Chg: Changed how ForceMuteOff=True disables mute on startup. It should no longer actually press keys
                                 to do this. It caused HyperSpin to cancel its intro if they started at the same time.
 

Takaji

New member
RL Member
Perhaps slightly off-topic, but is there a way to lower the volume in HLHQ? I find that the volume of some of my games is really loud when compared to what I do in Windows. I'd love to be able to lower the entire volume of the system by 50%, HyperSpin FE included!
 

brolly

Administrator
Developer
Since HLHQ doesn't run in fullscreen why don't you simply lower the volume through the volume icon on your system tray?
 

Takaji

New member
RL Member
Since HLHQ doesn't run in fullscreen why don't you simply lower the volume through the volume icon on your system tray?

I could do that, but then I'd need to set the computer volume back to its original value when I was done playing games. That becomes tedious when you're watching/listening to other media and then you launch a game and it's really loud. I assume it's not even really a HL issue to begin with though, is it - since HL only launches the emulator and doesn't make sound to begin with. I'd need to adjust the volume of each emulator I was using. Maybe I can do it through the Windows sound mixer board?
 

Turranius

Member
Supporter
RL Member
I could do that in this program. If "this program" is running, set volume to 50%. Not running anymore? set it back to previous value etc.

Bit overkill perhaps, but it should work.
 

bleasby

RocketLauncher Developer
Developer
I don't know if this will work, I have no way to test it right now, but you could try to do something like this:

Create the file "User Functions Init.ahk" on your HyperLaunch\Lib folder.

Add this code to it:
Code:
emuVolume:=0.5

Make sure you have fade enabled and the Mute Emulator on Fade (Fade - General) option enabled on HLHQ.
Let me know if it makes any difference.

emuVolume=1, should set your emulator volume to 100% of your system volume; 0.5 to 50% and so on.
 

Takaji

New member
RL Member
Turranius: Awesome, it worked! Thank you so much for adding that little feature. Type X and MAME games always seemed to be louder than my Windows volume levels, so this is a perfect addition. Suggestion: Would it be possible to make a configurable hotkey to mute all sounds to, say, 50%, then 30%, then mute completely? This would be great for when you're playing on a cabinet that has integrated speakers and you want it to be quieter. I'm building a cabinet for my local hackerspace and this would be a great addition to allow the system to still be played when other things are going on in the space. Otherwise you need to include a volume knob or something on the case...

bleasby: I tried your method and unfortunately I couldn't get it working... I also tried setting emuVolume=1, and the sound was still muted in the game. Thank you for the suggestion and your help.
 

Turranius

Member
Supporter
RL Member
So just hotkeys for setting the volume to certain values? Sure. Any suggested hotkey? Alt-+ and Alt-- (minus)?
Or totally user definable?

Edit: That will have to wait 2 weeks. My file server crashed and I'm leaving on a 2 week vacation on Wednesday.
 

Takaji

New member
RL Member
So just hotkeys for setting the volume to certain values? Sure. Any suggested hotkey? Alt-+ and Alt-- (minus)?
Or totally user definable?

Edit: That will have to wait 2 weeks. My file server crashed and I'm leaving on a 2 week vacation on Wednesday.

I think user-definable would be best, since there's so many different emulators out there that use a variety of different keys.

And no problem, I hope you enjoy your vacation! :D
 

Turranius

Member
Supporter
RL Member
Back from vacation but jetlagged as hell (11 hour time difference).

Fantastic, man. This is what I was asking for in the first thread over at the Hyperspin forums. Now if you could make it work with fade, it would be awesome.

How do you mean?
 

Dime333

Active member
RL Member
Back from vacation but jetlagged as hell (11 hour time difference).



How do you mean?

I realized that it wasn't important to me, but I saw this in the readme "This will not fade in or out right now". I use the ProgramSpecificVolume thing with "Demul.exe" so I suppose the volume won't go to idle when running that, right? As long as it works when in the hyperspin menus, I'm happy. By the way. It works great. Finally I don't have to pump up the volume like crazy when running demul.
 

Turranius

Member
Supporter
RL Member
"This will not fade in or out right now".

That just means that the volume specific .. volume is set directly, not fading in or out. =) You would like it to fade in and out of that as well? Sorry, jet lagged to hell.


I use the ProgramSpecificVolume thing with "Demul.exe" so I suppose the volume won't go to idle when running that, right?

It should still go idle with ProgramSpecificVolume defined applications. You can add "Demul.exe" to the exclusionlist as well. Have not tried that but it should work..
 
Last edited:

Dime333

Active member
RL Member
That just means that the volume specific .. volume is set directly, not fading in or out. =) You would like it to fade in and out of that as well? Sorry, jet lagged to hell.




It should still go idle with ProgramSpecificVolume defined applications. You can add "Demul.exe" to the exclusionlist as well. Have not tried that but it should work..

In that case it's perfect the way it is. I assumed that ProgramSpecificVolume apps would not go idle. Thanks for the app, It's great.
 
Top