Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 24, 2023
1 parent 228d825 commit 8937d6d
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ internal static class Management
{
public static void SetProcesses()
{
Process.GetProcesses()
.Where(Process => Process.ProcessName.Contains(SMR.CefSharpProcessName) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName) && !SSECSMI.Processes.Contains(Process.Id))
.ToList()
.ForEach(Process => SSECSMI.Processes.Add(Process.Id));
try
{
Process.GetProcesses()
.Where(Process => Process.ProcessName.Contains(SMR.CefSharpProcessName) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName) && !SSECSMI.Processes.Contains(Process.Id))
.ToList()
.ForEach(Process => SSECSMI.Processes.Add(Process.Id));
}
catch { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public static async void SetVolume(int Volume)
}
catch
{
SWEACAM.SetApplicationVolume(Process, Volume);
try
{
SWEACAM.SetApplicationVolume(Process, Volume);
}
catch { }
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions src/Shared/Engine/Sucrose.Shared.Engine.CefSharp/Helper/Web.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using CefSharp;
using SHS = Skylark.Helper.Skymath;
using SSECSHM = Sucrose.Shared.Engine.CefSharp.Helper.Management;
using SSECSMI = Sucrose.Shared.Engine.CefSharp.Manage.Internal;
using SSEHC = Sucrose.Shared.Engine.Helper.Compatible;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SWEACAM = Skylark.Wing.Extension.AudioController.AudioManager;
using SWEVPCAM = Skylark.Wing.Extension.VideoPlayerController.AudioManager;

namespace Sucrose.Shared.Engine.CefSharp.Helper
{
Expand All @@ -17,5 +20,36 @@ public static void StartCompatible()
SSEMI.CompatibleTimer.Start();
}
}

public static async void SetVolume(int Volume)
{
if (SSECSMI.Processes.Any())
{
foreach (int Process in SSECSMI.Processes.ToList())
{
try
{
SWEVPCAM.SetApplicationVolume(Process, Volume);
}
catch
{
try
{
SWEACAM.SetApplicationVolume(Process, Volume);
}
catch { }
}
}
}

if (SSECSMI.Try < 3)
{
await Task.Run(() =>
{
SSECSMI.Try++;
SSECSHM.SetProcesses();
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Windows;
using SSECSEW = Sucrose.Shared.Engine.CefSharp.Event.Web;
using SSECSHCCM = Sucrose.Shared.Engine.CefSharp.Handler.CustomContextMenu;
using SSECSHW = Sucrose.Shared.Engine.CefSharp.Helper.Web;
using SSECSMI = Sucrose.Shared.Engine.CefSharp.Manage.Internal;
using SSEEH = Sucrose.Shared.Engine.Event.Handler;
using SSEHD = Sucrose.Shared.Engine.Helper.Data;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;

Expand Down Expand Up @@ -44,6 +46,8 @@ private void GeneralTimer_Tick(object sender, EventArgs e)
Dispose();

SSEHR.Control();

SSECSHW.SetVolume(SSEHD.GetVolume());
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ internal static class Management
{
public static void SetProcesses()
{
Process.GetProcesses()
.Where(Process => Process.ProcessName.Contains(SMR.WebViewProcessName) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName) && !SSEWVMI.Processes.Contains(Process.Id))
.ToList()
.ForEach(Process => SSEWVMI.Processes.Add(Process.Id));
try
{
Process.GetProcesses()
.Where(Process => Process.ProcessName.Contains(SMR.WebViewProcessName) && SSSHM.GetCommandLine(Process).Contains(SMR.AppName) && !SSEWVMI.Processes.Contains(Process.Id))
.ToList()
.ForEach(Process => SSEWVMI.Processes.Add(Process.Id));
}
catch { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public static async void SetVolume(int Volume)
}
catch
{
SWEACAM.SetApplicationVolume(Process, Volume);
try
{
SWEACAM.SetApplicationVolume(Process, Volume);
}
catch { }
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions src/Shared/Engine/Sucrose.Shared.Engine.WebView/Helper/Web.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using SHS = Skylark.Helper.Skymath;
using SSEHC = Sucrose.Shared.Engine.Helper.Compatible;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SSEWVHM = Sucrose.Shared.Engine.WebView.Helper.Management;
using SSEWVMI = Sucrose.Shared.Engine.WebView.Manage.Internal;
using SWEACAM = Skylark.Wing.Extension.AudioController.AudioManager;
using SWEVPCAM = Skylark.Wing.Extension.VideoPlayerController.AudioManager;

namespace Sucrose.Shared.Engine.WebView.Helper
{
Expand All @@ -16,5 +19,36 @@ public static void StartCompatible()
SSEMI.CompatibleTimer.Start();
}
}

public static async void SetVolume(int Volume)
{
if (SSEWVMI.Processes.Any())
{
foreach (int Process in SSEWVMI.Processes.ToList())
{
try
{
SWEVPCAM.SetApplicationVolume(Process, Volume);
}
catch
{
try
{
SWEACAM.SetApplicationVolume(Process, Volume);
}
catch { }
}
}
}

if (SSEWVMI.Try < 3)
{
await Task.Run(() =>
{
SSEWVMI.Try++;
SSEWVHM.SetProcesses();
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Windows;
using SSEEH = Sucrose.Shared.Engine.Event.Handler;
using SSEHD = Sucrose.Shared.Engine.Helper.Data;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
using SSEWVEW = Sucrose.Shared.Engine.WebView.Event.Web;
using SSEWVHW = Sucrose.Shared.Engine.WebView.Helper.Web;
using SSEWVMI = Sucrose.Shared.Engine.WebView.Manage.Internal;

namespace Sucrose.Shared.Engine.WebView.View
Expand Down Expand Up @@ -37,6 +39,8 @@ private void GeneralTimer_Tick(object sender, EventArgs e)
Dispose();

SSEHR.Control();

SSEWVHW.SetVolume(SSEHD.GetVolume());
}

public void Dispose()
Expand Down

0 comments on commit 8937d6d

Please sign in to comment.