mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Make interface more flexible by passing the whole instance object to the framerate source
This commit is contained in:
@@ -258,7 +258,7 @@ namespace GHelper.AutoTDP
|
|||||||
CurrentTDP = powerLimiter.GetCPUPowerLimit();
|
CurrentTDP = powerLimiter.GetCPUPowerLimit();
|
||||||
while (currentGame is not null && Running)
|
while (currentGame is not null && Running)
|
||||||
{
|
{
|
||||||
GameFPS = framerateSouce.GetFramerate(profile.ProcessName);
|
GameFPS = framerateSouce.GetFramerate(instance);
|
||||||
|
|
||||||
|
|
||||||
Logger.WriteLine("[AutoTDPService] (" + instance.ProcessName + ") Framerate " + GameFPS);
|
Logger.WriteLine("[AutoTDPService] (" + instance.ProcessName + ") Framerate " + GameFPS);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
internal interface IFramerateSource
|
internal interface IFramerateSource
|
||||||
{
|
{
|
||||||
public double GetFramerate(string processName);
|
public double GetFramerate(GameInstance instance);
|
||||||
|
|
||||||
public List<GameInstance> GetRunningGames();
|
public List<GameInstance> GetRunningGames();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace GHelper.AutoTDP.FramerateSource
|
|||||||
return giL;
|
return giL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double GetFramerate(string processName)
|
public double GetFramerate(GameInstance instance)
|
||||||
{
|
{
|
||||||
if (!IsRunning)
|
if (!IsRunning)
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ namespace GHelper.AutoTDP.FramerateSource
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var appE = OSD.GetAppEntries()
|
var appE = OSD.GetAppEntries()
|
||||||
.Where(x => (x.Flags & AppFlags.MASK) != AppFlags.None).FirstOrDefault(a => a.Name.EndsWith(processName));
|
.Where(x => (x.Flags & AppFlags.MASK) != AppFlags.None).FirstOrDefault(a => a.ProcessId == instance.ProcessID);
|
||||||
if (appE is null)
|
if (appE is null)
|
||||||
return -1.0d;
|
return -1.0d;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user