mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:24:55 +08:00
Compare commits
32 Commits
v1.1.182.0
...
v1.1.190.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa7d56f1cb | ||
|
|
8dbe76e790 | ||
|
|
de6410492e | ||
|
|
26df7c7f67 | ||
|
|
3c411374bd | ||
|
|
99f0b9443b | ||
|
|
a3bc148816 | ||
|
|
cea757702b | ||
|
|
8938a5c798 | ||
|
|
46f4589b64 | ||
|
|
adb02658f4 | ||
|
|
3d7e6061e9 | ||
|
|
a51220c7b9 | ||
|
|
22b813e687 | ||
|
|
fda94d5020 | ||
|
|
205cbe8fb6 | ||
|
|
816f7064db | ||
|
|
132c5267b0 | ||
|
|
4e866818df | ||
|
|
9b7b56a0ee | ||
|
|
66f2da0e4c | ||
|
|
1735c6a7e6 | ||
|
|
8c06c98068 | ||
|
|
e2ac4c166c | ||
|
|
728397cafa | ||
|
|
059787a28f | ||
|
|
4c4231b48c | ||
|
|
2412927b29 | ||
|
|
f3bdbba83e | ||
|
|
4c811b12ca | ||
|
|
933103c57f | ||
|
|
718e7bdad3 |
291
.devin/wiki.json
Normal file
291
.devin/wiki.json
Normal file
@@ -0,0 +1,291 @@
|
||||
{
|
||||
"repo_notes": [
|
||||
{
|
||||
"content": "Always use the latest files in the repo to generate the wiki"
|
||||
}
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"title": "Overview",
|
||||
"purpose": "Introduce BetterLyrics, its purpose as a WinUI3 lyrics display application, key features, and supported music players",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Getting Started",
|
||||
"purpose": "Guide users through installation, initial setup, and basic usage of BetterLyrics",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Installation and Deployment",
|
||||
"purpose": "Explain how to install BetterLyrics from Microsoft Store or build from source, system requirements, and supported Windows versions",
|
||||
"parent": "Getting Started",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Initial Configuration",
|
||||
"purpose": "Walk through first-time setup including media player configuration, folder selection, and basic settings",
|
||||
"parent": "Getting Started",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Architecture",
|
||||
"purpose": "Provide technical overview of BetterLyrics' internal architecture, design patterns, and component organization",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Application Entry Point and Dependency Injection",
|
||||
"purpose": "Document the App.xaml.cs entry point, service registration, and dependency injection container configuration",
|
||||
"parent": "Architecture",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Service Layer Architecture",
|
||||
"purpose": "Explain the service-oriented architecture, service interfaces, and their implementations including MediaSessionsService, LyricsSearchService, and SettingsService",
|
||||
"parent": "Architecture",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Data Models",
|
||||
"purpose": "Document core data models including LyricsLine, LyricsData, SongInfo, and configuration models",
|
||||
"parent": "Architecture",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Multi-Window System",
|
||||
"purpose": "Explain how BetterLyrics manages multiple simultaneous lyrics windows, window lifecycle, and state management",
|
||||
"parent": "Architecture",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "User Interface",
|
||||
"purpose": "Document the UI components, windows, and user interaction patterns in BetterLyrics",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Now Playing Window",
|
||||
"purpose": "Detail the main lyrics display window, its components, and integration with the rendering system",
|
||||
"parent": "User Interface",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Display Modes and Window Configurations",
|
||||
"purpose": "Explain different display modes (Standard, Desktop, Docked, Fullscreen, Narrow, Taskbar) and how to configure them",
|
||||
"parent": "User Interface",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Settings and Customization",
|
||||
"purpose": "Document the settings interface, configuration options, and how to customize lyrics appearance and behavior",
|
||||
"parent": "User Interface",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Music Gallery",
|
||||
"purpose": "Explain the local music library management feature, including playback, playlist management, and integration with media controls",
|
||||
"parent": "User Interface",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "System Tray and Global Controls",
|
||||
"purpose": "Document the system tray integration, global hotkeys, and application-wide controls",
|
||||
"parent": "User Interface",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Lyrics System",
|
||||
"purpose": "Comprehensive documentation of the lyrics acquisition, processing, and display pipeline",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Lyrics Search and Providers",
|
||||
"purpose": "Document the lyrics search system, supported providers (QQ Music, Netease, Kugou, LrcLib, Apple Music, local files), and search strategies",
|
||||
"parent": "Lyrics System",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Parsing and Translation",
|
||||
"purpose": "Explain how lyrics are parsed from different formats (LRC, QRC, TTML), translation system using LibreTranslate, and metadata matching",
|
||||
"parent": "Lyrics System",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Rendering Pipeline",
|
||||
"purpose": "Document the Win2D-based rendering system, LyricsCanvas, PlayingLineRenderer, UnplayingLineRenderer, and LyricsLayoutManager",
|
||||
"parent": "Lyrics System",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Visual Effects and Animation",
|
||||
"purpose": "Explain character-level effects (glow, float, scale), background effects (fluid, snow, fog, spectrum), and the animation transition system",
|
||||
"parent": "Lyrics System",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Media Integration",
|
||||
"purpose": "Document how BetterLyrics integrates with music players and manages media sessions",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Windows Media Transport Controls Integration",
|
||||
"purpose": "Explain how BetterLyrics uses Windows SMTC to work universally with media players",
|
||||
"parent": "Media Integration",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Supported Players and Special Configurations",
|
||||
"purpose": "List supported media players, document special configurations (Apple Music token, LX Music SSE), and player-specific handling",
|
||||
"parent": "Media Integration",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Album Art and Theme Colors",
|
||||
"purpose": "Document album art retrieval from multiple sources, color palette generation (MedianCut, OctTree), and adaptive theming",
|
||||
"parent": "Media Integration",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Internationalization",
|
||||
"purpose": "Explain the localization system, supported languages, and how resources are managed",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Development",
|
||||
"purpose": "Technical documentation for developers contributing to or extending BetterLyrics",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Build Configuration and Deployment",
|
||||
"purpose": "Document the build process, publish profiles for different architectures, CI/CD pipeline, and packaging for Microsoft Store",
|
||||
"parent": "Development",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Helper Utilities and Extensions",
|
||||
"purpose": "Document utility classes including TaskbarHook, WindowHook, ColorHelper, ImageHelper, and various extension methods",
|
||||
"parent": "Development",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "External Dependencies and Libraries",
|
||||
"purpose": "List and explain third-party dependencies including Win2D, NAudio, ATL.NET, FlaUI, and their usage in the application",
|
||||
"parent": "Development",
|
||||
"page_notes": [
|
||||
{
|
||||
"content": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
<Identity
|
||||
Name="37412.BetterLyrics"
|
||||
Publisher="CN=E1428B0E-DC1D-4EA4-ACB1-4556569D5BA9"
|
||||
Version="1.1.182.0" />
|
||||
Version="1.1.190.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
|
||||
@@ -83,8 +83,6 @@
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7175" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.251106002" />
|
||||
<PackageReference Include="NAudio.Wasapi" Version="2.2.1" />
|
||||
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||
<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.1.2" />
|
||||
<PackageReference Include="NTextCat" Version="0.3.65" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="10.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.MusicGallerySettings.AutoPlay, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageStopTrackOnGalleryWindowClosed" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.MusicGallerySettings.StopOnWindowClosed, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageExitOnGalleryWindowClosed" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.MusicGallerySettings.ExitOnWindowClosed, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
// FontFamilies = fontFamilies;
|
||||
// });
|
||||
//});
|
||||
FontFamilies = FontHelper.SystemFontFamilies.OrderBy(x => x).ToList();
|
||||
FontFamilies = FontHelper.GetSystemFontFamilies();
|
||||
}
|
||||
|
||||
private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
|
||||
|
||||
@@ -47,6 +47,51 @@
|
||||
</dev:SettingsExpander.Items>
|
||||
</dev:SettingsExpander>
|
||||
|
||||
<dev:SettingsExpander
|
||||
x:Uid="SettingsPageAlbumArtLayer"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||
Glyph=}"
|
||||
IsExpanded="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=TwoWay}" />
|
||||
<dev:SettingsExpander.Items>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||
<uc:ExtendedSlider
|
||||
Default="100"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Unit="%"
|
||||
Value="{x:Bind LyricsBackgroundSettings.CoverOverlayOpacity, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageSpeed" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||
<uc:ExtendedSlider
|
||||
Default="50"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Unit="%"
|
||||
Value="{x:Bind LyricsBackgroundSettings.CoverOverlaySpeed, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageBlurAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||
<uc:ExtendedSlider
|
||||
Default="100"
|
||||
Maximum="200"
|
||||
Minimum="0"
|
||||
Value="{x:Bind LyricsBackgroundSettings.CoverOverlayBlurAmount, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<!--<dev:SettingsCard x:Uid="SettingsPageBackgroundAcrylicEffectAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||
<uc:ExtendedSlider
|
||||
Default="0"
|
||||
Maximum="10"
|
||||
Minimum="0"
|
||||
Value="{x:Bind LyricsBackgroundSettings.CoverAcrylicEffectAmount, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>-->
|
||||
|
||||
</dev:SettingsExpander.Items>
|
||||
</dev:SettingsExpander>
|
||||
|
||||
<dev:SettingsExpander
|
||||
x:Uid="SettingsPageFluidLayer"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||
|
||||
@@ -13,15 +13,21 @@ using BetterLyrics.WinUI3.Services.SettingsService;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using Lyricify.Lyrics.Providers.Web.Netease;
|
||||
using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Foundation;
|
||||
using Windows.Storage.Streams;
|
||||
using Windows.UI;
|
||||
using static Vanara.PInvoke.Ole32;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Controls
|
||||
{
|
||||
@@ -34,7 +40,8 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
IRecipient<PropertyChangedMessage<bool>>,
|
||||
IRecipient<PropertyChangedMessage<TextAlignmentType>>,
|
||||
IRecipient<PropertyChangedMessage<LyricsFontWeight>>,
|
||||
IRecipient<PropertyChangedMessage<string>>
|
||||
IRecipient<PropertyChangedMessage<string>>,
|
||||
IRecipient<PropertyChangedMessage<IRandomAccessStream?>>
|
||||
{
|
||||
private readonly ISettingsService _settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
|
||||
private readonly IMediaSessionsService _mediaSessionsService = Ioc.Default.GetRequiredService<IMediaSessionsService>();
|
||||
@@ -42,6 +49,7 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
|
||||
private readonly LyricsRenderer _lyricsRenderer = new();
|
||||
private readonly FluidBackgroundRenderer _fluidRenderer = new();
|
||||
private readonly CoverBackgroundRenderer _coverRenderer = new();
|
||||
private readonly PureColorBackgroundRenderer _pureColorRenderer = new();
|
||||
private readonly SnowRenderer _snowRenderer = new();
|
||||
private readonly FogRenderer _fogRenderer = new();
|
||||
@@ -368,8 +376,8 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
lyricsBg.IsPureColorOverlayEnabled
|
||||
);
|
||||
|
||||
_fluidRenderer.Opacity = lyricsBg.FluidOverlayOpacity / 100.0;
|
||||
_fluidRenderer.IsEnabled = lyricsBg.IsFluidOverlayEnabled;
|
||||
_coverRenderer.Draw(sender, args.DrawingSession);
|
||||
|
||||
_fluidRenderer.Draw(sender, args.DrawingSession);
|
||||
|
||||
_snowRenderer.Draw(sender, args.DrawingSession);
|
||||
@@ -549,16 +557,21 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
|
||||
_isLayoutChanged = false;
|
||||
|
||||
if (_fluidRenderer.IsEnabled)
|
||||
{
|
||||
_fluidRenderer.UpdateColors(
|
||||
_accentColor1Transition.Value,
|
||||
_accentColor2Transition.Value,
|
||||
_accentColor3Transition.Value,
|
||||
_accentColor4Transition.Value
|
||||
);
|
||||
_fluidRenderer.Update(elapsedTime);
|
||||
}
|
||||
_fluidRenderer.IsEnabled = lyricsBg.IsFluidOverlayEnabled;
|
||||
_fluidRenderer.Opacity = lyricsBg.FluidOverlayOpacity / 100.0;
|
||||
_fluidRenderer.UpdateColors(
|
||||
_accentColor1Transition.Value,
|
||||
_accentColor2Transition.Value,
|
||||
_accentColor3Transition.Value,
|
||||
_accentColor4Transition.Value
|
||||
);
|
||||
_fluidRenderer.Update(elapsedTime);
|
||||
|
||||
_coverRenderer.IsEnabled = lyricsBg.IsCoverOverlayEnabled;
|
||||
_coverRenderer.Opacity = lyricsBg.CoverOverlayOpacity;
|
||||
_coverRenderer.BlurAmount = lyricsBg.CoverOverlayBlurAmount;
|
||||
_coverRenderer.Speed = lyricsBg.CoverOverlaySpeed;
|
||||
_coverRenderer.Update(elapsedTime);
|
||||
|
||||
_snowRenderer.IsEnabled = lyricsBg.IsSnowFlakeOverlayEnabled;
|
||||
_snowRenderer.Amount = lyricsBg.SnowFlakeOverlayAmount / 100f;
|
||||
@@ -586,6 +599,7 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
private void Canvas_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_fluidRenderer.Dispose();
|
||||
_coverRenderer.Dispose();
|
||||
_snowRenderer.Dispose();
|
||||
_fogRenderer.Dispose();
|
||||
_spectrumRenderer.Dispose();
|
||||
@@ -600,7 +614,13 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
|
||||
private async void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
|
||||
{
|
||||
args.TrackAsyncAction(_fluidRenderer.LoadResourcesAsync().AsAsyncAction());
|
||||
var tasks = new Task[]
|
||||
{
|
||||
_fluidRenderer.LoadResourcesAsync(),
|
||||
ReloadCoverBackgroundResourcesAsync()
|
||||
};
|
||||
args.TrackAsyncAction(Task.WhenAll(tasks).AsAsyncAction());
|
||||
|
||||
_snowRenderer.LoadResources();
|
||||
_fogRenderer.LoadResources();
|
||||
|
||||
@@ -682,6 +702,16 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
private async Task ReloadCoverBackgroundResourcesAsync()
|
||||
{
|
||||
if (_mediaSessionsService.AlbumArtBitmapStream is IRandomAccessStream stream)
|
||||
{
|
||||
stream.Seek(0);
|
||||
CanvasBitmap bitmap = await CanvasBitmap.LoadAsync(Canvas, stream);
|
||||
_coverRenderer.SetCoverBitmap(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(PropertyChangedMessage<TimeSpan> message)
|
||||
{
|
||||
if (message.Sender is IMediaSessionsService)
|
||||
@@ -874,5 +904,15 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(PropertyChangedMessage<IRandomAccessStream?> message)
|
||||
{
|
||||
if (message.Sender is IMediaSessionsService)
|
||||
{
|
||||
if (message.PropertyName == nameof(IMediaSessionsService.AlbumArtBitmapStream))
|
||||
{
|
||||
_ = ReloadCoverBackgroundResourcesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<dev:SettingsCard x:Uid="SettingsPageLyricsCenterTopOffset" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||
<local:ExtendedSlider
|
||||
Default="50"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Maximum="99"
|
||||
Minimum="1"
|
||||
Unit="%"
|
||||
Value="{x:Bind LyricsStyleSettings.PlayingLineTopOffset, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||
Loaded="UserControl_Loaded"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
|
||||
@@ -10,6 +10,7 @@ using CommunityToolkit.WinUI.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -26,14 +27,14 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
|
||||
private readonly ISettingsService _settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
|
||||
|
||||
public LyricsWindowStatus LyricsWindowStatus
|
||||
public LyricsWindowStatus? LyricsWindowStatus
|
||||
{
|
||||
get { return (LyricsWindowStatus)GetValue(LyricsWindowStatusProperty); }
|
||||
get { return (LyricsWindowStatus?)GetValue(LyricsWindowStatusProperty); }
|
||||
set { SetValue(LyricsWindowStatusProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LyricsWindowStatusProperty =
|
||||
DependencyProperty.Register(nameof(LyricsWindowStatus), typeof(LyricsWindowStatus), typeof(LyricsWindowSettingsControl), new PropertyMetadata(default));
|
||||
DependencyProperty.Register(nameof(LyricsWindowStatus), typeof(LyricsWindowStatus), typeof(LyricsWindowSettingsControl), new PropertyMetadata(null));
|
||||
|
||||
public LyricsWindowSettingsControl()
|
||||
{
|
||||
@@ -186,17 +187,6 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigSelectorBar_SelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs args)
|
||||
{
|
||||
if (sender is SelectorBar bar)
|
||||
{
|
||||
if (bar.SelectedItem is SelectorBarItem item)
|
||||
{
|
||||
ViewModel?.SelectorBarSelectedItemTag = item.Tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseStatusButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is FrameworkElement element)
|
||||
@@ -213,5 +203,10 @@ namespace BetterLyrics.WinUI3.Controls
|
||||
{
|
||||
ViewModel.SelectorBarSelectedItemTag = (string)((SegmentedItem)((Segmented)sender).SelectedItem).Tag;
|
||||
}
|
||||
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.CloseConfigPanelCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<Grid
|
||||
x:Name="BottomCommandGrid"
|
||||
Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}"
|
||||
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}"
|
||||
Opacity="{x:Bind ViewModel.BottomCommandGridOpacity, Mode=OneWay}"
|
||||
PointerEntered="BottomCommandGrid_PointerEntered"
|
||||
PointerExited="BottomCommandGrid_PointerExited">
|
||||
|
||||
@@ -102,6 +102,10 @@
|
||||
</dev:SettingsExpander.Items>
|
||||
</dev:SettingsExpander>
|
||||
|
||||
<dev:SettingsCard x:Uid="SettingsPageAlwaysHideUnlockButton" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||
<ToggleSwitch IsOn="{x:Bind LyricsWindowStatus.IsAlwaysHideUnlockButton, Mode=TwoWay}" />
|
||||
</dev:SettingsCard>
|
||||
|
||||
<dev:SettingsExpander
|
||||
x:Uid="SettingsPageAOT"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Microsoft.Graphics.Canvas.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Media;
|
||||
|
||||
@@ -8,8 +10,6 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
public static class FontHelper
|
||||
{
|
||||
public static string[] SystemFontFamilies => CanvasTextFormat.GetSystemFontFamilies().Order().ToArray();
|
||||
|
||||
public static string GetLocalizedFontFamilyName(string sourceName, string langCode)
|
||||
{
|
||||
if (langCode == "")
|
||||
@@ -33,5 +33,20 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
public static List<string> GetSystemFontFamilies()
|
||||
{
|
||||
List<string> fontFamilies = new();
|
||||
|
||||
foreach (var font in Fonts.SystemFontFamilies)
|
||||
{
|
||||
if (font.FamilyNames.TryGetValue(XmlLanguage.GetLanguage("en-us"), out string englishFamilyName))
|
||||
{
|
||||
fontFamilies.Add(englishFamilyName);
|
||||
}
|
||||
}
|
||||
|
||||
return fontFamilies.Order().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,23 +282,27 @@ namespace BetterLyrics.WinUI3.Hooks
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetIsFullscreen(this Window window, bool enable)
|
||||
public static bool SetIsFullscreen(this Window window, bool enable, bool defaultExtendsContentIntoTitleBar = true)
|
||||
{
|
||||
if (window.AppWindow == null) return;
|
||||
if (window.AppWindow == null) return false;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
window.ExtendsContentIntoTitleBar = false;
|
||||
window.AppWindow.SetPresenter(AppWindowPresenterKind.FullScreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
window.ExtendsContentIntoTitleBar = defaultExtendsContentIntoTitleBar;
|
||||
window.AppWindow.SetPresenter(AppWindowPresenterKind.Overlapped);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void SetIsMaximized(this Window window, bool enable)
|
||||
public static bool SetIsMaximized(this Window window, bool enable)
|
||||
{
|
||||
if (window.AppWindow == null) return;
|
||||
if (window.AppWindow == null) return false;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
@@ -308,6 +312,8 @@ namespace BetterLyrics.WinUI3.Hooks
|
||||
{
|
||||
window.Restore();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void SetIsShowInSwitchers(this Window window, bool enable)
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace BetterLyrics.WinUI3.Models
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsAlwaysOnTopPolling { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsShownInSwitchers { get; set; } = true;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsLocked { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsAlwaysHideUnlockButton { get; set; } = false;
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsPinToTaskbar { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial TaskbarPlacement TaskbarPlacement { get; set; } = TaskbarPlacement.Right;
|
||||
@@ -52,15 +53,74 @@ namespace BetterLyrics.WinUI3.Models
|
||||
|
||||
public LyricsWindowStatus()
|
||||
{
|
||||
|
||||
LyricsStyleSettings.PropertyChanged += LyricsStyleSettings_PropertyChanged;
|
||||
LyricsEffectSettings.PropertyChanged += LyricsEffectSettings_PropertyChanged;
|
||||
LyricsBackgroundSettings.PropertyChanged += LyricsBackgroundSettings_PropertyChanged;
|
||||
AlbumArtLayoutSettings.PropertyChanged += AlbumArtLayoutSettings_PropertyChanged;
|
||||
AlbumArtAreaEffectSettings.PropertyChanged += AlbumArtAreaEffectSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
public LyricsWindowStatus(Window? targetWindow = null)
|
||||
public LyricsWindowStatus(Window? targetWindow = null) : this()
|
||||
{
|
||||
UpdateMonitorNameAndBounds(targetWindow);
|
||||
UpdateDemoWindowAndMonitorBounds();
|
||||
}
|
||||
|
||||
partial void OnLyricsStyleSettingsChanged(LyricsStyleSettings oldValue, LyricsStyleSettings newValue)
|
||||
{
|
||||
oldValue.PropertyChanged -= LyricsStyleSettings_PropertyChanged;
|
||||
newValue.PropertyChanged += LyricsStyleSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
private void LyricsStyleSettings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(LyricsStyleSettings));
|
||||
}
|
||||
|
||||
partial void OnLyricsEffectSettingsChanged(LyricsEffectSettings oldValue, LyricsEffectSettings newValue)
|
||||
{
|
||||
oldValue.PropertyChanged -= LyricsEffectSettings_PropertyChanged;
|
||||
newValue.PropertyChanged += LyricsEffectSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
private void LyricsEffectSettings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(LyricsEffectSettings));
|
||||
}
|
||||
|
||||
partial void OnLyricsBackgroundSettingsChanged(LyricsBackgroundSettings oldValue, LyricsBackgroundSettings newValue)
|
||||
{
|
||||
oldValue.PropertyChanged -= LyricsBackgroundSettings_PropertyChanged;
|
||||
newValue.PropertyChanged += LyricsBackgroundSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
private void LyricsBackgroundSettings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(LyricsBackgroundSettings));
|
||||
}
|
||||
|
||||
partial void OnAlbumArtLayoutSettingsChanged(AlbumArtAreaStyleSettings oldValue, AlbumArtAreaStyleSettings newValue)
|
||||
{
|
||||
oldValue.PropertyChanged -= AlbumArtLayoutSettings_PropertyChanged;
|
||||
newValue.PropertyChanged += AlbumArtLayoutSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
private void AlbumArtLayoutSettings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(AlbumArtLayoutSettings));
|
||||
}
|
||||
|
||||
partial void OnAlbumArtAreaEffectSettingsChanged(AlbumArtAreaEffectSettings oldValue, AlbumArtAreaEffectSettings newValue)
|
||||
{
|
||||
oldValue.PropertyChanged -= AlbumArtAreaEffectSettings_PropertyChanged;
|
||||
newValue.PropertyChanged += AlbumArtAreaEffectSettings_PropertyChanged;
|
||||
}
|
||||
|
||||
private void AlbumArtAreaEffectSettings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(AlbumArtAreaEffectSettings));
|
||||
}
|
||||
|
||||
partial void OnWindowBoundsChanged(Rect value)
|
||||
{
|
||||
UpdateMonitorNameAndBounds();
|
||||
@@ -141,6 +201,7 @@ namespace BetterLyrics.WinUI3.Models
|
||||
IsAlwaysOnTopPolling = this.IsAlwaysOnTopPolling,
|
||||
IsShownInSwitchers = this.IsShownInSwitchers,
|
||||
IsLocked = this.IsLocked,
|
||||
IsAlwaysHideUnlockButton = this.IsAlwaysHideUnlockButton,
|
||||
|
||||
IsPinToTaskbar = this.IsPinToTaskbar,
|
||||
TaskbarPlacement = this.TaskbarPlacement,
|
||||
|
||||
@@ -12,6 +12,11 @@ namespace BetterLyrics.WinUI3.Models.Settings
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsPureColorOverlayEnabled { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int PureColorOverlayOpacity { get; set; } = 100; // 100 % = 1.0
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsCoverOverlayEnabled { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int CoverOverlayOpacity { get; set; } = 100; // 100 % = 1.0
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int CoverOverlaySpeed { get; set; } = 50;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int CoverOverlayBlurAmount { get; set; } = 100;
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool IsFluidOverlayEnabled { get; set; } = true;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int FluidOverlayOpacity { get; set; } = 100;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial PaletteGeneratorType PaletteGeneratorType { get; set; } = PaletteGeneratorType.MedianCut;
|
||||
@@ -39,14 +44,25 @@ namespace BetterLyrics.WinUI3.Models.Settings
|
||||
IsPureColorOverlayEnabled = this.IsPureColorOverlayEnabled,
|
||||
PureColorOverlayOpacity = this.PureColorOverlayOpacity,
|
||||
|
||||
IsCoverOverlayEnabled = this.IsCoverOverlayEnabled,
|
||||
CoverOverlayOpacity = this.CoverOverlayOpacity,
|
||||
CoverOverlaySpeed = this.CoverOverlaySpeed,
|
||||
CoverOverlayBlurAmount = this.CoverOverlayBlurAmount,
|
||||
|
||||
IsFluidOverlayEnabled = this.IsFluidOverlayEnabled,
|
||||
FluidOverlayOpacity = this.FluidOverlayOpacity,
|
||||
PaletteGeneratorType = this.PaletteGeneratorType,
|
||||
|
||||
IsSpectrumOverlayEnabled = this.IsSpectrumOverlayEnabled,
|
||||
SpectrumPlacement = this.SpectrumPlacement,
|
||||
SpectrumStyle = this.SpectrumStyle,
|
||||
SpectrumCount = this.SpectrumCount,
|
||||
|
||||
IsSnowFlakeOverlayEnabled = this.IsSnowFlakeOverlayEnabled,
|
||||
SnowFlakeOverlayAmount = this.SnowFlakeOverlayAmount,
|
||||
SnowFlakeOverlaySpeed = this.SnowFlakeOverlaySpeed,
|
||||
|
||||
IsFogOverlayEnabled = this.IsFogOverlayEnabled,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace BetterLyrics.WinUI3.Models.Settings
|
||||
LyricsGlowEffectLongSyllableDuration = this.LyricsGlowEffectLongSyllableDuration,
|
||||
IsLyricsGlowEffectAmountAutoAdjust = this.IsLyricsGlowEffectAmountAutoAdjust,
|
||||
LyricsGlowEffectAmount = this.LyricsGlowEffectAmount,
|
||||
LyricsGlowEffectScope = this.LyricsGlowEffectScope,
|
||||
|
||||
IsLyricsScaleEffectEnabled = this.IsLyricsScaleEffectEnabled,
|
||||
LyricsScaleEffectLongSyllableDuration = this.LyricsScaleEffectLongSyllableDuration,
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace BetterLyrics.WinUI3.Models.Settings
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial double LyricsLineSpacingFactor { get; set; } = 0.5;
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial string LyricsCJKFontFamily { get; set; } = FontHelper.SystemFontFamilies.FirstOrDefault() ?? "";
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial string LyricsWesternFontFamily { get; set; } = FontHelper.SystemFontFamilies.FirstOrDefault() ?? "";
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial string LyricsCJKFontFamily { get; set; } = "Arial";
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial string LyricsWesternFontFamily { get; set; } = "Arial";
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial int PlayingLineTopOffset { get; set; } = 50; // 50 %
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace BetterLyrics.WinUI3.Models.Settings
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool AutoPlay { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial LyricsWindowStatus LyricsWindowStatus { get; set; } = new();
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool ExitOnWindowClosed { get; set; } = false;
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial bool StopOnWindowClosed { get; set; } = false;
|
||||
|
||||
public MusicGallerySettings() { }
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Graphics.Canvas.Effects;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using Windows.Foundation;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Renderer
|
||||
{
|
||||
@@ -13,17 +14,47 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
private CanvasBitmap? _currentBitmap;
|
||||
private CanvasBitmap? _previousBitmap;
|
||||
|
||||
private readonly ValueTransition<double> _crossfadeTransition;
|
||||
private CanvasRenderTarget? _currentTargetCache;
|
||||
private CanvasRenderTarget? _previousTargetCache;
|
||||
|
||||
private Size _lastScreenSize;
|
||||
private bool _lastWasRotating = false;
|
||||
|
||||
private readonly ValueTransition<double> _crossfadeTransition;
|
||||
private float _rotationAngle = 0f;
|
||||
|
||||
public bool IsEnabled { get; set; } = false;
|
||||
|
||||
public int Opacity { get; set; } = 100;
|
||||
|
||||
public int BlurAmount { get; set; } = 100;
|
||||
private bool _needsCacheUpdate = false;
|
||||
|
||||
public int Speed { get; set; } = 100;
|
||||
private int _blurAmount = 100;
|
||||
public int BlurAmount
|
||||
{
|
||||
get => _blurAmount;
|
||||
set
|
||||
{
|
||||
if (_blurAmount != value)
|
||||
{
|
||||
_blurAmount = value;
|
||||
_needsCacheUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int _speed = 100;
|
||||
public int Speed
|
||||
{
|
||||
get => _speed;
|
||||
set
|
||||
{
|
||||
if (_speed != value)
|
||||
{
|
||||
_speed = value;
|
||||
_needsCacheUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CoverBackgroundRenderer()
|
||||
{
|
||||
@@ -34,26 +65,30 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
{
|
||||
if (_currentBitmap == newBitmap) return;
|
||||
|
||||
if (_currentBitmap == null)
|
||||
{
|
||||
_currentBitmap = newBitmap;
|
||||
_crossfadeTransition.StartTransition(1.0, jumpTo: true);
|
||||
return;
|
||||
}
|
||||
|
||||
_previousBitmap = _currentBitmap;
|
||||
_previousTargetCache = _currentTargetCache;
|
||||
_currentTargetCache = null;
|
||||
|
||||
_currentBitmap = newBitmap;
|
||||
|
||||
if (newBitmap != null)
|
||||
if (_currentBitmap == null)
|
||||
{
|
||||
_crossfadeTransition.Reset(0.0);
|
||||
_crossfadeTransition.StartTransition(1.0);
|
||||
_crossfadeTransition.StartTransition(1.0, jumpTo: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_previousBitmap = null;
|
||||
_crossfadeTransition.StartTransition(1.0, jumpTo: true);
|
||||
if (_previousBitmap == null)
|
||||
{
|
||||
_crossfadeTransition.StartTransition(1.0, jumpTo: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_crossfadeTransition.Reset(0.0);
|
||||
_crossfadeTransition.StartTransition(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
_needsCacheUpdate = true;
|
||||
}
|
||||
|
||||
public void Update(TimeSpan deltaTime)
|
||||
@@ -64,17 +99,17 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
|
||||
if (Speed > 0)
|
||||
{
|
||||
float baseSpeed = 0.6f; // 弧度/秒
|
||||
float baseSpeed = 0.6f;
|
||||
float currentSpeed = (Speed / 100.0f) * baseSpeed;
|
||||
|
||||
_rotationAngle += currentSpeed * (float)deltaTime.TotalSeconds;
|
||||
|
||||
_rotationAngle %= (float)(2 * Math.PI);
|
||||
}
|
||||
|
||||
if (_crossfadeTransition.Value >= 1.0 && _previousBitmap != null)
|
||||
{
|
||||
_previousBitmap = null;
|
||||
_previousTargetCache?.Dispose();
|
||||
_previousTargetCache = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,84 +117,133 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
{
|
||||
if (!IsEnabled || Opacity <= 0) return;
|
||||
|
||||
if (_lastScreenSize != control.Size)
|
||||
{
|
||||
_lastScreenSize = control.Size;
|
||||
_needsCacheUpdate = true;
|
||||
}
|
||||
|
||||
bool isRotating = Speed > 0;
|
||||
if (_lastWasRotating != isRotating)
|
||||
{
|
||||
_lastWasRotating = isRotating;
|
||||
_needsCacheUpdate = true;
|
||||
}
|
||||
|
||||
EnsureCachedLayer(control, _currentBitmap, ref _currentTargetCache);
|
||||
|
||||
float baseAlpha = Opacity / 100.0f;
|
||||
float currentBlur = BlurAmount;
|
||||
|
||||
float angle = Speed > 0 ? _rotationAngle : 0f;
|
||||
|
||||
float angle = isRotating ? _rotationAngle : 0f;
|
||||
double fadeProgress = _crossfadeTransition.Value;
|
||||
bool isCrossfading = fadeProgress < 1.0 && _previousBitmap != null;
|
||||
bool isCrossfading = fadeProgress < 1.0 && _previousTargetCache != null;
|
||||
|
||||
Vector2 screenCenter = new Vector2((float)control.Size.Width / 2f, (float)control.Size.Height / 2f);
|
||||
|
||||
if (isCrossfading)
|
||||
{
|
||||
DrawLayer(ds, control.Size, _previousBitmap, angle, currentBlur, baseAlpha);
|
||||
DrawCachedLayer(ds, _previousTargetCache, screenCenter, angle, baseAlpha);
|
||||
|
||||
float newLayerAlpha = baseAlpha * (float)fadeProgress;
|
||||
if (newLayerAlpha > 0.005f)
|
||||
{
|
||||
DrawLayer(ds, control.Size, _currentBitmap, angle, currentBlur, newLayerAlpha);
|
||||
}
|
||||
DrawCachedLayer(ds, _currentTargetCache, screenCenter, angle, newLayerAlpha);
|
||||
}
|
||||
else if (_currentBitmap != null)
|
||||
else if (_currentTargetCache != null)
|
||||
{
|
||||
DrawLayer(ds, control.Size, _currentBitmap, angle, currentBlur, baseAlpha);
|
||||
DrawCachedLayer(ds, _currentTargetCache, screenCenter, angle, baseAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawLayer(CanvasDrawingSession ds, Windows.Foundation.Size screenSize, CanvasBitmap? bitmap, float rotationRadians, float blurAmount, float alpha)
|
||||
private void EnsureCachedLayer(ICanvasResourceCreator resourceCreator, CanvasBitmap? sourceBitmap, ref CanvasRenderTarget? targetCache)
|
||||
{
|
||||
if (bitmap == null) return;
|
||||
|
||||
float imgW = bitmap.SizeInPixels.Width;
|
||||
float imgH = bitmap.SizeInPixels.Height;
|
||||
Vector2 screenCenter = new Vector2((float)screenSize.Width / 2f, (float)screenSize.Height / 2f);
|
||||
|
||||
float scale;
|
||||
if (Speed > 0 && Math.Abs(rotationRadians) > 0.001f)
|
||||
if (sourceBitmap == null)
|
||||
{
|
||||
float screenDiagonal = (float)Math.Sqrt(screenSize.Width * screenSize.Width + screenSize.Height * screenSize.Height);
|
||||
|
||||
float scaleX = screenDiagonal / imgW;
|
||||
float scaleY = screenDiagonal / imgH;
|
||||
scale = Math.Max(scaleX, scaleY);
|
||||
}
|
||||
else
|
||||
{
|
||||
float scaleX = (float)screenSize.Width / imgW;
|
||||
float scaleY = (float)screenSize.Height / imgH;
|
||||
scale = Math.Max(scaleX, scaleY);
|
||||
targetCache?.Dispose();
|
||||
targetCache = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// 缩放图片 -> 将图片中心移动到 (0,0) 以便旋转 -> 旋转 ->将图片移回屏幕中心
|
||||
Vector2 imgCenterOffset = new Vector2(
|
||||
((float)screenSize.Width - imgW * scale) / 2.0f,
|
||||
((float)screenSize.Height - imgH * scale) / 2.0f
|
||||
);
|
||||
bool deviceMismatch = targetCache != null && targetCache.Device != resourceCreator.Device;
|
||||
|
||||
if (_needsCacheUpdate || targetCache == null || deviceMismatch)
|
||||
{
|
||||
targetCache?.Dispose();
|
||||
|
||||
float imgW = sourceBitmap.SizeInPixels.Width;
|
||||
float imgH = sourceBitmap.SizeInPixels.Height;
|
||||
Size screenSize = _lastScreenSize;
|
||||
|
||||
float scale;
|
||||
if (_lastWasRotating) // Speed > 0
|
||||
{
|
||||
float screenDiagonal = (float)Math.Sqrt(screenSize.Width * screenSize.Width + screenSize.Height * screenSize.Height);
|
||||
scale = Math.Max(screenDiagonal / imgW, screenDiagonal / imgH);
|
||||
}
|
||||
else
|
||||
{
|
||||
float scaleX = (float)screenSize.Width / imgW;
|
||||
float scaleY = (float)screenSize.Height / imgH;
|
||||
scale = Math.Max(scaleX, scaleY);
|
||||
}
|
||||
|
||||
float targetW = imgW * scale;
|
||||
float targetH = imgH * scale;
|
||||
|
||||
targetCache = new CanvasRenderTarget(resourceCreator, targetW, targetH, sourceBitmap.Dpi);
|
||||
|
||||
using (var ds = targetCache.CreateDrawingSession())
|
||||
{
|
||||
ds.Clear(Windows.UI.Color.FromArgb(0, 0, 0, 0));
|
||||
|
||||
using (var transformEffect = new Transform2DEffect())
|
||||
using (var blurEffect = new GaussianBlurEffect())
|
||||
{
|
||||
transformEffect.Source = sourceBitmap;
|
||||
transformEffect.TransformMatrix = Matrix3x2.CreateScale(scale);
|
||||
transformEffect.InterpolationMode = CanvasImageInterpolation.Linear;
|
||||
|
||||
blurEffect.Source = transformEffect;
|
||||
blurEffect.BlurAmount = BlurAmount;
|
||||
blurEffect.BorderMode = EffectBorderMode.Hard;
|
||||
|
||||
ds.DrawImage(blurEffect);
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceBitmap == _currentBitmap)
|
||||
{
|
||||
_needsCacheUpdate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawCachedLayer(CanvasDrawingSession ds, CanvasRenderTarget? cachedTexture, Vector2 screenCenter, float rotationRadians, float alpha)
|
||||
{
|
||||
if (cachedTexture == null) return;
|
||||
|
||||
Vector2 textureCenter = new Vector2((float)cachedTexture.Size.Width / 2f, (float)cachedTexture.Size.Height / 2f);
|
||||
|
||||
Matrix3x2 transform =
|
||||
Matrix3x2.CreateScale(scale) * Matrix3x2.CreateTranslation(imgCenterOffset) * Matrix3x2.CreateRotation(rotationRadians, screenCenter);
|
||||
Matrix3x2.CreateTranslation(-textureCenter) * Matrix3x2.CreateRotation(rotationRadians) * Matrix3x2.CreateTranslation(screenCenter);
|
||||
|
||||
using (var transformEffect = new Transform2DEffect())
|
||||
using (var blurEffect = new GaussianBlurEffect())
|
||||
{
|
||||
transformEffect.Source = bitmap;
|
||||
transformEffect.TransformMatrix = transform;
|
||||
transformEffect.InterpolationMode = CanvasImageInterpolation.Linear;
|
||||
Matrix3x2 previousTransform = ds.Transform;
|
||||
|
||||
blurEffect.Source = transformEffect;
|
||||
blurEffect.BlurAmount = blurAmount > 0 ? (blurAmount / 2.0f) : 0f;
|
||||
blurEffect.BorderMode = EffectBorderMode.Hard;
|
||||
ds.Transform = transform * previousTransform;
|
||||
ds.DrawImage(cachedTexture, 0, 0, new Rect(0, 0, cachedTexture.Size.Width, cachedTexture.Size.Height), alpha);
|
||||
|
||||
ds.DrawImage(blurEffect, 0, 0, new Windows.Foundation.Rect(0, 0, screenSize.Width, screenSize.Height), alpha);
|
||||
}
|
||||
ds.Transform = previousTransform;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_currentBitmap?.Dispose();
|
||||
_currentBitmap = null;
|
||||
_previousBitmap?.Dispose();
|
||||
|
||||
_currentTargetCache?.Dispose();
|
||||
_previousTargetCache?.Dispose();
|
||||
|
||||
_currentBitmap = null;
|
||||
_previousBitmap = null;
|
||||
_currentTargetCache = null;
|
||||
_previousTargetCache = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,8 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
var effectSettings = windowStatus.LyricsEffectSettings;
|
||||
var styleSettings = windowStatus.LyricsStyleSettings;
|
||||
|
||||
var rotationY = currentPlayingLine.OriginalPosition.WithX(effectSettings.FanLyricsAngle < 0 ? (float)lyricsWidth : 0);
|
||||
var rotationX = effectSettings.FanLyricsAngle < 0 ? lyricsWidth : 0;
|
||||
rotationX += lyricsWidth / 2 * (effectSettings.FanLyricsAngle < 0 ? 1 : -1);
|
||||
|
||||
for (int i = startVisibleIndex; i <= endVisibleIndex; i++)
|
||||
{
|
||||
@@ -145,14 +146,19 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
if (line.OriginalCanvasTextLayout == null) continue;
|
||||
if (line.OriginalCanvasTextLayout.LayoutBounds.Width <= 0) continue;
|
||||
|
||||
double xOffset = lyricsX;
|
||||
double yOffset = line.YOffsetTransition.Value + userScrollOffset + lyricsY + lyricsHeight * playingLineTopOffsetFactor;
|
||||
|
||||
var transform =
|
||||
Matrix3x2.CreateScale((float)line.ScaleTransition.Value, line.CenterPosition) *
|
||||
Matrix3x2.CreateRotation((float)line.AngleTransition.Value, rotationY) *
|
||||
Matrix3x2.CreateTranslation((float)lyricsX, (float)yOffset);
|
||||
ds.Transform = Matrix3x2.CreateScale((float)line.ScaleTransition.Value, line.CenterPosition);
|
||||
|
||||
ds.Transform = transform;
|
||||
if (effectSettings.IsFanLyricsEnabled)
|
||||
{
|
||||
xOffset += Math.Abs(line.AngleTransition.Value) / (Math.PI / 2) * lyricsWidth / 2 * (effectSettings.FanLyricsAngle < 0 ? 1 : -1);
|
||||
var rotationY = line.CenterPosition.Y;
|
||||
ds.Transform *= Matrix3x2.CreateRotation((float)line.AngleTransition.Value, new Vector2((float)rotationX, rotationY));
|
||||
}
|
||||
|
||||
ds.Transform *= Matrix3x2.CreateTranslation((float)xOffset, (float)yOffset);
|
||||
|
||||
using (var textOnlyLayer = RenderBaseTextLayer(control, line, styleSettings.LyricsFontStrokeWidth, strokeColor, line.ColorTransition.Value))
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage.Streams;
|
||||
using Windows.UI;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
@@ -28,6 +29,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
LyricsData? CurrentLyricsData { get; }
|
||||
|
||||
BitmapImage? AlbumArtBitmapImage { get; }
|
||||
IRandomAccessStream? AlbumArtBitmapStream { get; }
|
||||
|
||||
AlbumArtThemeColors CalculateAlbumArtThemeColors(LyricsWindowStatus lyricsWindowStatus, Color backdropAccentColor);
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
private BitmapDecoder? _albumArtBitmapDecoder = null;
|
||||
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial BitmapImage? AlbumArtBitmapImage { get; set; }
|
||||
[ObservableProperty][NotifyPropertyChangedRecipients] public partial IRandomAccessStream? AlbumArtBitmapStream { get; set; }
|
||||
|
||||
private void UpdateAlbumArt()
|
||||
{
|
||||
@@ -80,6 +81,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
if (token.IsCancellationRequested) return;
|
||||
|
||||
AlbumArtBitmapImage = bitmapImage;
|
||||
AlbumArtBitmapStream = ImageHelper.ToIRandomAccessStream(buffer);
|
||||
}
|
||||
|
||||
public AlbumArtThemeColors CalculateAlbumArtThemeColors(LyricsWindowStatus lyricsWindowStatus, Color backdropAccentColor)
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<data name="SettingsPageAlignment.Header" xml:space="preserve">
|
||||
<value>Alignment</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlwaysHideUnlockButton.Header" xml:space="preserve">
|
||||
<value>Always hide unlock button</value>
|
||||
</data>
|
||||
<data name="SettingsPageAmllTtmlDbBaseUrl.Header" xml:space="preserve">
|
||||
<value>Base URL</value>
|
||||
</data>
|
||||
@@ -1509,6 +1512,9 @@
|
||||
<data name="SettingsPageStartup.Text" xml:space="preserve">
|
||||
<value>Start</value>
|
||||
</data>
|
||||
<data name="SettingsPageStopTrackOnGalleryWindowClosed.Header" xml:space="preserve">
|
||||
<value>Stop playing when music library is closed</value>
|
||||
</data>
|
||||
<data name="SettingsPageStrokeFontColor.Header" xml:space="preserve">
|
||||
<value>Stroke color</value>
|
||||
</data>
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<data name="SettingsPageAlignment.Header" xml:space="preserve">
|
||||
<value>アライメント</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlwaysHideUnlockButton.Header" xml:space="preserve">
|
||||
<value>ロック解除ボタンは常に隠しておきましょう</value>
|
||||
</data>
|
||||
<data name="SettingsPageAmllTtmlDbBaseUrl.Header" xml:space="preserve">
|
||||
<value>ベースURL</value>
|
||||
</data>
|
||||
@@ -1509,6 +1512,9 @@
|
||||
<data name="SettingsPageStartup.Text" xml:space="preserve">
|
||||
<value>起動</value>
|
||||
</data>
|
||||
<data name="SettingsPageStopTrackOnGalleryWindowClosed.Header" xml:space="preserve">
|
||||
<value>音楽ライブラリが閉じられたら、再生を停止してください</value>
|
||||
</data>
|
||||
<data name="SettingsPageStrokeFontColor.Header" xml:space="preserve">
|
||||
<value>ストロークカラー</value>
|
||||
</data>
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<data name="SettingsPageAlignment.Header" xml:space="preserve">
|
||||
<value>조정</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlwaysHideUnlockButton.Header" xml:space="preserve">
|
||||
<value>항상 잠금 해제 버튼을 숨깁니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageAmllTtmlDbBaseUrl.Header" xml:space="preserve">
|
||||
<value>기본 URL</value>
|
||||
</data>
|
||||
@@ -1509,6 +1512,9 @@
|
||||
<data name="SettingsPageStartup.Text" xml:space="preserve">
|
||||
<value>시작</value>
|
||||
</data>
|
||||
<data name="SettingsPageStopTrackOnGalleryWindowClosed.Header" xml:space="preserve">
|
||||
<value>음악 라이브러리가 닫히면 재생을 중지하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageStrokeFontColor.Header" xml:space="preserve">
|
||||
<value>윤곽선 색상</value>
|
||||
</data>
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<data name="SettingsPageAlignment.Header" xml:space="preserve">
|
||||
<value>对齐方式</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlwaysHideUnlockButton.Header" xml:space="preserve">
|
||||
<value>总是隐藏解锁按钮</value>
|
||||
</data>
|
||||
<data name="SettingsPageAmllTtmlDbBaseUrl.Header" xml:space="preserve">
|
||||
<value>基本 URL</value>
|
||||
</data>
|
||||
@@ -1509,6 +1512,9 @@
|
||||
<data name="SettingsPageStartup.Text" xml:space="preserve">
|
||||
<value>启动</value>
|
||||
</data>
|
||||
<data name="SettingsPageStopTrackOnGalleryWindowClosed.Header" xml:space="preserve">
|
||||
<value>关闭音乐库时停止播放</value>
|
||||
</data>
|
||||
<data name="SettingsPageStrokeFontColor.Header" xml:space="preserve">
|
||||
<value>描边颜色</value>
|
||||
</data>
|
||||
|
||||
@@ -630,6 +630,9 @@
|
||||
<data name="SettingsPageAlignment.Header" xml:space="preserve">
|
||||
<value>對齊方式</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlwaysHideUnlockButton.Header" xml:space="preserve">
|
||||
<value>總是隱藏解鎖按鈕</value>
|
||||
</data>
|
||||
<data name="SettingsPageAmllTtmlDbBaseUrl.Header" xml:space="preserve">
|
||||
<value>基本網址</value>
|
||||
</data>
|
||||
@@ -1509,6 +1512,9 @@
|
||||
<data name="SettingsPageStartup.Text" xml:space="preserve">
|
||||
<value>啟動</value>
|
||||
</data>
|
||||
<data name="SettingsPageStopTrackOnGalleryWindowClosed.Header" xml:space="preserve">
|
||||
<value>關閉音樂庫時停止播放</value>
|
||||
</data>
|
||||
<data name="SettingsPageStrokeFontColor.Header" xml:space="preserve">
|
||||
<value>描邊顏色</value>
|
||||
</data>
|
||||
|
||||
@@ -178,7 +178,10 @@ namespace BetterLyrics.WinUI3.Views
|
||||
private void Page_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.CancelRefreshSongs();
|
||||
ViewModel.StopTrackCommand.Execute(null);
|
||||
if (ViewModel.AppSettings.MusicGallerySettings.StopOnWindowClosed)
|
||||
{
|
||||
ViewModel.StopTrackCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void PlaylistFavButton_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
|
||||
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dev="using:DevWinUI"
|
||||
xmlns:local="using:BetterLyrics.WinUI3.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:media="using:CommunityToolkit.WinUI.Media"
|
||||
@@ -14,6 +15,7 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="RootGrid" SizeChanged="RootGrid_SizeChanged">
|
||||
|
||||
<Grid
|
||||
x:Name="PlaceholderGrid"
|
||||
Width="1"
|
||||
@@ -27,7 +29,7 @@
|
||||
<Grid
|
||||
x:Name="TopCommandGrid"
|
||||
VerticalAlignment="Top"
|
||||
Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}"
|
||||
Background="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}"
|
||||
Opacity="{x:Bind ViewModel.TopCommandGridOpacity, Mode=OneWay}"
|
||||
PointerEntered="TopCommandGrid_PointerEntered"
|
||||
PointerExited="TopCommandGrid_PointerExited">
|
||||
|
||||
@@ -63,8 +63,6 @@ namespace BetterLyrics.WinUI3.Views
|
||||
AppWindow.Changed += AppWindow_Changed;
|
||||
AppWindow.Closing += AppWindow_Closing;
|
||||
|
||||
SystemBackdrop = SystemBackdropHelper.CreateSystemBackdrop(BackdropType.Transparent);
|
||||
|
||||
WeakReferenceMessenger.Default.RegisterAll(this);
|
||||
|
||||
UpdateAlbumArtThemeColors();
|
||||
@@ -89,6 +87,7 @@ namespace BetterLyrics.WinUI3.Views
|
||||
OnAutoShowOrHideWindowChanged();
|
||||
OnTitleBarAreaChanged();
|
||||
OnIsPinToTaskbarChanged();
|
||||
OnIsAlwaysHideUnlockButtonChanged();
|
||||
|
||||
LyricsWindowStatus.UpdateDemoWindowAndMonitorBounds();
|
||||
}
|
||||
@@ -202,22 +201,31 @@ namespace BetterLyrics.WinUI3.Views
|
||||
}
|
||||
}
|
||||
|
||||
private void OnIsAlwaysHideUnlockButtonChanged()
|
||||
{
|
||||
UnlockButton.Visibility = LyricsWindowStatus.IsAlwaysHideUnlockButton ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
private void OnIsFullscreenChanged()
|
||||
{
|
||||
this.SetIsFullscreen(LyricsWindowStatus.IsFullscreen);
|
||||
EnterFullscreenFontIcon.Opacity = LyricsWindowStatus.IsFullscreen ? 0 : 1;
|
||||
ExitFullscreenFontIcon.Opacity = LyricsWindowStatus.IsFullscreen ? 1 : 0;
|
||||
MaximizeButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
AOTButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
MinimizeButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
LockButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
if (this.SetIsFullscreen(LyricsWindowStatus.IsFullscreen))
|
||||
{
|
||||
EnterFullscreenFontIcon.Opacity = LyricsWindowStatus.IsFullscreen ? 0 : 1;
|
||||
ExitFullscreenFontIcon.Opacity = LyricsWindowStatus.IsFullscreen ? 1 : 0;
|
||||
MaximizeButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
AOTButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
MinimizeButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
LockButton.Visibility = LyricsWindowStatus.IsFullscreen ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnIsMaximizedChanged()
|
||||
{
|
||||
this.SetIsMaximized(LyricsWindowStatus.IsMaximized);
|
||||
EnterMaximizeFontIcon.Opacity = LyricsWindowStatus.IsMaximized ? 0 : 1;
|
||||
ExitMaximizeFontIcon.Opacity = LyricsWindowStatus.IsMaximized ? 1 : 0;
|
||||
if (this.SetIsMaximized(LyricsWindowStatus.IsMaximized))
|
||||
{
|
||||
EnterMaximizeFontIcon.Opacity = LyricsWindowStatus.IsMaximized ? 0 : 1;
|
||||
ExitMaximizeFontIcon.Opacity = LyricsWindowStatus.IsMaximized ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAutoShowOrHideWindowChanged()
|
||||
@@ -502,6 +510,10 @@ namespace BetterLyrics.WinUI3.Views
|
||||
{
|
||||
OnIsPinToTaskbarChanged();
|
||||
}
|
||||
else if (message.PropertyName == nameof(LyricsWindowStatus.IsAlwaysHideUnlockButton))
|
||||
{
|
||||
OnIsAlwaysHideUnlockButtonChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,18 @@ BetterLyrics
|
||||
|
||||
<div align=center>
|
||||
|
||||
   
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<div align=center>
|
||||
|
||||
[](https://github.com/jayfunc/BetterLyrics/stargazers)
|
||||
[](https://deepwiki.com/jayfunc/BetterLyrics)
|
||||
[](https://zread.ai/jayfunc/BetterLyrics)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -147,6 +152,8 @@ BetterLyrics
|
||||
|
||||
</details>
|
||||
|
||||
本项目的持续发展离不开大家的支持。**[查看完整鸣谢名单](SPONSORS.md)**
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
本项目采用 GNU 通用公共许可证 v3.0 授权。详情请参阅 [LICENSE](https://github.com/jayfunc/BetterLyrics/blob/dev/LICENSE) 文件。
|
||||
|
||||
@@ -20,13 +20,18 @@ BetterLyrics
|
||||
|
||||
<div align=center>
|
||||
|
||||
   
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
<div align=center>
|
||||
|
||||
[](https://github.com/jayfunc/BetterLyrics/stargazers)
|
||||
[](https://deepwiki.com/jayfunc/BetterLyrics)
|
||||
[](https://zread.ai/jayfunc/BetterLyrics)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -153,6 +158,8 @@ You can donate via:
|
||||
|
||||
</details>
|
||||
|
||||
This project is made possible by the generous support of our users. **[View the full Hall of Fame](SPONSORS.md)**
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](https://github.com/jayfunc/BetterLyrics/blob/dev/LICENSE) file for details.
|
||||
|
||||
22
SPONSORS.md
Normal file
22
SPONSORS.md
Normal file
@@ -0,0 +1,22 @@
|
||||
Special thanks to the following people for their support!
|
||||
|
||||
特别感谢以下朋友的支持!
|
||||
|
||||
| Date / 日期 | Name / 昵称 |
|
||||
| :--- | :--- |
|
||||
| Dec 13, 2025 | \<Anonymous\> |
|
||||
| Dec 3, 2025 | YE |
|
||||
| Dec 2, 2025 | \<Anonymous\> |
|
||||
| Nov 23, 2025 | \*\*玄 |
|
||||
| Nov 21, 2025 | \*\*智 |
|
||||
| Nov 17, 2025 | \*鹤 |
|
||||
| Nov 2, 2025 | 借过 |
|
||||
| Aug 28, 2025 | \*\*华 |
|
||||
|
||||
> *List is updated manually. If you donated but don't see your name here, please contact me.*
|
||||
>
|
||||
> *名单手动更新。如果您已捐赠但未在此看到您的名字,请联系我。*
|
||||
|
||||
I would also like to express my sincere gratitude to **all users who purchased the app from the Store**. Your support is the driving force behind this project!
|
||||
|
||||
同时,向 **所有在商店购买应用的用户** 表达最诚挚的感谢。你们的支持是本项目不断前行的动力!
|
||||
Reference in New Issue
Block a user