Add a special case to make steam launched games not control steam's sound, because after fixing the process matching to make it pick up the right name and icon consistently, it makes it weirder for steam to have its volume changed unexpectedly

This commit is contained in:
dlprows 2023-09-24 15:35:07 -06:00
parent 13fdfde3e5
commit 609a7bdb65

View File

@ -154,14 +154,15 @@ public class AudioHelper
//Additionally, I group all audio processes that match instead of just the most specific, or the first, etc. Because Discord uses two processes, one for voice chat, and one for discord sounds.
//
//Steam and Discord are both very common, and end up butting heads in the algorithm.
//And I'm not overly fond of programming in special cases
//so for the time being, the only down side i've found for including the parent process is that when you launch a game from steam and change the volume, you also change steam's volume. but that really only impacts videos on steam store pages
//The icon is also often steam's icon instead of the games'.
//But i'm striving for functional before perfection.
var blah = ParentProcessUtilities.GetParentProcess(pid);
if (blah != null && blah.ProcessName != "explorer" && blah.ProcessName != "svchost")
//I want to avoid special cases, but since steam and discord are both so common, i'm making an exception.
var parentProcess = ParentProcessUtilities.GetParentProcess(pid);
if (parentProcess != null
&& parentProcess.ProcessName != "explorer"
&& parentProcess.ProcessName != "svchost"
&& (parentProcess.ProcessName == "steam" && processes.Any(x => x.ProcessName == "steamwebhelper")) //only include steam if the parent process is the steamwebhelper
)
{
processes.Add(blah);
processes.Add(parentProcess);
}
}
catch