Skip to content

Commit

Permalink
Major Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Dec 1, 2024
1 parent f2132c3 commit bdac2b7
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.Aurora/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSEAVA = Sucrose.Shared.Engine.Aurora.View.Application;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -153,6 +154,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

SSEMI.Host = $"{Path.Combine(SSEMI.LibraryLocation, SSEMI.LibrarySelected)}/";
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.CefSharp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
using SSECSVW = Sucrose.Shared.Engine.CefSharp.View.Web;
using SSECSVYT = Sucrose.Shared.Engine.CefSharp.View.YouTube;
using SSEELHS = Sucrose.Shared.Engine.Extension.LocalHttpServer;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHP = Sucrose.Shared.Engine.Helper.Properties;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
Expand Down Expand Up @@ -412,6 +413,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

if (SSEMI.Info.Type is SSDEWT.Gif or SSDEWT.Video or SSDEWT.YouTube)
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -201,6 +202,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

SSEMPHC.Start();
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.Nebula/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using SMMRM = Sucrose.Memory.Manage.Readonly.Mutex;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -150,6 +151,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

SSEMI.Host = $"{Path.Combine(SSEMI.LibraryLocation, SSEMI.LibrarySelected)}/";
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.Vexana/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using SMMRM = Sucrose.Memory.Manage.Readonly.Mutex;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -150,6 +151,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

SSEMI.Host = $"{Path.Combine(SSEMI.LibraryLocation, SSEMI.LibrarySelected)}/";
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.WebView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using SSDEPT = Sucrose.Shared.Dependency.Enum.PropertiesType;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSDMMG = Sucrose.Shared.Dependency.Manage.Manager.General;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHP = Sucrose.Shared.Engine.Helper.Properties;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
Expand Down Expand Up @@ -344,6 +345,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

if (SSEMI.Info.Type is SSDEWT.Gif or SSDEWT.Video or SSDEWT.YouTube)
Expand Down
3 changes: 3 additions & 0 deletions src/Live/Sucrose.Live.Xavier/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using SMMRM = Sucrose.Memory.Manage.Readonly.Mutex;
using SRHR = Sucrose.Resources.Helper.Resources;
using SSDEWT = Sucrose.Shared.Dependency.Enum.WallpaperType;
using SSEHA = Sucrose.Shared.Engine.Helper.Awakening;
using SSEHC = Sucrose.Shared.Engine.Helper.Cycyling;
using SSEHR = Sucrose.Shared.Engine.Helper.Run;
using SSEMI = Sucrose.Shared.Engine.Manage.Internal;
Expand Down Expand Up @@ -150,6 +151,8 @@ protected void Configure()
{
SSSHS.Apply();

SSEHA.Start();

SSEHC.Start();

SSEMI.Host = $"{Path.Combine(SSEMI.LibraryLocation, SSEMI.LibrarySelected)}/";
Expand Down
41 changes: 41 additions & 0 deletions src/Shared/Engine/Sucrose.Shared.Engine/Helper/Awakening.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using ESFLAGS = Skylark.Wing.Native.Methods.ES_FLAGS;
using SMME = Sucrose.Manager.Manage.Engine;
using SSWEW = Sucrose.Shared.Watchdog.Extension.Watch;
using SWNM = Skylark.Wing.Native.Methods;
using Timer = System.Timers.Timer;

namespace Sucrose.Shared.Engine.Helper
{
internal static class Awakening
{
public static void Start()
{
int Second = 30;

Timer Awaker = new(Second * 1000);

Awaker.Elapsed += async (s, e) =>
{
try
{
if (SMME.StayAwake)
{
SWNM.SetThreadExecutionState(ESFLAGS.ES_CONTINUOUS | ESFLAGS.ES_SYSTEM_REQUIRED | ESFLAGS.ES_DISPLAY_REQUIRED);
}
else
{
SWNM.SetThreadExecutionState(ESFLAGS.ES_CONTINUOUS);
}
}
catch (Exception Exception)
{
await SSWEW.Watch_CatchException(Exception);
}
};

Awaker.AutoReset = true;

Awaker.Start();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Event\Handler.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extension\LocalHttpServer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helper\Awakening.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helper\Properties.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helper\Data.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Helper\Compatible.cs" />
Expand Down

0 comments on commit bdac2b7

Please sign in to comment.