Skip to content

Commit

Permalink
Preparing Backgroundog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 21, 2023
1 parent 7da3ffb commit 26b9127
Show file tree
Hide file tree
Showing 12 changed files with 305 additions and 205 deletions.
9 changes: 6 additions & 3 deletions src/Project/Sucrose.Backgroundog/Extension/AudioSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ private static void SetupEvents()

public static void SessionListChanged()
{
SBMI.PlayingSession = SBMI.SessionManager.CurrentSession;
SetupEvents();
SetCurrentSession();
if (SBMI.SessionManager != null)
{
SBMI.PlayingSession = SBMI.SessionManager.CurrentSession;
SetupEvents();
SetCurrentSession();
}
}

private static void SetCurrentSession()
Expand Down
11 changes: 10 additions & 1 deletion src/Project/Sucrose.Backgroundog/Helper/Attempt.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using System.Diagnostics;
using SBEL = Sucrose.Backgroundog.Extension.Lifecycle;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SMR = Sucrose.Memory.Readonly;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSSHM = Sucrose.Shared.Space.Helper.Management;

namespace Sucrose.Backgroundog.Helper
{
Expand All @@ -20,6 +24,11 @@ public static async Task Start()
await Task.Delay(TimeSpan.FromSeconds(IntervalSeconds));
}

Process.GetProcesses()
.Where(Process => (Process.ProcessName.Contains(SMR.WebViewProcessName) || Process.ProcessName.Contains(SMR.CefSharpProcessName)) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName))
.ToList()
.ForEach(Process => SBEL.Resume(Process));

SBMI.Exit = false;
SBMI.Initialize.Stop();

Expand Down
11 changes: 11 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Condition.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using Skylark.Enum;
using Skylark.Standard.Extension.Storage;
using System.Diagnostics;
using SBEL = Sucrose.Backgroundog.Extension.Lifecycle;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SBMM = Sucrose.Backgroundog.Manage.Manager;
using SMMM = Sucrose.Manager.Manage.Manager;
using SMR = Sucrose.Memory.Readonly;
using SSDECPT = Sucrose.Shared.Dependency.Enum.CategoryPerformanceType;
using SSDENPT = Sucrose.Shared.Dependency.Enum.NetworkPerformanceType;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PerformanceType;
using SSLHR = Sucrose.Shared.Live.Helper.Run;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSSHM = Sucrose.Shared.Space.Helper.Management;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;

namespace Sucrose.Backgroundog.Helper
Expand Down Expand Up @@ -70,6 +73,14 @@ private static void Lifecycle()
if (SBMI.Live != null && !SBMI.Live.HasExited)
{
SBEL.Resume(SBMI.Live);

if (SMR.WebViewLive.Contains(SBMI.Live.ProcessName) || SMR.CefSharpLive.Contains(SBMI.Live.ProcessName))
{
Process.GetProcesses()
.Where(Process => (Process.ProcessName.Contains(SMR.WebViewProcessName) || Process.ProcessName.Contains(SMR.CefSharpProcessName)) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName))
.ToList()
.ForEach(Process => SBEL.Resume(Process));
}
}

if (!string.IsNullOrEmpty(SMMM.App))
Expand Down
11 changes: 11 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Performance.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
using Skylark.Enum;
using Skylark.Standard.Extension.Storage;
using System.Diagnostics;
using SBEL = Sucrose.Backgroundog.Extension.Lifecycle;
using SBMI = Sucrose.Backgroundog.Manage.Internal;
using SBMM = Sucrose.Backgroundog.Manage.Manager;
using SMMM = Sucrose.Manager.Manage.Manager;
using SMR = Sucrose.Memory.Readonly;
using SSDECPT = Sucrose.Shared.Dependency.Enum.CategoryPerformanceType;
using SSDENPT = Sucrose.Shared.Dependency.Enum.NetworkPerformanceType;
using SSDEPT = Sucrose.Shared.Dependency.Enum.PerformanceType;
using SSLHK = Sucrose.Shared.Live.Helper.Kill;
using SSSHL = Sucrose.Shared.Space.Helper.Live;
using SSSHM = Sucrose.Shared.Space.Helper.Management;
using SSSHP = Sucrose.Shared.Space.Helper.Processor;

namespace Sucrose.Backgroundog.Helper
Expand Down Expand Up @@ -60,6 +63,14 @@ private static void Lifecycle()
if (SBMI.Live != null && !SBMI.Live.HasExited)
{
SBEL.Suspend(SBMI.Live);

if (SMR.WebViewLive.Contains(SBMI.Live.ProcessName) || SMR.CefSharpLive.Contains(SBMI.Live.ProcessName))
{
Process.GetProcesses()
.Where(Process => (Process.ProcessName.Contains(SMR.WebViewProcessName) || Process.ProcessName.Contains(SMR.CefSharpProcessName)) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName))
.ToList()
.ForEach(Process => SBEL.Suspend(Process));
}
}

if (!string.IsNullOrEmpty(SMMM.App))
Expand Down
Loading

0 comments on commit 26b9127

Please sign in to comment.