Skip to content

Commit

Permalink
fix ui scaling when going to watch view
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Jun 8, 2024
1 parent f479c37 commit 7a98d92
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
24 changes: 24 additions & 0 deletions Totoro.WinUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledEx

protected async override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
StartFlyleaf();
MainWindow = new MainWindow() { Title = "AppDisplayName".GetLocalized() };
base.OnLaunched(args);
RxApp.DefaultExceptionHandler = GetService<DefaultExceptionHandler>();
Expand All @@ -201,6 +202,29 @@ protected async override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventA
App_Activated(actArgs);
}

private static void StartFlyleaf()
{
FlyleafLib.Engine.Start(new FlyleafLib.EngineConfig()
{
FFmpegDevices = false, // Prevents loading avdevice/avfilter dll files. Enable it only if you plan to use dshow/gdigrab etc.

#if RELEASE
FFmpegPath = @"FFmpeg",
FFmpegLogLevel = FFmpegLogLevel.Quiet,

Check failure on line 213 in Totoro.WinUI/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build and deploy

The name 'FFmpegLogLevel' does not exist in the current context
LogLevel = LogLevel.Quiet,

Check failure on line 214 in Totoro.WinUI/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Build and deploy

'LogLevel' does not contain a definition for 'Quiet'

#else
FFmpegLogLevel = FlyleafLib.FFmpegLogLevel.Warning,
LogLevel = FlyleafLib.LogLevel.Debug,
LogOutput = ":debug",
FFmpegPath = @"E:\FFmpeg",
#endif
UIRefresh = false, // Required for Activity, BufferedDuration, Stats in combination with Config.Player.Stats = true
UIRefreshInterval = 250, // How often (in ms) to notify the UI
UICurTimePerSecond = true, // Whether to notify UI for CurTime only when it's second changed or by UIRefreshInterval
});
}

private static void ConfigureLogging()
{
var knownFolders = GetService<IKnownFolders>();
Expand Down
25 changes: 0 additions & 25 deletions Totoro.WinUI/Media/Flyleaf/FlyleafMediaPlayerElement.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,6 @@ public FlyleafMediaPlayerElement()

ProtectedCursor = InputSystemCursor.Create(InputSystemCursorShape.Arrow);

Engine.Start(new EngineConfig()
{
FFmpegDevices = false, // Prevents loading avdevice/avfilter dll files. Enable it only if you plan to use dshow/gdigrab etc.

#if RELEASE
FFmpegPath = @"FFmpeg",
FFmpegLogLevel = FFmpegLogLevel.Quiet,
LogLevel = LogLevel.Quiet,

#else
FFmpegLogLevel = FFmpegLogLevel.Warning,
LogLevel = LogLevel.Debug,
LogOutput = ":debug",
FFmpegPath = @"E:\FFmpeg",
//LogOutput = ":console",
//LogOutput = @"C:\Flyleaf\Logs\flyleaf.log",
#endif

//PluginsPath = @"C:\Flyleaf\Plugins",

UIRefresh = false, // Required for Activity, BufferedDuration, Stats in combination with Config.Player.Stats = true
UIRefreshInterval = 250, // How often (in ms) to notify the UI
UICurTimePerSecond = true, // Whether to notify UI for CurTime only when it's second changed or by UIRefreshInterval
});

_pointerMoved
.Throttle(TimeSpan.FromSeconds(3))
.ObserveOn(RxApp.MainThreadScheduler)
Expand Down

0 comments on commit 7a98d92

Please sign in to comment.