mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:08:33 +08:00
@@ -11,7 +11,7 @@
|
||||
<Identity
|
||||
Name="37412.BetterLyrics"
|
||||
Publisher="CN=Zhe"
|
||||
Version="1.0.4.0" />
|
||||
Version="1.0.5.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
<Resource Language="en-US"/>
|
||||
<Resource Language="zh-CN"/>
|
||||
<Resource Language="zh-TW"/>
|
||||
<Resource Language="ja-JP"/>
|
||||
<Resource Language="ko-KR"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<converter:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||
<converter:MatchedLocalFilesPathToVisibilityConverter x:Key="MatchedLocalFilesPathToVisibilityConverter" />
|
||||
<converter:IntToCornerRadius x:Key="IntToCornerRadius" />
|
||||
<converter:LyricsSearchProviderToDisplayNameConverter x:Key="LyricsSearchProviderToDisplayNameConverter" />
|
||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
||||
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BetterInAppLyrics.WinUI3.ViewModels;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Rendering;
|
||||
using BetterLyrics.WinUI3.Services.Database;
|
||||
using BetterLyrics.WinUI3.Services.Playback;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.Services.BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using BetterLyrics.WinUI3.Views;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -14,7 +13,6 @@ using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.Windows.ApplicationModel.Resources;
|
||||
using Serilog;
|
||||
using WinUIEx;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
@@ -48,19 +46,46 @@ namespace BetterLyrics.WinUI3
|
||||
ResourceLoader = new ResourceLoader();
|
||||
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
Helper.AppInfo.EnsureDirectories();
|
||||
AppInfo.EnsureDirectories();
|
||||
ConfigureServices();
|
||||
|
||||
_logger = Ioc.Default.GetService<ILogger<App>>()!;
|
||||
|
||||
UnhandledException += App_UnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
}
|
||||
|
||||
private void CurrentDomain_FirstChanceException(
|
||||
object? sender,
|
||||
System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e
|
||||
)
|
||||
{
|
||||
_logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException");
|
||||
}
|
||||
|
||||
private void TaskScheduler_UnobservedTaskException(
|
||||
object? sender,
|
||||
UnobservedTaskExceptionEventArgs e
|
||||
)
|
||||
{
|
||||
_logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException");
|
||||
}
|
||||
|
||||
private void CurrentDomain_UnhandledException(
|
||||
object sender,
|
||||
System.UnhandledExceptionEventArgs e
|
||||
)
|
||||
{
|
||||
_logger.LogError(e.ExceptionObject.ToString(), "CurrentDomain_UnhandledException");
|
||||
}
|
||||
|
||||
private static void ConfigureServices()
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Debug()
|
||||
.WriteTo.File(Helper.AppInfo.LogFilePattern, rollingInterval: RollingInterval.Day)
|
||||
.WriteTo.File(AppInfo.LogFilePattern, rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
// Register services
|
||||
@@ -73,8 +98,9 @@ namespace BetterLyrics.WinUI3
|
||||
})
|
||||
// Services
|
||||
.AddSingleton<ISettingsService, SettingsService>()
|
||||
.AddSingleton<IDatabaseService, DatabaseService>()
|
||||
.AddSingleton<IPlaybackService, PlaybackService>()
|
||||
.AddSingleton<IMusicSearchService, MusicSearchService>()
|
||||
.AddSingleton<ILibWatcherService, LibWatcherService>()
|
||||
// ViewModels
|
||||
.AddTransient<HostWindowViewModel>()
|
||||
.AddSingleton<SettingsViewModel>()
|
||||
|
||||
Binary file not shown.
@@ -10,9 +10,6 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\CustomTransform.bin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Logo.ico" />
|
||||
</ItemGroup>
|
||||
@@ -21,32 +18,36 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.MarqueeText" Version="0.1.230830" />
|
||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.OpacityMaskView" Version="0.1.250513-build.2126" />
|
||||
<PackageReference
|
||||
Include="CommunityToolkit.Labs.WinUI.OpacityMaskView"
|
||||
Version="0.1.250513-build.2126"
|
||||
/>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageReference
|
||||
Include="CommunityToolkit.WinUI.Controls.SettingsControls"
|
||||
Version="8.2.250402"
|
||||
/>
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
||||
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.3.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.6" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.6" />
|
||||
<PackageReference Include="TagLibSharp" Version="2.3.0" />
|
||||
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
||||
<PackageReference Include="WinUIEx" Version="2.5.1" />
|
||||
<PackageReference Include="z440.atl.core" Version="6.25.0" />
|
||||
<PackageReference Include="z440.atl.core" Version="6.26.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="Assets\AI - 甜度爆表.mp3">
|
||||
@@ -67,6 +68,10 @@
|
||||
<Folder Include="Controls\" />
|
||||
<Folder Include="ViewModels\Lyrics\" />
|
||||
</ItemGroup>
|
||||
<!--Disable Trimming for Specific Packages-->
|
||||
<ItemGroup>
|
||||
<TrimmerRootAssembly Include="TagLibSharp" />
|
||||
</ItemGroup>
|
||||
<!-- Publish Properties -->
|
||||
<PropertyGroup>
|
||||
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Converter
|
||||
{
|
||||
public class LyricsSearchProviderToDisplayNameConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if (value is LyricsSearchProvider provider)
|
||||
{
|
||||
return provider switch
|
||||
{
|
||||
LyricsSearchProvider.LocalLrcFile => App.ResourceLoader!.GetString(
|
||||
"LyricsSearchProviderLocalLrcFile"
|
||||
),
|
||||
LyricsSearchProvider.LocalMusicFile => App.ResourceLoader!.GetString(
|
||||
"LyricsSearchProviderLocalMusicFile"
|
||||
),
|
||||
LyricsSearchProvider.LrcLib => App.ResourceLoader!.GetString(
|
||||
"LyricsSearchProviderLrcLib"
|
||||
),
|
||||
LyricsSearchProvider.LocalEslrcFile => App.ResourceLoader!.GetString(
|
||||
"LyricsSearchProviderEslrcFile"
|
||||
),
|
||||
LyricsSearchProvider.LocalTtmlFile => App.ResourceLoader!.GetString(
|
||||
"LyricsSearchProviderTtmlFile"
|
||||
),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(provider), provider, null),
|
||||
};
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,7 @@ namespace BetterLyrics.WinUI3.Enums
|
||||
English,
|
||||
SimplifiedChinese,
|
||||
TraditionalChinese,
|
||||
Japanese,
|
||||
Korean,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Enums
|
||||
{
|
||||
public enum LocalSearchTargetProps
|
||||
{
|
||||
LyricsOnly,
|
||||
LyricsAndAlbumArt,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Enums
|
||||
{
|
||||
public enum LyricsFormat
|
||||
{
|
||||
Lrc,
|
||||
Eslrc,
|
||||
Ttml,
|
||||
}
|
||||
|
||||
public static class LyricsFormatExtensions
|
||||
{
|
||||
public static string ToFileExtension(this LyricsFormat format)
|
||||
{
|
||||
return format switch
|
||||
{
|
||||
LyricsFormat.Lrc => ".lrc",
|
||||
LyricsFormat.Eslrc => ".eslrc",
|
||||
LyricsFormat.Ttml => ".ttml",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(format), format, null),
|
||||
};
|
||||
}
|
||||
|
||||
public static LyricsFormat? Detect(string content)
|
||||
{
|
||||
if (
|
||||
content.StartsWith("<?xml")
|
||||
&& System.Text.RegularExpressions.Regex.IsMatch(content, @"<tt(:\w+)?\b")
|
||||
)
|
||||
{
|
||||
return LyricsFormat.Ttml;
|
||||
}
|
||||
// 检测标准LRC和增强型LRC
|
||||
else if (
|
||||
System.Text.RegularExpressions.Regex.IsMatch(content, @"\[\d{1,2}:\d{2}")
|
||||
|| System.Text.RegularExpressions.Regex.IsMatch(
|
||||
content,
|
||||
@"<\d{1,2}:\d{2}\.\d{2,3}>"
|
||||
)
|
||||
)
|
||||
{
|
||||
return LyricsFormat.Lrc;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace BetterLyrics.WinUI3.Enums
|
||||
{
|
||||
public enum LyricsSearchProvider
|
||||
{
|
||||
LrcLib,
|
||||
LocalMusicFile,
|
||||
LocalLrcFile,
|
||||
LocalEslrcFile,
|
||||
LocalTtmlFile,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Enums
|
||||
{
|
||||
public enum LyricsStatus
|
||||
{
|
||||
NotFound,
|
||||
Found,
|
||||
Loading,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace BetterLyrics.WinUI3.Enums
|
||||
{
|
||||
public enum MusicSearchMatchMode
|
||||
{
|
||||
TitleAndArtist,
|
||||
TitleArtistAlbumAndDuration,
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,5 @@ namespace BetterLyrics.WinUI3.Events
|
||||
public class IsPlayingChangedEventArgs(bool isPlaying) : EventArgs
|
||||
{
|
||||
public bool IsPlaying { get; set; } = isPlaying;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Events
|
||||
{
|
||||
public class LibChangedEventArgs : EventArgs
|
||||
{
|
||||
public string Folder { get; }
|
||||
public string FilePath { get; }
|
||||
public WatcherChangeTypes ChangeType { get; }
|
||||
|
||||
public LibChangedEventArgs(string folder, string filePath, WatcherChangeTypes changeType)
|
||||
{
|
||||
Folder = folder;
|
||||
FilePath = filePath;
|
||||
ChangeType = changeType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,5 @@ namespace BetterLyrics.WinUI3.Events
|
||||
public class PositionChangedEventArgs(TimeSpan position) : EventArgs()
|
||||
{
|
||||
public TimeSpan Position { get; set; } = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,5 @@ namespace BetterLyrics.WinUI3.Events
|
||||
public class SongInfoChangedEventArgs(SongInfo? songInfo) : EventArgs
|
||||
{
|
||||
public SongInfo? SongInfo { get; set; } = songInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,79 @@
|
||||
using System;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
public static class AnimationHelper
|
||||
public class AnimationHelper
|
||||
{
|
||||
public const int StackedNotificationsShowingDuration = 3900;
|
||||
public const int StoryboardDefaultDuration = 200;
|
||||
public const int DebounceDefaultDuration = 200;
|
||||
}
|
||||
|
||||
public class ValueTransition<T>
|
||||
where T : struct
|
||||
{
|
||||
private T _currentValue;
|
||||
private T _startValue;
|
||||
private T _targetValue;
|
||||
private float _progress;
|
||||
private float _durationSeconds;
|
||||
private bool _isTransitioning;
|
||||
private Func<T, T, float, T> _interpolator;
|
||||
|
||||
public ValueTransition(
|
||||
T initialValue,
|
||||
float durationSeconds,
|
||||
Func<T, T, float, T> interpolator
|
||||
)
|
||||
{
|
||||
_currentValue = initialValue;
|
||||
_startValue = initialValue;
|
||||
_targetValue = initialValue;
|
||||
_durationSeconds = durationSeconds;
|
||||
_progress = 1f;
|
||||
_isTransitioning = false;
|
||||
_interpolator = interpolator;
|
||||
}
|
||||
|
||||
public T Value => _currentValue;
|
||||
public bool IsTransitioning => _isTransitioning;
|
||||
|
||||
public void StartTransition(T targetValue)
|
||||
{
|
||||
if (!targetValue.Equals(_currentValue))
|
||||
{
|
||||
_startValue = _currentValue;
|
||||
_targetValue = targetValue;
|
||||
_progress = 0f;
|
||||
_isTransitioning = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(TimeSpan elapsedTime)
|
||||
{
|
||||
if (!_isTransitioning)
|
||||
return;
|
||||
|
||||
_progress += (float)elapsedTime.TotalSeconds / _durationSeconds;
|
||||
if (_progress >= 1f)
|
||||
{
|
||||
_progress = 1f;
|
||||
_currentValue = _targetValue;
|
||||
_isTransitioning = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentValue = _interpolator(_startValue, _targetValue, _progress);
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset(T value)
|
||||
{
|
||||
_currentValue = value;
|
||||
_startValue = value;
|
||||
_targetValue = value;
|
||||
_progress = 0f;
|
||||
_isTransitioning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,22 +41,21 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
public static string AssetsFolder => Path.Combine(Package.Current.InstalledPath, "Assets");
|
||||
|
||||
// Data Files
|
||||
private static string DatabaseFileName => "database.db";
|
||||
public static string DatabasePath => Path.Combine(LocalFolder, DatabaseFileName);
|
||||
|
||||
public static string LogDirectory => Path.Combine(CacheFolder, "logs");
|
||||
public static string LogFilePattern => Path.Combine(LogDirectory, "log-.txt");
|
||||
|
||||
public static string OnlineLyricsCacheDirectory =>
|
||||
Path.Combine(CacheFolder, "online-lyrics");
|
||||
|
||||
private static string TestMusicFileName => "AI - 甜度爆表.mp3";
|
||||
public static string TestMusicPath => Path.Combine(AssetsFolder, TestMusicFileName);
|
||||
|
||||
private static string CustomShaderFileName => "CustomTransform.bin";
|
||||
public static string CustomShaderPath => Path.Combine(AssetsFolder, CustomShaderFileName);
|
||||
|
||||
public static void EnsureDirectories()
|
||||
{
|
||||
Directory.CreateDirectory(LogDirectory);
|
||||
Directory.CreateDirectory(LocalFolder);
|
||||
Directory.CreateDirectory(LogDirectory);
|
||||
Directory.CreateDirectory(OnlineLyricsCacheDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,11 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Graphics.Imaging;
|
||||
|
||||
// This file is a fork of https://github.com/KSemenenko/ColorThief
|
||||
// and is used to extract dominant colors from images in WinUI3 application
|
||||
// I have modified it to fit the WinUI3 environment and removed unnecessary parts
|
||||
// Credits to KSemenenko for the original work.
|
||||
|
||||
namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
window.SetIsShownInSwitchers(true);
|
||||
window.ExtendsContentIntoTitleBar = true;
|
||||
window.SetIsAlwaysOnTop(false);
|
||||
|
||||
IntPtr hwnd = WindowNative.GetWindowHandle(window);
|
||||
|
||||
@@ -43,8 +44,6 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
_originalPositions.Remove(hwnd);
|
||||
}
|
||||
|
||||
window.SetIsAlwaysOnTop(false);
|
||||
|
||||
UnregisterAppBar(hwnd);
|
||||
}
|
||||
|
||||
@@ -52,6 +51,7 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
window.SetIsShownInSwitchers(false);
|
||||
window.ExtendsContentIntoTitleBar = false;
|
||||
window.SetIsAlwaysOnTop(true);
|
||||
|
||||
IntPtr hwnd = WindowNative.GetWindowHandle(window);
|
||||
|
||||
@@ -82,8 +82,6 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
appBarHeight,
|
||||
SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_SHOWWINDOW
|
||||
);
|
||||
|
||||
window.SetIsAlwaysOnTop(true);
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
|
||||
27
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/FileHelper.cs
Normal file
27
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/FileHelper.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Ude;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
public class FileHelper
|
||||
{
|
||||
public static Encoding GetEncoding(string filename)
|
||||
{
|
||||
var bytes = File.ReadAllBytes(filename);
|
||||
var cdet = new CharsetDetector();
|
||||
cdet.Feed(bytes, 0, bytes.Length);
|
||||
cdet.DataEnd();
|
||||
var encoding = cdet.Charset;
|
||||
if (encoding == null)
|
||||
{
|
||||
return Encoding.UTF8;
|
||||
}
|
||||
return Encoding.GetEncoding(encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Graphics.Canvas;
|
||||
using Microsoft.Graphics.Canvas.Text;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Text;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Windows.Graphics.Imaging;
|
||||
@@ -71,5 +76,81 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
|
||||
public static async Task<BitmapDecoder> GetDecoderFromByte(byte[] bytes) =>
|
||||
await BitmapDecoder.CreateAsync(await ByteArrayToStream(bytes));
|
||||
|
||||
public static async Task<byte[]> CreateTextPlaceholderBytesAsync(
|
||||
string text,
|
||||
int width,
|
||||
int height
|
||||
)
|
||||
{
|
||||
var device = CanvasDevice.GetSharedDevice();
|
||||
var renderTarget = new CanvasRenderTarget(device, width, height, 96);
|
||||
|
||||
// 居中绘制文字
|
||||
using (var ds = renderTarget.CreateDrawingSession())
|
||||
{
|
||||
// 背景色
|
||||
ds.Clear(Colors.LightGray);
|
||||
|
||||
// 文字格式
|
||||
var format = new CanvasTextFormat
|
||||
{
|
||||
FontSize = Math.Min(width, height) / 6f,
|
||||
FontWeight = Microsoft.UI.Text.FontWeights.SemiBold,
|
||||
HorizontalAlignment = CanvasHorizontalAlignment.Center,
|
||||
VerticalAlignment = CanvasVerticalAlignment.Center,
|
||||
WordWrapping = CanvasWordWrapping.Wrap,
|
||||
TrimmingGranularity = CanvasTextTrimmingGranularity.Character,
|
||||
Options = CanvasDrawTextOptions.Default,
|
||||
};
|
||||
|
||||
// 设定边距
|
||||
float margin = Math.Min(width, height) / 12f;
|
||||
float availableWidth = width - 2 * margin;
|
||||
float availableHeight = height - 2 * margin;
|
||||
|
||||
// 计算合适的字体大小以适应内容区域
|
||||
float fontSize = format.FontSize;
|
||||
float minFontSize = 8f;
|
||||
float maxFontSize = format.FontSize;
|
||||
CanvasTextLayout layout;
|
||||
do
|
||||
{
|
||||
format.FontSize = fontSize;
|
||||
layout = new CanvasTextLayout(
|
||||
ds,
|
||||
text,
|
||||
format,
|
||||
availableWidth,
|
||||
availableHeight
|
||||
);
|
||||
if (
|
||||
layout.LayoutBounds.Width <= availableWidth
|
||||
&& layout.LayoutBounds.Height <= availableHeight
|
||||
)
|
||||
break;
|
||||
fontSize -= 1f;
|
||||
} while (fontSize >= minFontSize);
|
||||
|
||||
// 居中绘制文字(在内容区域内居中)
|
||||
var bounds = layout.LayoutBounds;
|
||||
var x = margin + (availableWidth - (float)bounds.Width) / 2f - (float)bounds.X;
|
||||
var y = margin + (availableHeight - (float)bounds.Height) / 2f - (float)bounds.Y;
|
||||
ds.DrawTextLayout(layout, new Vector2(x, y), Colors.DarkGray);
|
||||
}
|
||||
|
||||
// 保存为 PNG 并转为 byte[]
|
||||
using (var stream = new InMemoryRandomAccessStream())
|
||||
{
|
||||
await renderTarget.SaveAsync(stream, CanvasBitmapFileFormat.Png);
|
||||
var buffer = new byte[stream.Size];
|
||||
using (var reader = new DataReader(stream.GetInputStreamAt(0)))
|
||||
{
|
||||
await reader.LoadAsync((uint)stream.Size);
|
||||
reader.ReadBytes(buffer);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
314
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs
Normal file
314
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Helper/LyricsParser.cs
Normal file
@@ -0,0 +1,314 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Helper
|
||||
{
|
||||
public class LyricsParser
|
||||
{
|
||||
private List<List<LyricsLine>> _multiLangLyricsLines = [];
|
||||
|
||||
public List<List<LyricsLine>> Parse(
|
||||
string raw,
|
||||
LyricsFormat? lyricsFormat = null,
|
||||
string? title = null,
|
||||
string? artist = null,
|
||||
int durationMs = 0
|
||||
)
|
||||
{
|
||||
_multiLangLyricsLines = [];
|
||||
switch (lyricsFormat)
|
||||
{
|
||||
case LyricsFormat.Lrc:
|
||||
case LyricsFormat.Eslrc:
|
||||
ParseLrc(raw, durationMs);
|
||||
break;
|
||||
case LyricsFormat.Ttml:
|
||||
ParseTtml(raw, durationMs);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _multiLangLyricsLines;
|
||||
}
|
||||
|
||||
private void PostProcessLyricsLines(List<LyricsLine> lines)
|
||||
{
|
||||
if (lines.Count > 0 && lines[0].StartMs > 0)
|
||||
{
|
||||
lines.Insert(
|
||||
0,
|
||||
new LyricsLine
|
||||
{
|
||||
StartMs = 0,
|
||||
EndMs = lines[0].StartMs,
|
||||
Text = "",
|
||||
CharTimings = [],
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseLrc(string raw, int durationMs)
|
||||
{
|
||||
var lines = raw.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var lrcLines =
|
||||
new List<(int time, string text, List<(int time, string text)> syllables)>();
|
||||
|
||||
// 支持 [mm:ss.xx]字、<mm:ss.xx>字,毫秒两位或三位
|
||||
var syllableRegex = new Regex(
|
||||
@"(\[|\<)(\d{2}):(\d{2})\.(\d{2,3})(\]|\>)([^\[\]\<\>]*)"
|
||||
);
|
||||
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var matches = syllableRegex.Matches(line);
|
||||
var syllables = new List<(int, string)>();
|
||||
for (int i = 0; i < matches.Count; i++)
|
||||
{
|
||||
var m = matches[i];
|
||||
int min = int.Parse(m.Groups[2].Value);
|
||||
int sec = int.Parse(m.Groups[3].Value);
|
||||
int ms = int.Parse(m.Groups[4].Value.PadRight(3, '0'));
|
||||
int totalMs = min * 60_000 + sec * 1000 + ms;
|
||||
string text = m.Groups[6].Value;
|
||||
|
||||
syllables.Add((totalMs, text));
|
||||
}
|
||||
if (syllables.Count > 0)
|
||||
{
|
||||
lrcLines.Add(
|
||||
(
|
||||
syllables[0].Item1,
|
||||
string.Concat(syllables.Select(s => s.Item2)),
|
||||
syllables
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 普通LRC行
|
||||
var bracketRegex = new Regex(@"\[(\d{2}):(\d{2})\.(\d{2,3})\]");
|
||||
var bracketMatches = bracketRegex.Matches(line);
|
||||
string content = line;
|
||||
int? lineStartTime = null;
|
||||
if (bracketMatches.Count > 0)
|
||||
{
|
||||
var m = bracketMatches[0];
|
||||
int min = int.Parse(m.Groups[1].Value);
|
||||
int sec = int.Parse(m.Groups[2].Value);
|
||||
int ms = int.Parse(m.Groups[3].Value.PadRight(3, '0'));
|
||||
lineStartTime = min * 60_000 + sec * 1000 + ms;
|
||||
content = bracketRegex.Replace(line, "").Trim();
|
||||
lrcLines.Add((lineStartTime.Value, content, new List<(int, string)>()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按时间分组
|
||||
var grouped = lrcLines.GroupBy(l => l.time).OrderBy(g => g.Key).ToList();
|
||||
int languageCount = grouped.Max(g => g.Count());
|
||||
|
||||
// 初始化每种语言的歌词列表
|
||||
_multiLangLyricsLines.Clear();
|
||||
for (int i = 0; i < languageCount; i++)
|
||||
_multiLangLyricsLines.Add(new List<LyricsLine>());
|
||||
|
||||
// 遍历每个时间分组
|
||||
foreach (var group in grouped)
|
||||
{
|
||||
var linesInGroup = group.ToList();
|
||||
for (int langIdx = 0; langIdx < languageCount; langIdx++)
|
||||
{
|
||||
// 如果该语言有翻译,取对应行,否则用原文(第一行)
|
||||
var (start, text, syllables) =
|
||||
langIdx < linesInGroup.Count ? linesInGroup[langIdx] : linesInGroup[0];
|
||||
var line = new LyricsLine
|
||||
{
|
||||
StartMs = start,
|
||||
EndMs = 0, // 稍后统一修正
|
||||
Text = text,
|
||||
CharTimings = [],
|
||||
};
|
||||
if (syllables != null && syllables.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < syllables.Count; j++)
|
||||
{
|
||||
var (charStart, charText) = syllables[j];
|
||||
int charEnd = (j + 1 < syllables.Count) ? syllables[j + 1].Item1 : 0;
|
||||
line.CharTimings.Add(
|
||||
new CharTiming { StartMs = charStart, EndMs = charEnd }
|
||||
);
|
||||
}
|
||||
}
|
||||
_multiLangLyricsLines[langIdx].Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
// 修正 EndMs
|
||||
for (int langIdx = 0; langIdx < languageCount; langIdx++)
|
||||
{
|
||||
var linesInSingleLang = _multiLangLyricsLines[langIdx];
|
||||
for (int i = 0; i < linesInSingleLang.Count; i++)
|
||||
{
|
||||
if (i + 1 < linesInSingleLang.Count)
|
||||
linesInSingleLang[i].EndMs = linesInSingleLang[i + 1].StartMs;
|
||||
else
|
||||
linesInSingleLang[i].EndMs = durationMs;
|
||||
|
||||
// 修正 CharTimings 的最后一个 EndMs
|
||||
var timings = linesInSingleLang[i].CharTimings;
|
||||
if (timings.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < timings.Count; j++)
|
||||
{
|
||||
if (j + 1 < timings.Count)
|
||||
timings[j].EndMs = timings[j + 1].StartMs;
|
||||
else
|
||||
timings[j].EndMs = linesInSingleLang[i].EndMs;
|
||||
}
|
||||
}
|
||||
}
|
||||
PostProcessLyricsLines(linesInSingleLang);
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseTtml(string raw, int durationMs)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<LyricsLine> singleLangLyricsLine = [];
|
||||
var xdoc = XDocument.Parse(raw);
|
||||
var body = xdoc.Descendants().FirstOrDefault(e => e.Name.LocalName == "body");
|
||||
if (body == null)
|
||||
return;
|
||||
var ps = body.Descendants().Where(e => e.Name.LocalName == "p");
|
||||
foreach (var p in ps)
|
||||
{
|
||||
// 句级时间
|
||||
string? pBegin = p.Attribute("begin")?.Value;
|
||||
string? pEnd = p.Attribute("end")?.Value;
|
||||
int pStartMs = ParseTtmlTime(pBegin);
|
||||
int pEndMs = ParseTtmlTime(pEnd);
|
||||
|
||||
// 处理分词分时
|
||||
var spans = p.Elements()
|
||||
.Where(s =>
|
||||
s.Name.LocalName == "span"
|
||||
&& s.Attribute(XName.Get("role", "http://www.w3.org/ns/ttml#metadata"))
|
||||
== null
|
||||
)
|
||||
.ToList();
|
||||
|
||||
string text = string.Concat(spans.Select(s => s.Value));
|
||||
var charTimings = new List<CharTiming>();
|
||||
|
||||
for (int i = 0; i < spans.Count; i++)
|
||||
{
|
||||
var span = spans[i];
|
||||
string? sBegin = span.Attribute("begin")?.Value;
|
||||
string? sEnd = span.Attribute("end")?.Value;
|
||||
int sStartMs = ParseTtmlTime(sBegin);
|
||||
int sEndMs = ParseTtmlTime(sEnd);
|
||||
|
||||
if (sStartMs == 0 && sEndMs == 0)
|
||||
continue;
|
||||
|
||||
if (sEndMs == 0)
|
||||
sEndMs =
|
||||
(i + 1 < spans.Count)
|
||||
? ParseTtmlTime(spans[i + 1].Attribute("begin")?.Value)
|
||||
: pEndMs;
|
||||
|
||||
charTimings.Add(new CharTiming { StartMs = sStartMs, EndMs = sEndMs });
|
||||
}
|
||||
|
||||
if (spans.Count == 0)
|
||||
text = p.Value.Trim();
|
||||
|
||||
singleLangLyricsLine.Add(
|
||||
new LyricsLine
|
||||
{
|
||||
StartMs = pStartMs,
|
||||
EndMs = pEndMs,
|
||||
Text = text,
|
||||
CharTimings = charTimings,
|
||||
}
|
||||
);
|
||||
}
|
||||
PostProcessLyricsLines(singleLangLyricsLine);
|
||||
_multiLangLyricsLines.Add(singleLangLyricsLine);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 解析失败,忽略
|
||||
}
|
||||
}
|
||||
|
||||
private int ParseTtmlTime(string? t)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(t))
|
||||
return 0;
|
||||
|
||||
t = t.Trim();
|
||||
|
||||
// 支持 "1.000s"
|
||||
if (t.EndsWith("s"))
|
||||
{
|
||||
if (
|
||||
double.TryParse(
|
||||
t.TrimEnd('s'),
|
||||
System.Globalization.NumberStyles.Float,
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
out double seconds
|
||||
)
|
||||
)
|
||||
return (int)(seconds * 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
var parts = t.Split(':');
|
||||
if (parts.Length == 3)
|
||||
{
|
||||
// hh:mm:ss.xxx
|
||||
int h = int.Parse(parts[0]);
|
||||
int m = int.Parse(parts[1]);
|
||||
double s = double.Parse(
|
||||
parts[2],
|
||||
System.Globalization.CultureInfo.InvariantCulture
|
||||
);
|
||||
return (int)((h * 3600 + m * 60 + s) * 1000);
|
||||
}
|
||||
else if (parts.Length == 2)
|
||||
{
|
||||
// mm:ss.xxx
|
||||
int m = int.Parse(parts[0]);
|
||||
double s = double.Parse(
|
||||
parts[1],
|
||||
System.Globalization.CultureInfo.InvariantCulture
|
||||
);
|
||||
return (int)((m * 60 + s) * 1000);
|
||||
}
|
||||
else if (parts.Length == 1)
|
||||
{
|
||||
// ss.xxx
|
||||
if (
|
||||
double.TryParse(
|
||||
parts[0],
|
||||
System.Globalization.NumberStyles.Float,
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
out double s
|
||||
)
|
||||
)
|
||||
return (int)(s * 1000);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,6 @@ using Microsoft.UI.Xaml.Controls;
|
||||
namespace BetterLyrics.WinUI3.Messages
|
||||
{
|
||||
public class ShowNotificatonMessage(Notification value)
|
||||
: ValueChangedMessage<Notification>(value) { }
|
||||
: ValueChangedMessage<Notification>(value)
|
||||
{ }
|
||||
}
|
||||
|
||||
14
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/CharTiming.cs
Normal file
14
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/CharTiming.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public class CharTiming
|
||||
{
|
||||
public int StartMs { get; set; }
|
||||
public int EndMs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public partial class LocalLyricsFolder : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial string Path { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool IsEnabled { get; set; }
|
||||
|
||||
public LocalLyricsFolder() { }
|
||||
|
||||
public LocalLyricsFolder(string path, bool isEnabled)
|
||||
{
|
||||
Path = path;
|
||||
IsEnabled = isEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsData.cs
Normal file
16
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Models/LyricsData.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public class LyricsData
|
||||
{
|
||||
public int LanguageIndex { get; set; } = 0;
|
||||
|
||||
public List<LyricsLine> LyricsLines => MultiLangLyricsLines[LanguageIndex];
|
||||
public List<List<LyricsLine>> MultiLangLyricsLines { get; set; } = [];
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public class LyricsLine
|
||||
{
|
||||
public List<string> Texts { get; set; } = [];
|
||||
public string Text { get; set; } = "";
|
||||
|
||||
public int LanguageIndex { get; set; } = 0;
|
||||
public List<CharTiming> CharTimings { get; set; } = [];
|
||||
|
||||
public string Text => Texts[LanguageIndex];
|
||||
|
||||
public int StartPlayingTimestampMs { get; set; }
|
||||
public int EndPlayingTimestampMs { get; set; }
|
||||
public int StartMs { get; set; }
|
||||
public int EndMs { get; set; }
|
||||
|
||||
public LyricsPlayingState PlayingState { get; set; }
|
||||
|
||||
public int DurationMs => EndPlayingTimestampMs - StartPlayingTimestampMs;
|
||||
public int DurationMs => EndMs - StartMs;
|
||||
|
||||
public float EnteringProgress { get; set; }
|
||||
|
||||
@@ -37,10 +36,10 @@ namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
return new LyricsLine
|
||||
{
|
||||
Texts = new List<string>(this.Texts),
|
||||
LanguageIndex = this.LanguageIndex,
|
||||
StartPlayingTimestampMs = this.StartPlayingTimestampMs,
|
||||
EndPlayingTimestampMs = this.EndPlayingTimestampMs,
|
||||
Text = this.Text,
|
||||
CharTimings = this.CharTimings,
|
||||
StartMs = this.StartMs,
|
||||
EndMs = this.EndMs,
|
||||
PlayingState = this.PlayingState,
|
||||
EnteringProgress = this.EnteringProgress,
|
||||
ExitingProgress = this.ExitingProgress,
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public partial class LyricsSearchProviderInfo : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial LyricsSearchProvider Provider { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool IsEnabled { get; set; }
|
||||
|
||||
public LyricsSearchProviderInfo() { }
|
||||
|
||||
public LyricsSearchProviderInfo(LyricsSearchProvider provider, bool isEnabled)
|
||||
{
|
||||
Provider = provider;
|
||||
IsEnabled = isEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using SQLite;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public class MetadataIndex
|
||||
{
|
||||
[PrimaryKey]
|
||||
public string? Path { get; set; }
|
||||
public string? Title { get; set; }
|
||||
public string? Artist { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,19 +12,19 @@ namespace BetterLyrics.WinUI3.Models
|
||||
public partial class Notification : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private InfoBarSeverity _severity;
|
||||
public partial InfoBarSeverity Severity { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _message;
|
||||
public partial string? Message { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _isForeverDismissable;
|
||||
public partial bool IsForeverDismissable { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private Visibility _visibility;
|
||||
public partial Visibility Visibility { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _relatedSettingsKeyName;
|
||||
public partial string? RelatedSettingsKeyName { get; set; }
|
||||
|
||||
public Notification(
|
||||
string? message = null,
|
||||
|
||||
@@ -1,106 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using ATL;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Microsoft.UI;
|
||||
using Windows.UI;
|
||||
using static ATL.LyricsInfo;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Models
|
||||
{
|
||||
public partial class SongInfo : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial string? Title { get; set; }
|
||||
public partial string Title { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string? Artist { get; set; }
|
||||
public partial string Artist { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial ObservableCollection<string>? FilesFound { get; set; }
|
||||
public partial string? Album { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// In milliseconds
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
public partial bool IsLyricsExisted { get; set; } = false;
|
||||
public partial double? DurationMs { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string? SourceAppUserModelId { get; set; } = null;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial List<LyricsLine>? LyricsLines { get; set; } = null;
|
||||
public byte[]? AlbumArt { get; set; } = null;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial List<Color>? CoverImageDominantColors { get; set; } = null;
|
||||
|
||||
public SongInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// Try to parse lyrics from the track, optionally override the raw lyrics string.
|
||||
/// </summary>
|
||||
/// <param name="track"></param>
|
||||
/// <param name="overrideRaw"></param>
|
||||
public void ParseLyrics(Track track, string? overrideRaw = null)
|
||||
{
|
||||
List<LyricsLine>? result = null;
|
||||
|
||||
if (overrideRaw != null)
|
||||
track.Lyrics.ParseLRC(overrideRaw);
|
||||
|
||||
var lyricsPhrases = track.Lyrics.SynchronizedLyrics;
|
||||
|
||||
if (lyricsPhrases?.Count > 0)
|
||||
{
|
||||
if (lyricsPhrases[0].TimestampMs > 0)
|
||||
{
|
||||
var placeholder = new LyricsPhrase(0, $"{track.Artist} - {track.Title}");
|
||||
lyricsPhrases.Insert(0, placeholder);
|
||||
lyricsPhrases.Insert(0, placeholder);
|
||||
}
|
||||
}
|
||||
|
||||
LyricsLine? lyricsLine = null;
|
||||
|
||||
for (int i = 0; i < lyricsPhrases?.Count; i++)
|
||||
{
|
||||
var lyricsPhrase = lyricsPhrases[i];
|
||||
int startTimestampMs = lyricsPhrase.TimestampMs;
|
||||
int endTimestampMs;
|
||||
|
||||
if (i + 1 < lyricsPhrases.Count)
|
||||
{
|
||||
endTimestampMs = lyricsPhrases[i + 1].TimestampMs;
|
||||
}
|
||||
else
|
||||
{
|
||||
endTimestampMs = (int)track.DurationMs;
|
||||
}
|
||||
|
||||
lyricsLine ??= new LyricsLine { StartPlayingTimestampMs = startTimestampMs };
|
||||
|
||||
lyricsLine.Texts.Add(lyricsPhrase.Text);
|
||||
|
||||
if (endTimestampMs == startTimestampMs)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lyricsLine.EndPlayingTimestampMs = endTimestampMs;
|
||||
result ??= [];
|
||||
result.Add(lyricsLine);
|
||||
lyricsLine = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != null && result.Count == 0)
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
|
||||
LyricsLines = result;
|
||||
IsLyricsExisted = result != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
x:Name="LyricsCanvas"
|
||||
Draw="LyricsCanvas_Draw"
|
||||
Loaded="LyricsCanvas_Loaded"
|
||||
Paused="{x:Bind ViewModel.IsPlaying, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
|
||||
Update="LyricsCanvas_Update" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BetterLyrics.WinUI3.Renderer
|
||||
Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedUpdateEventArgs args
|
||||
)
|
||||
{
|
||||
ViewModel.Calculate(sender, args);
|
||||
ViewModel.Update(sender, args);
|
||||
}
|
||||
|
||||
private void LyricsCanvas_Loaded(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Serialization
|
||||
{
|
||||
[JsonSerializable(typeof(List<LyricsSearchProviderInfo>))]
|
||||
[JsonSerializable(typeof(List<LocalLyricsFolder>))]
|
||||
[JsonSerializable(typeof(List<string>))]
|
||||
[JsonSerializable(typeof(JsonElement))]
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
internal partial class SourceGenerationContext : JsonSerializerContext { }
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ATL;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using SQLite;
|
||||
using Ude;
|
||||
using Windows.Media.Control;
|
||||
using Windows.Storage.Streams;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Database
|
||||
{
|
||||
public class DatabaseService : IDatabaseService
|
||||
{
|
||||
private readonly SQLiteConnection _connection;
|
||||
|
||||
private readonly CharsetDetector _charsetDetector = new();
|
||||
|
||||
public DatabaseService()
|
||||
{
|
||||
_connection = new SQLiteConnection(AppInfo.DatabasePath);
|
||||
if (_connection.GetTableInfo("MetadataIndex").Count == 0)
|
||||
{
|
||||
_connection.CreateTable<MetadataIndex>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RebuildDatabaseAsync(IList<string> paths)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
_connection.DeleteAll<MetadataIndex>();
|
||||
|
||||
HashSet<string> insertedPaths = new();
|
||||
|
||||
foreach (var path in paths)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
foreach (
|
||||
var file in Directory.GetFiles(path, "*.*", SearchOption.AllDirectories)
|
||||
)
|
||||
{
|
||||
if (!insertedPaths.Contains(file))
|
||||
{
|
||||
var track = new Track(file);
|
||||
_connection.Insert(
|
||||
new MetadataIndex
|
||||
{
|
||||
Path = file,
|
||||
Title = track.Title,
|
||||
Artist = track.Artist,
|
||||
}
|
||||
);
|
||||
insertedPaths.Add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<SongInfo> FindSongInfoAsync(
|
||||
GlobalSystemMediaTransportControlsSessionMediaProperties? mediaProps
|
||||
)
|
||||
{
|
||||
if (mediaProps == null || mediaProps.Title == null || mediaProps.Artist == null)
|
||||
return new();
|
||||
|
||||
var songInfo = new SongInfo { Title = mediaProps?.Title, Artist = mediaProps?.Artist };
|
||||
|
||||
// App.ResourceLoader!.GetString("MainPageNoLocalFilesMatched");
|
||||
|
||||
if (mediaProps?.Thumbnail is IRandomAccessStreamReference streamReference)
|
||||
{
|
||||
songInfo.AlbumArt = await ImageHelper.ToByteArrayAsync(streamReference);
|
||||
}
|
||||
|
||||
return await FindSongInfoAsync(songInfo, mediaProps!.Title, mediaProps!.Artist);
|
||||
}
|
||||
|
||||
public async Task<SongInfo> FindSongInfoAsync(
|
||||
SongInfo initSongInfo,
|
||||
string searchTitle,
|
||||
string searchArtist
|
||||
)
|
||||
{
|
||||
var founds = _connection
|
||||
.Table<MetadataIndex>()
|
||||
// Look up by Title and Artist (these two props were fetched by reading metadata in music file befoe) first
|
||||
// then by Path (music file name usually contains song name and artist so this can be a second way to look up for)
|
||||
// Please note for .lrc file, only the second way works for it
|
||||
.Where(m =>
|
||||
(
|
||||
m.Title != null
|
||||
&& m.Artist != null
|
||||
&& m.Title.Contains(searchTitle)
|
||||
&& m.Artist.Contains(searchArtist)
|
||||
)
|
||||
|| (
|
||||
m.Path != null
|
||||
&& m.Path.Contains(searchTitle)
|
||||
&& m.Path.Contains(searchArtist)
|
||||
)
|
||||
)
|
||||
.ToList();
|
||||
|
||||
foreach (var found in founds)
|
||||
{
|
||||
initSongInfo.FilesFound ??= [];
|
||||
initSongInfo.FilesFound.Add(found.Path!);
|
||||
if (initSongInfo.LyricsLines == null || initSongInfo.AlbumArt == null)
|
||||
{
|
||||
Track track = new(found.Path);
|
||||
initSongInfo.ParseLyrics(track);
|
||||
// Successfully parse lyrics info from metadata in music file
|
||||
if (initSongInfo.LyricsLines != null)
|
||||
{
|
||||
// Used as lyrics source
|
||||
}
|
||||
// Find lyrics file
|
||||
if (initSongInfo.LyricsLines == null && found?.Path?.EndsWith(".lrc") == true)
|
||||
{
|
||||
using (FileStream fs = File.OpenRead(found.Path))
|
||||
{
|
||||
_charsetDetector.Feed(fs);
|
||||
_charsetDetector.DataEnd();
|
||||
}
|
||||
|
||||
string content;
|
||||
if (_charsetDetector.Charset != null)
|
||||
{
|
||||
Encoding encoding = Encoding.GetEncoding(_charsetDetector.Charset);
|
||||
content = File.ReadAllText(found.Path, encoding);
|
||||
}
|
||||
else
|
||||
{
|
||||
content = File.ReadAllText(found.Path, Encoding.UTF8);
|
||||
}
|
||||
initSongInfo.ParseLyrics(track, content);
|
||||
// Used as lyrics source
|
||||
}
|
||||
|
||||
// Finf album art
|
||||
if (initSongInfo.AlbumArt == null)
|
||||
{
|
||||
if (track.EmbeddedPictures.Count > 0)
|
||||
{
|
||||
initSongInfo.AlbumArt = track.EmbeddedPictures[0].PictureData;
|
||||
// Used as album art source
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (initSongInfo.AlbumArt == null)
|
||||
{
|
||||
initSongInfo.CoverImageDominantColors = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
initSongInfo.CoverImageDominantColors = await ImageHelper.GetAccentColorsFromByte(
|
||||
initSongInfo.AlbumArt
|
||||
);
|
||||
}
|
||||
|
||||
if (initSongInfo.LyricsLines == null) { }
|
||||
|
||||
return initSongInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using Windows.Media.Control;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Database
|
||||
{
|
||||
public interface IDatabaseService
|
||||
{
|
||||
Task RebuildDatabaseAsync(IList<string> paths);
|
||||
|
||||
Task<SongInfo> FindSongInfoAsync(
|
||||
GlobalSystemMediaTransportControlsSessionMediaProperties? mediaProps
|
||||
);
|
||||
|
||||
Task<SongInfo> FindSongInfoAsync(
|
||||
SongInfo initSongInfo,
|
||||
string searchTitle,
|
||||
string searchArtist
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Events;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public interface ILibWatcherService
|
||||
{
|
||||
event EventHandler<LibChangedEventArgs>? MusicLibraryFilesChanged;
|
||||
public void UpdateWatchers(List<LocalLyricsFolder> folders);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public interface IMusicSearchService
|
||||
{
|
||||
Task<(string?, LyricsFormat?)> SearchLyricsAsync(
|
||||
string title,
|
||||
string artist,
|
||||
string album = "",
|
||||
double durationMs = 0.0,
|
||||
MusicSearchMatchMode matchMode = MusicSearchMatchMode.TitleAndArtist
|
||||
);
|
||||
|
||||
byte[]? SearchAlbumArtAsync(string title, string artist);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using BetterLyrics.WinUI3.Events;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Playback
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public interface IPlaybackService
|
||||
{
|
||||
@@ -10,7 +10,6 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
event EventHandler<IsPlayingChangedEventArgs>? IsPlayingChanged;
|
||||
event EventHandler<PositionChangedEventArgs>? PositionChanged;
|
||||
|
||||
void ReSendingMessages();
|
||||
SongInfo? SongInfo { get; }
|
||||
bool IsPlaying { get; }
|
||||
TimeSpan Position { get; }
|
||||
@@ -1,17 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using Microsoft.UI.Text;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Windows.UI.Text;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Settings
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public interface ISettingsService
|
||||
{
|
||||
bool IsFirstRun { get; set; }
|
||||
|
||||
// Lyrics lib
|
||||
List<string> MusicLibraries { get; set; }
|
||||
List<LocalLyricsFolder> LocalLyricsFolders { get; set; }
|
||||
List<LyricsSearchProviderInfo> LyricsSearchProvidersInfo { get; set; }
|
||||
|
||||
// App appearance
|
||||
ElementTheme ThemeType { get; set; }
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using global::BetterLyrics.WinUI3.Events;
|
||||
using global::BetterLyrics.WinUI3.Models;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public class LibWatcherService : IDisposable, ILibWatcherService
|
||||
{
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly Dictionary<string, FileSystemWatcher> _watchers = [];
|
||||
|
||||
public event EventHandler<LibChangedEventArgs>? MusicLibraryFilesChanged;
|
||||
|
||||
public LibWatcherService(ISettingsService settingsService)
|
||||
{
|
||||
_settingsService = settingsService;
|
||||
UpdateWatchers(_settingsService.LocalLyricsFolders);
|
||||
}
|
||||
|
||||
public void UpdateWatchers(List<LocalLyricsFolder> folders)
|
||||
{
|
||||
// 移除不再监听的
|
||||
foreach (var key in _watchers.Keys.ToList())
|
||||
{
|
||||
if (!folders.Any(x => x.Path == key && x.IsEnabled))
|
||||
{
|
||||
_watchers[key].Dispose();
|
||||
_watchers.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加新的监听
|
||||
foreach (var folder in folders)
|
||||
{
|
||||
if (
|
||||
!_watchers.ContainsKey(folder.Path)
|
||||
&& Directory.Exists(folder.Path)
|
||||
&& folder.IsEnabled
|
||||
)
|
||||
{
|
||||
var watcher = new FileSystemWatcher(folder.Path)
|
||||
{
|
||||
IncludeSubdirectories = true,
|
||||
EnableRaisingEvents = true,
|
||||
};
|
||||
watcher.Created += (s, e) => OnChanged(folder.Path, e);
|
||||
watcher.Changed += (s, e) => OnChanged(folder.Path, e);
|
||||
watcher.Deleted += (s, e) => OnChanged(folder.Path, e);
|
||||
watcher.Renamed += (s, e) => OnChanged(folder.Path, e);
|
||||
_watchers[folder.Path] = watcher;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnChanged(string folder, FileSystemEventArgs e)
|
||||
{
|
||||
App.DispatcherQueue!.TryEnqueue(
|
||||
Microsoft.UI.Dispatching.DispatcherQueuePriority.High,
|
||||
() =>
|
||||
{
|
||||
MusicLibraryFilesChanged?.Invoke(
|
||||
this,
|
||||
new LibChangedEventArgs(folder, e.FullPath, e.ChangeType)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var watcher in _watchers.Values)
|
||||
{
|
||||
watcher.Dispose();
|
||||
}
|
||||
_watchers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,354 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using ATL;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using Windows.Storage;
|
||||
using Windows.Storage.FileProperties;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public class MusicSearchService : IMusicSearchService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly ISettingsService _settingsService;
|
||||
|
||||
public MusicSearchService(ISettingsService settingsService)
|
||||
{
|
||||
_settingsService = settingsService;
|
||||
_httpClient = new HttpClient();
|
||||
_httpClient.DefaultRequestHeaders.Add(
|
||||
"User-Agent",
|
||||
$"{AppInfo.AppName} {AppInfo.AppVersion} ({AppInfo.GithubUrl})"
|
||||
);
|
||||
}
|
||||
|
||||
public byte[]? SearchAlbumArtAsync(string title, string artist)
|
||||
{
|
||||
foreach (var folder in _settingsService.LocalLyricsFolders)
|
||||
{
|
||||
if (Directory.Exists(folder.Path) && folder.IsEnabled)
|
||||
{
|
||||
foreach (
|
||||
var file in Directory.GetFiles(
|
||||
folder.Path,
|
||||
$"*.*",
|
||||
SearchOption.AllDirectories
|
||||
)
|
||||
)
|
||||
{
|
||||
if (FuzzyMatch(Path.GetFileNameWithoutExtension(file), title, artist))
|
||||
{
|
||||
Track track = new(file);
|
||||
var bytes = track.EmbeddedPictures.FirstOrDefault()?.PictureData;
|
||||
if (bytes != null)
|
||||
{
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<(string?, LyricsFormat?)> SearchLyricsAsync(
|
||||
string title,
|
||||
string artist,
|
||||
string album = "",
|
||||
double durationMs = 0.0,
|
||||
MusicSearchMatchMode matchMode = MusicSearchMatchMode.TitleAndArtist
|
||||
)
|
||||
{
|
||||
foreach (var provider in _settingsService.LyricsSearchProvidersInfo)
|
||||
{
|
||||
if (!provider.IsEnabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (provider.Provider)
|
||||
{
|
||||
case LyricsSearchProvider.LrcLib:
|
||||
// Check cache first
|
||||
var cachedLyrics = ReadCache(title, artist, LyricsFormat.Lrc);
|
||||
if (!string.IsNullOrWhiteSpace(cachedLyrics))
|
||||
{
|
||||
return (cachedLyrics, LyricsFormat.Lrc);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
string? searchedLyrics = null;
|
||||
|
||||
switch (provider.Provider)
|
||||
{
|
||||
case LyricsSearchProvider.LocalMusicFile:
|
||||
searchedLyrics = LocalLyricsSearchInMusicFiles(title, artist);
|
||||
break;
|
||||
case LyricsSearchProvider.LocalLrcFile:
|
||||
searchedLyrics = await LocalLyricsSearchInLyricsFiles(
|
||||
title,
|
||||
artist,
|
||||
LyricsFormat.Lrc
|
||||
);
|
||||
break;
|
||||
case LyricsSearchProvider.LocalEslrcFile:
|
||||
searchedLyrics = await LocalLyricsSearchInLyricsFiles(
|
||||
title,
|
||||
artist,
|
||||
LyricsFormat.Eslrc
|
||||
);
|
||||
break;
|
||||
case LyricsSearchProvider.LocalTtmlFile:
|
||||
searchedLyrics = await LocalLyricsSearchInLyricsFiles(
|
||||
title,
|
||||
artist,
|
||||
LyricsFormat.Ttml
|
||||
);
|
||||
break;
|
||||
case LyricsSearchProvider.LrcLib:
|
||||
searchedLyrics = await SearchLrcLib(
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
(int)(durationMs / 1000),
|
||||
matchMode
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchedLyrics))
|
||||
{
|
||||
switch (provider.Provider)
|
||||
{
|
||||
case LyricsSearchProvider.LrcLib:
|
||||
WriteCache(title, artist, searchedLyrics, LyricsFormat.Lrc);
|
||||
return (searchedLyrics, LyricsFormat.Lrc);
|
||||
case LyricsSearchProvider.LocalMusicFile:
|
||||
return (searchedLyrics, LyricsFormatExtensions.Detect(searchedLyrics));
|
||||
case LyricsSearchProvider.LocalLrcFile:
|
||||
return (searchedLyrics, LyricsFormat.Lrc);
|
||||
case LyricsSearchProvider.LocalEslrcFile:
|
||||
return (searchedLyrics, LyricsFormat.Eslrc);
|
||||
case LyricsSearchProvider.LocalTtmlFile:
|
||||
return (searchedLyrics, LyricsFormat.Ttml);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
private static int LevenshteinDistance(string a, string b)
|
||||
{
|
||||
if (string.IsNullOrEmpty(a))
|
||||
return b.Length;
|
||||
if (string.IsNullOrEmpty(b))
|
||||
return a.Length;
|
||||
int[,] d = new int[a.Length + 1, b.Length + 1];
|
||||
for (int i = 0; i <= a.Length; i++)
|
||||
d[i, 0] = i;
|
||||
for (int j = 0; j <= b.Length; j++)
|
||||
d[0, j] = j;
|
||||
for (int i = 1; i <= a.Length; i++)
|
||||
for (int j = 1; j <= b.Length; j++)
|
||||
d[i, j] = Math.Min(
|
||||
Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1),
|
||||
d[i - 1, j - 1] + (a[i - 1] == b[j - 1] ? 0 : 1)
|
||||
);
|
||||
return d[a.Length, b.Length];
|
||||
}
|
||||
|
||||
// 判断相似度
|
||||
private static bool FuzzyMatch(string fileName, string title, string artist)
|
||||
{
|
||||
var normFile = Normalize(fileName);
|
||||
var normTarget1 = Normalize(title + artist);
|
||||
var normTarget2 = Normalize(artist + title);
|
||||
|
||||
int dist1 = LevenshteinDistance(normFile, normTarget1);
|
||||
int dist2 = LevenshteinDistance(normFile, normTarget2);
|
||||
|
||||
return dist1 <= 3 || dist2 <= 3; // 阈值可调整
|
||||
}
|
||||
|
||||
private static string Normalize(string s)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(s))
|
||||
return "";
|
||||
var sb = new StringBuilder();
|
||||
foreach (var c in s.ToLowerInvariant())
|
||||
{
|
||||
if (char.IsLetterOrDigit(c))
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string? LocalLyricsSearchInMusicFiles(string title, string artist)
|
||||
{
|
||||
foreach (var folder in _settingsService.LocalLyricsFolders)
|
||||
{
|
||||
if (Directory.Exists(folder.Path) && folder.IsEnabled)
|
||||
{
|
||||
foreach (
|
||||
var file in Directory.GetFiles(
|
||||
folder.Path,
|
||||
$"*.*",
|
||||
SearchOption.AllDirectories
|
||||
)
|
||||
)
|
||||
{
|
||||
if (FuzzyMatch(Path.GetFileNameWithoutExtension(file), title, artist))
|
||||
{
|
||||
//Track track = new(file);
|
||||
//var plain = track.Lyrics.UnsynchronizedLyrics;
|
||||
|
||||
try
|
||||
{
|
||||
var plain = TagLib.File.Create(file).Tag.Lyrics;
|
||||
if (plain != null && plain != string.Empty)
|
||||
{
|
||||
return plain;
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<string?> LocalLyricsSearchInLyricsFiles(
|
||||
string title,
|
||||
string artist,
|
||||
LyricsFormat format
|
||||
)
|
||||
{
|
||||
foreach (var folder in _settingsService.LocalLyricsFolders)
|
||||
{
|
||||
if (Directory.Exists(folder.Path) && folder.IsEnabled)
|
||||
{
|
||||
foreach (
|
||||
var file in Directory.GetFiles(
|
||||
folder.Path,
|
||||
$"*{format.ToFileExtension()}",
|
||||
SearchOption.AllDirectories
|
||||
)
|
||||
)
|
||||
{
|
||||
if (FuzzyMatch(Path.GetFileNameWithoutExtension(file), title, artist))
|
||||
{
|
||||
string? raw = await File.ReadAllTextAsync(
|
||||
file,
|
||||
FileHelper.GetEncoding(file)
|
||||
);
|
||||
if (raw != null)
|
||||
{
|
||||
return raw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<string?> SearchLrcLib(
|
||||
string title,
|
||||
string artist,
|
||||
string album,
|
||||
int duration,
|
||||
MusicSearchMatchMode matchMode
|
||||
)
|
||||
{
|
||||
// Build API query URL
|
||||
var url =
|
||||
$"https://lrclib.net/api/search?"
|
||||
+ $"track_name={Uri.EscapeDataString(title)}&"
|
||||
+ $"artist_name={Uri.EscapeDataString(artist)}";
|
||||
|
||||
if (matchMode == MusicSearchMatchMode.TitleArtistAlbumAndDuration)
|
||||
{
|
||||
url +=
|
||||
$"&album_name={Uri.EscapeDataString(album)}"
|
||||
+ $"&durationMs={Uri.EscapeDataString(duration.ToString())}";
|
||||
}
|
||||
|
||||
var response = await _httpClient.GetAsync(url);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var json = await response.Content.ReadAsStringAsync();
|
||||
|
||||
var jArr = JsonSerializer.Deserialize(
|
||||
json,
|
||||
Serialization.SourceGenerationContext.Default.JsonElement
|
||||
);
|
||||
if (jArr.ValueKind == JsonValueKind.Array && jArr.GetArrayLength() > 0)
|
||||
{
|
||||
var first = jArr[0];
|
||||
var syncedLyrics = first.GetProperty("syncedLyrics").GetString();
|
||||
var result = string.IsNullOrWhiteSpace(syncedLyrics) ? null : syncedLyrics;
|
||||
if (!string.IsNullOrWhiteSpace(result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void WriteCache(string title, string artist, string lyrics, LyricsFormat format)
|
||||
{
|
||||
var safeArtist = SanitizeFileName(artist);
|
||||
var safeTitle = SanitizeFileName(title);
|
||||
var cacheFilePath = Path.Combine(
|
||||
AppInfo.OnlineLyricsCacheDirectory,
|
||||
$"{safeArtist} - {safeTitle}{format.ToFileExtension()}"
|
||||
);
|
||||
File.WriteAllText(cacheFilePath, lyrics);
|
||||
}
|
||||
|
||||
private string? ReadCache(string title, string artist, LyricsFormat format)
|
||||
{
|
||||
var safeArtist = SanitizeFileName(artist);
|
||||
var safeTitle = SanitizeFileName(title);
|
||||
var cacheFilePath = Path.Combine(
|
||||
AppInfo.OnlineLyricsCacheDirectory,
|
||||
$"{safeArtist} - {safeTitle}{format.ToFileExtension()}"
|
||||
);
|
||||
if (File.Exists(cacheFilePath))
|
||||
{
|
||||
return File.ReadAllText(cacheFilePath);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string SanitizeFileName(string fileName, char replacement = '_')
|
||||
{
|
||||
var invalidChars = Path.GetInvalidFileNameChars();
|
||||
var sb = new StringBuilder(fileName.Length);
|
||||
foreach (var c in fileName)
|
||||
{
|
||||
sb.Append(Array.IndexOf(invalidChars, c) >= 0 ? replacement : c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,20 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ATL;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Events;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Services.Database;
|
||||
using CommunityToolkit.WinUI;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.Media.Control;
|
||||
using Windows.Storage.Streams;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Playback
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public partial class PlaybackService : IPlaybackService
|
||||
{
|
||||
@@ -26,23 +31,17 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
public bool IsPlaying { get; private set; }
|
||||
public TimeSpan Position { get; private set; }
|
||||
|
||||
private readonly IDatabaseService _databaseService;
|
||||
private readonly IMusicSearchService _musicSearchService;
|
||||
|
||||
public PlaybackService(IDatabaseService databaseService)
|
||||
public PlaybackService(
|
||||
ISettingsService settingsService,
|
||||
IMusicSearchService musicSearchService
|
||||
)
|
||||
{
|
||||
_databaseService = databaseService;
|
||||
_musicSearchService = musicSearchService;
|
||||
InitMediaManager().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
private async Task<SongInfo> GetSongInfoAsync()
|
||||
{
|
||||
var songInfo = await _databaseService.FindSongInfoAsync(
|
||||
await _currentSession?.TryGetMediaPropertiesAsync()
|
||||
);
|
||||
songInfo.SourceAppUserModelId = _currentSession?.SourceAppUserModelId;
|
||||
return songInfo;
|
||||
}
|
||||
|
||||
private async Task InitMediaManager()
|
||||
{
|
||||
_sessionManager = await GlobalSystemMediaTransportControlsSessionManager.RequestAsync();
|
||||
@@ -51,14 +50,6 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
SessionManager_CurrentSessionChanged(_sessionManager, null);
|
||||
}
|
||||
|
||||
public void ReSendingMessages()
|
||||
{
|
||||
// Re-send messages to update UI
|
||||
CurrentSession_MediaPropertiesChanged(_currentSession, null);
|
||||
CurrentSession_PlaybackInfoChanged(_currentSession, null);
|
||||
CurrentSession_TimelinePropertiesChanged(_currentSession, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Note: Non-UI thread
|
||||
/// </summary>
|
||||
@@ -94,10 +85,13 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
break;
|
||||
}
|
||||
}
|
||||
_dispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
IsPlayingChanged?.Invoke(this, new IsPlayingChangedEventArgs(IsPlaying));
|
||||
});
|
||||
_dispatcherQueue.TryEnqueue(
|
||||
DispatcherQueuePriority.High,
|
||||
() =>
|
||||
{
|
||||
IsPlayingChanged?.Invoke(this, new IsPlayingChangedEventArgs(IsPlaying));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void SessionManager_CurrentSessionChanged(
|
||||
@@ -126,7 +120,9 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
CurrentSession_TimelinePropertiesChanged;
|
||||
}
|
||||
|
||||
ReSendingMessages();
|
||||
CurrentSession_MediaPropertiesChanged(_currentSession, null);
|
||||
CurrentSession_PlaybackInfoChanged(_currentSession, null);
|
||||
CurrentSession_TimelinePropertiesChanged(_currentSession, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -134,31 +130,78 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
private void CurrentSession_MediaPropertiesChanged(
|
||||
private async void CurrentSession_MediaPropertiesChanged(
|
||||
GlobalSystemMediaTransportControlsSession? sender,
|
||||
MediaPropertiesChangedEventArgs? args
|
||||
)
|
||||
{
|
||||
App.DispatcherQueueTimer!.Debounce(
|
||||
async () =>
|
||||
GlobalSystemMediaTransportControlsSessionMediaProperties? mediaProps = null;
|
||||
if (sender == null)
|
||||
{
|
||||
SongInfo = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// _logger.LogDebug("CurrentSession_MediaPropertiesChanged");
|
||||
if (sender == null)
|
||||
SongInfo = null;
|
||||
mediaProps = await sender.TryGetMediaPropertiesAsync();
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
if (mediaProps == null)
|
||||
{
|
||||
SongInfo = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SongInfo = new SongInfo
|
||||
{
|
||||
Title = mediaProps.Title,
|
||||
Artist = mediaProps.Artist,
|
||||
Album = mediaProps?.AlbumTitle ?? string.Empty,
|
||||
DurationMs = _currentSession
|
||||
?.GetTimelineProperties()
|
||||
.EndTime.TotalMilliseconds,
|
||||
SourceAppUserModelId = _currentSession?.SourceAppUserModelId,
|
||||
};
|
||||
|
||||
if (
|
||||
SongInfo.SourceAppUserModelId?.Contains(Package.Current.Id.FamilyName)
|
||||
?? false
|
||||
)
|
||||
{
|
||||
SongInfo.Title = "甜度爆表";
|
||||
SongInfo.Artist = "AI";
|
||||
}
|
||||
|
||||
if (mediaProps?.Thumbnail is IRandomAccessStreamReference streamReference)
|
||||
{
|
||||
SongInfo.AlbumArt = await ImageHelper.ToByteArrayAsync(streamReference);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
SongInfo.AlbumArt = _musicSearchService.SearchAlbumArtAsync(
|
||||
SongInfo.Title,
|
||||
SongInfo.Artist
|
||||
);
|
||||
|
||||
if (SongInfo.AlbumArt == null)
|
||||
{
|
||||
SongInfo = await GetSongInfoAsync();
|
||||
SongInfo.AlbumArt = await ImageHelper.CreateTextPlaceholderBytesAsync(
|
||||
$"{SongInfo.Artist} - {SongInfo.Title}",
|
||||
400,
|
||||
400
|
||||
);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
_dispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
SongInfoChanged?.Invoke(this, new SongInfoChangedEventArgs(SongInfo));
|
||||
});
|
||||
},
|
||||
TimeSpan.FromMilliseconds(AnimationHelper.DebounceDefaultDuration)
|
||||
}
|
||||
}
|
||||
_dispatcherQueue.TryEnqueue(
|
||||
DispatcherQueuePriority.High,
|
||||
() =>
|
||||
{
|
||||
SongInfoChanged?.Invoke(this, new SongInfoChangedEventArgs(SongInfo));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -175,10 +218,13 @@ namespace BetterLyrics.WinUI3.Services.Playback
|
||||
{
|
||||
Position = sender.GetTimelineProperties().Position;
|
||||
}
|
||||
_dispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
PositionChanged?.Invoke(this, new PositionChangedEventArgs(Position));
|
||||
});
|
||||
_dispatcherQueue.TryEnqueue(
|
||||
DispatcherQueuePriority.High,
|
||||
() =>
|
||||
{
|
||||
PositionChanged?.Invoke(this, new PositionChangedEventArgs(Position));
|
||||
}
|
||||
);
|
||||
// _logger.LogDebug(_currentTime);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,13 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Serialization;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Newtonsoft.Json;
|
||||
using Windows.Media;
|
||||
using Windows.Storage;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Services.Settings
|
||||
namespace BetterLyrics.WinUI3.Services
|
||||
{
|
||||
public class SettingsService : ISettingsService
|
||||
{
|
||||
@@ -17,10 +15,13 @@ namespace BetterLyrics.WinUI3.Services.Settings
|
||||
|
||||
private const string IsFirstRunKey = "IsFirstRun";
|
||||
|
||||
// Lyrics lib
|
||||
private const string LocalLyricsFoldersKey = "LocalLyricsFolders";
|
||||
private const string LyricsSearchProvidersInfoKey = "LyricsSearchProvidersInfo";
|
||||
|
||||
// App appearance
|
||||
private const string ThemeTypeKey = "ThemeType";
|
||||
private const string LanguageKey = "Language";
|
||||
private const string MusicLibrariesKey = "MusicLibraries";
|
||||
private const string BackdropTypeKey = "BackdropType";
|
||||
|
||||
// App behavior
|
||||
@@ -49,6 +50,39 @@ namespace BetterLyrics.WinUI3.Services.Settings
|
||||
get => GetValue<bool>(IsFirstRunKey);
|
||||
set => SetValue(IsFirstRunKey, value);
|
||||
}
|
||||
public List<LocalLyricsFolder> LocalLyricsFolders
|
||||
{
|
||||
get =>
|
||||
System.Text.Json.JsonSerializer.Deserialize(
|
||||
GetValue<string>(LocalLyricsFoldersKey) ?? "[]",
|
||||
SourceGenerationContext.Default.ListLocalLyricsFolder
|
||||
)!;
|
||||
set =>
|
||||
SetValue(
|
||||
LocalLyricsFoldersKey,
|
||||
System.Text.Json.JsonSerializer.Serialize(
|
||||
value,
|
||||
SourceGenerationContext.Default.ListLocalLyricsFolder
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public List<LyricsSearchProviderInfo> LyricsSearchProvidersInfo
|
||||
{
|
||||
get =>
|
||||
System.Text.Json.JsonSerializer.Deserialize(
|
||||
GetValue<string>(LyricsSearchProvidersInfoKey) ?? "[]",
|
||||
SourceGenerationContext.Default.ListLyricsSearchProviderInfo
|
||||
)!;
|
||||
set =>
|
||||
SetValue(
|
||||
LyricsSearchProvidersInfoKey,
|
||||
System.Text.Json.JsonSerializer.Serialize(
|
||||
value,
|
||||
SourceGenerationContext.Default.ListLyricsSearchProviderInfo
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public ElementTheme ThemeType
|
||||
{
|
||||
@@ -74,15 +108,6 @@ namespace BetterLyrics.WinUI3.Services.Settings
|
||||
set => SetValue(AutoStartWindowTypeKey, (int)value);
|
||||
}
|
||||
|
||||
public List<string> MusicLibraries
|
||||
{
|
||||
get =>
|
||||
JsonConvert.DeserializeObject<List<string>>(
|
||||
GetValue<string>(MusicLibrariesKey) ?? "[]"
|
||||
)!;
|
||||
set => SetValue(MusicLibrariesKey, JsonConvert.SerializeObject(value));
|
||||
}
|
||||
|
||||
public bool IsCoverOverlayEnabled
|
||||
{
|
||||
get => GetValue<bool>(IsCoverOverlayEnabledKey);
|
||||
@@ -178,17 +203,39 @@ namespace BetterLyrics.WinUI3.Services.Settings
|
||||
_localSettings = ApplicationData.Current.LocalSettings;
|
||||
|
||||
SetDefault(IsFirstRunKey, true);
|
||||
// Lyrics lib
|
||||
SetDefault(LocalLyricsFoldersKey, "[]");
|
||||
SetDefault(
|
||||
LyricsSearchProvidersInfoKey,
|
||||
System.Text.Json.JsonSerializer.Serialize(
|
||||
Enum.GetValues<LyricsSearchProvider>()
|
||||
.Select(p => new LyricsSearchProviderInfo(p, true))
|
||||
.ToList(),
|
||||
SourceGenerationContext.Default.ListLyricsSearchProviderInfo
|
||||
)
|
||||
);
|
||||
if (LyricsSearchProvidersInfo.Count != Enum.GetValues<LyricsSearchProvider>().Length)
|
||||
{
|
||||
LyricsSearchProvidersInfo = Enum.GetValues<LyricsSearchProvider>()
|
||||
.Select(p => new LyricsSearchProviderInfo(
|
||||
p,
|
||||
LyricsSearchProvidersInfo
|
||||
.Where(x => x.Provider == p)
|
||||
.FirstOrDefault()
|
||||
?.IsEnabled ?? true
|
||||
))
|
||||
.ToList();
|
||||
}
|
||||
// App appearance
|
||||
SetDefault(ThemeTypeKey, (int)ElementTheme.Default);
|
||||
SetDefault(LanguageKey, (int)Language.FollowSystem);
|
||||
SetDefault(MusicLibrariesKey, "[]");
|
||||
SetDefault(BackdropTypeKey, (int)BackdropType.DesktopAcrylic);
|
||||
// App behavior
|
||||
SetDefault(AutoStartWindowTypeKey, (int)AutoStartWindowType.StandardMode);
|
||||
// Album art
|
||||
SetDefault(IsCoverOverlayEnabledKey, true);
|
||||
SetDefault(IsDynamicCoverOverlayEnabledKey, true);
|
||||
SetDefault(CoverOverlayOpacityKey, 100); // 100 % = 1.1
|
||||
SetDefault(CoverOverlayOpacityKey, 75); // 100 % = 1.0
|
||||
SetDefault(CoverOverlayBlurAmountKey, 200);
|
||||
SetDefault(TitleBarTypeKey, (int)TitleBarType.Compact);
|
||||
SetDefault(CoverImageRadiusKey, 24); // 24 %
|
||||
@@ -121,10 +121,7 @@
|
||||
<value>Local music libraries</value>
|
||||
</data>
|
||||
<data name="SettingsPageMusicLib.Description" xml:space="preserve">
|
||||
<value>Add folders storing music or lyrics to build lyrics index database</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenPath.Content" xml:space="preserve">
|
||||
<value>Open in file explorer</value>
|
||||
<value>Add folders storing music or lyrics</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenLogFolderButton.Content" xml:space="preserve">
|
||||
<value>Open in file explorer</value>
|
||||
@@ -294,18 +291,12 @@
|
||||
<data name="SettingsPageLyricsGlowEffectScope.Header" xml:space="preserve">
|
||||
<value>Glow effect scope</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabase.Header" xml:space="preserve">
|
||||
<value>Rebuild lyrics index database</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseButton.Content" xml:space="preserve">
|
||||
<value>Rebuild</value>
|
||||
<data name="SettingsPageLyricsSearchProvidersConfig.Header" xml:space="preserve">
|
||||
<value>Configure lyrics search providers</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolderButton.Content" xml:space="preserve">
|
||||
<value>Add</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseDesc.Text" xml:space="preserve">
|
||||
<value>Rebuilding the database, please wait...</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Title" xml:space="preserve">
|
||||
<value>Welcome to BetterLyrics</value>
|
||||
</data>
|
||||
@@ -468,4 +459,31 @@
|
||||
<data name="HostWindowSettingsFlyoutItem.Text" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsLoading.Text" xml:space="preserve">
|
||||
<value>Loading lyrics...</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalLrcFile" xml:space="preserve">
|
||||
<value>Local .LRC files</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalMusicFile" xml:space="preserve">
|
||||
<value>Local music files</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLrcLib" xml:space="preserve">
|
||||
<value>LRCLIB</value>
|
||||
</data>
|
||||
<data name="SettingsPageJA.Content" xml:space="preserve">
|
||||
<value>日本語</value>
|
||||
</data>
|
||||
<data name="SettingsPageKO.Content" xml:space="preserve">
|
||||
<value>한국어</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderEslrcFile" xml:space="preserve">
|
||||
<value>Local .ESLRC files</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderTtmlFile" xml:space="preserve">
|
||||
<value>Local .TTML files</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathIncludingOthersInfo" xml:space="preserve">
|
||||
<value>This folder contains added folders, please delete these folders to add the folder</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,489 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="SettingsPageMusicLib.Header" xml:space="preserve">
|
||||
<value>地元の音楽図書館</value>
|
||||
</data>
|
||||
<data name="SettingsPageMusicLib.Description" xml:space="preserve">
|
||||
<value>音楽や歌詞を保存するフォルダーを追加します</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenLogFolderButton.Content" xml:space="preserve">
|
||||
<value>ファイルエクスプローラーで開きます</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemovePath.Content" xml:space="preserve">
|
||||
<value>アプリから削除します</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemoveInfo.Title" xml:space="preserve">
|
||||
<value>次のアイテムを削除しても安全です</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemoveInfo.Message" xml:space="preserve">
|
||||
<value>このパスの元のファイルとフォルダーは、このアプリから削除するときに削除されません</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolder.Header" xml:space="preserve">
|
||||
<value>フォルダーを追加します</value>
|
||||
</data>
|
||||
<data name="SettingsPageTheme.Header" xml:space="preserve">
|
||||
<value>テーマ</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguage.Header" xml:space="preserve">
|
||||
<value>言語</value>
|
||||
</data>
|
||||
<data name="SettingsPageFollowSystem.Content" xml:space="preserve">
|
||||
<value>システムをフォローします</value>
|
||||
</data>
|
||||
<data name="SettingsPageLight.Content" xml:space="preserve">
|
||||
<value>ライト</value>
|
||||
</data>
|
||||
<data name="SettingsPageDark.Content" xml:space="preserve">
|
||||
<value>暗い</value>
|
||||
</data>
|
||||
<data name="SettingsPageSC.Content" xml:space="preserve">
|
||||
<value>简体中文</value>
|
||||
</data>
|
||||
<data name="SettingsPageTC.Content" xml:space="preserve">
|
||||
<value>繁體中文</value>
|
||||
</data>
|
||||
<data name="SettingsPageEN.Content" xml:space="preserve">
|
||||
<value>English</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.Header" xml:space="preserve">
|
||||
<value>これはオープンソースアプリです</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.ActionIconToolTip" xml:space="preserve">
|
||||
<value>新しいウィンドウで開きます</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.Description" xml:space="preserve">
|
||||
<value>GitHubのソースコードを参照してください</value>
|
||||
</data>
|
||||
<data name="SettingsPageVersion.Text" xml:space="preserve">
|
||||
<value>バージョン</value>
|
||||
</data>
|
||||
<data name="SettingsPageNoBackdrop.Content" xml:space="preserve">
|
||||
<value>なし</value>
|
||||
</data>
|
||||
<data name="SettingsPageMica.Content" xml:space="preserve">
|
||||
<value>雲母</value>
|
||||
</data>
|
||||
<data name="SettingsPageMicaAlt.Content" xml:space="preserve">
|
||||
<value>マイカル</value>
|
||||
</data>
|
||||
<data name="SettingsPageDesktopAcrylic.Content" xml:space="preserve">
|
||||
<value>デスクトップアクリル</value>
|
||||
</data>
|
||||
<data name="SettingsPageAcrylicBase.Content" xml:space="preserve">
|
||||
<value>アクリルベース</value>
|
||||
</data>
|
||||
<data name="SettingsPageAcrylicThin.Content" xml:space="preserve">
|
||||
<value>アクリル薄い</value>
|
||||
</data>
|
||||
<data name="SettingsPageTransparent.Content" xml:space="preserve">
|
||||
<value>透明</value>
|
||||
</data>
|
||||
<data name="SettingsPageBackdrop.Header" xml:space="preserve">
|
||||
<value>背景</value>
|
||||
</data>
|
||||
<data name="SettingsPageSystemLanguage.Content" xml:space="preserve">
|
||||
<value>デフォルト</value>
|
||||
</data>
|
||||
<data name="SettingsPageRestart.Content" xml:space="preserve">
|
||||
<value>変更を適用するためのアプリを再起動します</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathNotFound.Text" xml:space="preserve">
|
||||
<value>パスはコンピューターでは見つかりません</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathExistedInfo" xml:space="preserve">
|
||||
<value>フォルダーが追加されました。二度と追加しないでください。</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlay.Header" xml:space="preserve">
|
||||
<value>オーバーレイアルバムアートの背景</value>
|
||||
</data>
|
||||
<data name="SettingsPageDynamicCoverOverlay.Header" xml:space="preserve">
|
||||
<value>ダイナミックアルバムアートの背景</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayOpacity.Header" xml:space="preserve">
|
||||
<value>アルバムアートの背景不透明</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitle" xml:space="preserve">
|
||||
<value>設定 - BetterLyrics</value>
|
||||
</data>
|
||||
<data name="LyricsPageTitle" xml:space="preserve">
|
||||
<value>BetterLyrics</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsAlignment.Header" xml:space="preserve">
|
||||
<value>アライメント</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsCenter.Content" xml:space="preserve">
|
||||
<value>中心</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLeft.Content" xml:space="preserve">
|
||||
<value>左</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsRight.Content" xml:space="preserve">
|
||||
<value>右</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayBlurAmount.Header" xml:space="preserve">
|
||||
<value>アルバムアートバックグラウンドブラー量</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurAmount.Header" xml:space="preserve">
|
||||
<value>ぼやけの量</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurAmountSideEffect.Text" xml:space="preserve">
|
||||
<value>この値を調整すると、アルバム画像のバックグラウンドブラー強度も増加します。</value>
|
||||
</data>
|
||||
<data name="SettingsPageSliderPrefix.Text" xml:space="preserve">
|
||||
<value>現在の値:</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurHighGPUUsage.Text" xml:space="preserve">
|
||||
<value>ぼかしが有効になっている場合のGPU使用量が大幅に高くなります(> 0)</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayGPUUsage.Text" xml:space="preserve">
|
||||
<value>この機能を有効にすると、GPUの使用率がわずかに増加します</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsVerticalEdgeOpacity.Header" xml:space="preserve">
|
||||
<value>上端と下端の不透明度</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLineSpacingFactor.Header" xml:space="preserve">
|
||||
<value>ライン間隔</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLineSpacingFactorUnit.Text" xml:space="preserve">
|
||||
<value>x線の高さ</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontSize.Header" xml:space="preserve">
|
||||
<value>フォントサイズ</value>
|
||||
</data>
|
||||
<data name="MainPageLyriscOnly.Content" xml:space="preserve">
|
||||
<value>歌詞のみ</value>
|
||||
</data>
|
||||
<data name="MainWindowImmersiveMode.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>没入モード</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumOverlay.Content" xml:space="preserve">
|
||||
<value>アルバムの背景</value>
|
||||
</data>
|
||||
<data name="SettingsPageAbout.Content" xml:space="preserve">
|
||||
<value>について</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLib.Content" xml:space="preserve">
|
||||
<value>歌詞ライブラリ</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppAppearance.Content" xml:space="preserve">
|
||||
<value>アプリの外観</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffect.Header" xml:space="preserve">
|
||||
<value>グロー効果</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScope.Header" xml:space="preserve">
|
||||
<value>グローエフェクトスコープ</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSearchProvidersConfig.Header" xml:space="preserve">
|
||||
<value>歌詞検索プロバイダーを構成します</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolderButton.Content" xml:space="preserve">
|
||||
<value>追加</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Title" xml:space="preserve">
|
||||
<value>BetterLyrics へようこそ</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Subtitle" xml:space="preserve">
|
||||
<value>今すぐ歌詞データベースをセットアップしましょう</value>
|
||||
</data>
|
||||
<data name="MainPageNoMusicPlaying.Text" xml:space="preserve">
|
||||
<value>今は音楽が再生されていません</value>
|
||||
</data>
|
||||
<data name="SettingsPageDev.Content" xml:space="preserve">
|
||||
<value>開発者オプション</value>
|
||||
</data>
|
||||
<data name="SettingsPageMockMusicPlaying.Header" xml:space="preserve">
|
||||
<value>テスト音楽を再生します</value>
|
||||
</data>
|
||||
<data name="SettingsPagePlayingMockMusicButton.Content" xml:space="preserve">
|
||||
<value>システムプレーヤーを使用して再生します</value>
|
||||
</data>
|
||||
<data name="SettingsPageLog.Header" xml:space="preserve">
|
||||
<value>ログ</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColor.Header" xml:space="preserve">
|
||||
<value>フォントカラー</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColorDefault.Content" xml:space="preserve">
|
||||
<value>デフォルト</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColorDominant.Content" xml:space="preserve">
|
||||
<value>アルバムアートアクセントカラー</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumStyle.Content" xml:space="preserve">
|
||||
<value>アルバムアートスタイル</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumRadius.Header" xml:space="preserve">
|
||||
<value>コーナー半径</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitleBarType.Header" xml:space="preserve">
|
||||
<value>タイトルバーサイズ</value>
|
||||
</data>
|
||||
<data name="SettingsPageCompactTitleBar.Content" xml:space="preserve">
|
||||
<value>コンパクト</value>
|
||||
</data>
|
||||
<data name="SettingsPageExtendedTitleBar.Content" xml:space="preserve">
|
||||
<value>拡張</value>
|
||||
</data>
|
||||
<data name="BaseWindowAOTFlyoutItem.Text" xml:space="preserve">
|
||||
<value>常にトップ</value>
|
||||
</data>
|
||||
<data name="BaseWindowFullScreenFlyoutItem.Text" xml:space="preserve">
|
||||
<value>全画面表示</value>
|
||||
</data>
|
||||
<data name="BaseWindowEnterFullScreenHint" xml:space="preserve">
|
||||
<value>ESCを押して、フルスクリーンモードを終了します</value>
|
||||
</data>
|
||||
<data name="MainPageEnterImmersiveModeHint" xml:space="preserve">
|
||||
<value>再びホバリングして、トグルボタンを表示します</value>
|
||||
</data>
|
||||
<data name="BaseWindowHostInfoBarCheckBox.Content" xml:space="preserve">
|
||||
<value>このメッセージを二度と見せないでください</value>
|
||||
</data>
|
||||
<data name="MainPageNoLocalFilesMatched.Text" xml:space="preserve">
|
||||
<value>一致するローカルファイルはありません</value>
|
||||
</data>
|
||||
<data name="MainPageAlbumArtOnly.Content" xml:space="preserve">
|
||||
<value>アルバムアートのみ</value>
|
||||
</data>
|
||||
<data name="MainPageSplitView.Content" xml:space="preserve">
|
||||
<value>分割ビュー</value>
|
||||
</data>
|
||||
<data name="MainPageDisplayTypeSwitcher.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>表示タイプを変更します</value>
|
||||
</data>
|
||||
<data name="MainPageDesktopLyricsToggler.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>デスクトップ歌詞モードに切り替えます</value>
|
||||
</data>
|
||||
<data name="BaseWindowMiniFlyoutItem.Text" xml:space="preserve">
|
||||
<value>ピクチャーインピクチャーモード</value>
|
||||
</data>
|
||||
<data name="BaseWindowUnMiniFlyoutItem.Text" xml:space="preserve">
|
||||
<value>ピクチャーインピクチャーモードを終了します</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsNotFound.Text" xml:space="preserve">
|
||||
<value>歌詞が見つかりません</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsEffect.Content" xml:space="preserve">
|
||||
<value>歌詞効果</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsStyle.Content" xml:space="preserve">
|
||||
<value>歌詞スタイル</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathBeIncludedInfo" xml:space="preserve">
|
||||
<value>このフォルダーは既存のフォルダーに既に含まれており、再度追加する必要はありません</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppBehavior.Content" xml:space="preserve">
|
||||
<value>アプリの動作</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartWindow.Header" xml:space="preserve">
|
||||
<value>アプリを起動するとき</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartInAppLyrics.Content" xml:space="preserve">
|
||||
<value>標準モードをアクティブにします</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartDesktopLyrics.Content" xml:space="preserve">
|
||||
<value>ドックモードをアクティブにします</value>
|
||||
</data>
|
||||
<data name="DesktopLyricsRendererPageLyricsNotFound.Text" xml:space="preserve">
|
||||
<value>歌詞が見つかりません</value>
|
||||
</data>
|
||||
<data name="SystemTrayPageTitle" xml:space="preserve">
|
||||
<value>システムトレイ - BetterLyrics</value>
|
||||
</data>
|
||||
<data name="HostWindowDockFlyoutItem.Text" xml:space="preserve">
|
||||
<value>ドックモード</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontWeight.Header" xml:space="preserve">
|
||||
<value>フォント重量</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsThin.Content" xml:space="preserve">
|
||||
<value>薄い</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraLight.Content" xml:space="preserve">
|
||||
<value>余分な光</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLight.Content" xml:space="preserve">
|
||||
<value>ライト</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSemiLight.Content" xml:space="preserve">
|
||||
<value>半光</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsNormal.Content" xml:space="preserve">
|
||||
<value>普通</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsMedium.Content" xml:space="preserve">
|
||||
<value>中くらい</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSemiBold.Content" xml:space="preserve">
|
||||
<value>セミボールド</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBold.Content" xml:space="preserve">
|
||||
<value>大胆な</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraBold.Content" xml:space="preserve">
|
||||
<value>余分な太字</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlack.Content" xml:space="preserve">
|
||||
<value>黒</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraBlack.Content" xml:space="preserve">
|
||||
<value>余分な黒</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeWholeLyrics.Content" xml:space="preserve">
|
||||
<value>歌詞全体</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeCurrentLine.Content" xml:space="preserve">
|
||||
<value>現在の行</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeCurrentChar.Content" xml:space="preserve">
|
||||
<value>現在の文字</value>
|
||||
</data>
|
||||
<data name="HostWindowSettingsFlyoutItem.Text" xml:space="preserve">
|
||||
<value>設定</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsLoading.Text" xml:space="preserve">
|
||||
<value>歌詞の読み込み...</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalLrcFile" xml:space="preserve">
|
||||
<value>ローカル.LRCファイル</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalMusicFile" xml:space="preserve">
|
||||
<value>ローカル音楽ファイル</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLrcLib" xml:space="preserve">
|
||||
<value>LRCLIB</value>
|
||||
</data>
|
||||
<data name="SettingsPageJA.Content" xml:space="preserve">
|
||||
<value>日本語</value>
|
||||
</data>
|
||||
<data name="SettingsPageKO.Content" xml:space="preserve">
|
||||
<value>한국어</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderEslrcFile" xml:space="preserve">
|
||||
<value>ローカル.ESLRCファイル</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderTtmlFile" xml:space="preserve">
|
||||
<value>ローカル.TTMLファイル</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathIncludingOthersInfo" xml:space="preserve">
|
||||
<value>このフォルダーには追加されたフォルダーが含まれています。これらのフォルダを削除してフォルダーを追加してください</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,489 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="SettingsPageMusicLib.Header" xml:space="preserve">
|
||||
<value>로컬 음악 도서관</value>
|
||||
</data>
|
||||
<data name="SettingsPageMusicLib.Description" xml:space="preserve">
|
||||
<value>음악이나 가사를 저장하는 폴더 추가</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenLogFolderButton.Content" xml:space="preserve">
|
||||
<value>파일 탐색기에서 열립니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemovePath.Content" xml:space="preserve">
|
||||
<value>앱에서 제거하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemoveInfo.Title" xml:space="preserve">
|
||||
<value>다음 항목을 제거하는 것이 안전합니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageRemoveInfo.Message" xml:space="preserve">
|
||||
<value>이 경로의 원본 파일과 폴더는이 앱에서 제거 할 때 삭제되지 않습니다.</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolder.Header" xml:space="preserve">
|
||||
<value>폴더를 추가하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageTheme.Header" xml:space="preserve">
|
||||
<value>주제</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguage.Header" xml:space="preserve">
|
||||
<value>언어</value>
|
||||
</data>
|
||||
<data name="SettingsPageFollowSystem.Content" xml:space="preserve">
|
||||
<value>시스템을 따르십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageLight.Content" xml:space="preserve">
|
||||
<value>빛</value>
|
||||
</data>
|
||||
<data name="SettingsPageDark.Content" xml:space="preserve">
|
||||
<value>어두운</value>
|
||||
</data>
|
||||
<data name="SettingsPageSC.Content" xml:space="preserve">
|
||||
<value>简体中文</value>
|
||||
</data>
|
||||
<data name="SettingsPageTC.Content" xml:space="preserve">
|
||||
<value>繁體中文</value>
|
||||
</data>
|
||||
<data name="SettingsPageEN.Content" xml:space="preserve">
|
||||
<value>English</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.Header" xml:space="preserve">
|
||||
<value>이것은 오픈 소스 앱입니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.ActionIconToolTip" xml:space="preserve">
|
||||
<value>새 창에서 열립니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageGitHub.Description" xml:space="preserve">
|
||||
<value>GitHub의 소스 코드를 참조하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageVersion.Text" xml:space="preserve">
|
||||
<value>버전</value>
|
||||
</data>
|
||||
<data name="SettingsPageNoBackdrop.Content" xml:space="preserve">
|
||||
<value>없음</value>
|
||||
</data>
|
||||
<data name="SettingsPageMica.Content" xml:space="preserve">
|
||||
<value>운모</value>
|
||||
</data>
|
||||
<data name="SettingsPageMicaAlt.Content" xml:space="preserve">
|
||||
<value>운모 대체</value>
|
||||
</data>
|
||||
<data name="SettingsPageDesktopAcrylic.Content" xml:space="preserve">
|
||||
<value>데스크탑 아크릴</value>
|
||||
</data>
|
||||
<data name="SettingsPageAcrylicBase.Content" xml:space="preserve">
|
||||
<value>아크릴베이스</value>
|
||||
</data>
|
||||
<data name="SettingsPageAcrylicThin.Content" xml:space="preserve">
|
||||
<value>아크릴 얇은</value>
|
||||
</data>
|
||||
<data name="SettingsPageTransparent.Content" xml:space="preserve">
|
||||
<value>투명한</value>
|
||||
</data>
|
||||
<data name="SettingsPageBackdrop.Header" xml:space="preserve">
|
||||
<value>배경</value>
|
||||
</data>
|
||||
<data name="SettingsPageSystemLanguage.Content" xml:space="preserve">
|
||||
<value>기본</value>
|
||||
</data>
|
||||
<data name="SettingsPageRestart.Content" xml:space="preserve">
|
||||
<value>변경 사항을 적용하려면 앱을 다시 시작하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathNotFound.Text" xml:space="preserve">
|
||||
<value>경로는 컴퓨터에서 찾을 수 없습니다</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathExistedInfo" xml:space="preserve">
|
||||
<value>폴더가 추가되었습니다. 다시 추가하지 마십시오.</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlay.Header" xml:space="preserve">
|
||||
<value>오버레이 앨범 아트 배경</value>
|
||||
</data>
|
||||
<data name="SettingsPageDynamicCoverOverlay.Header" xml:space="preserve">
|
||||
<value>동적 앨범 아트 배경</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayOpacity.Header" xml:space="preserve">
|
||||
<value>앨범 아트 배경 불투명도</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitle" xml:space="preserve">
|
||||
<value>설정 - BetterLyrics</value>
|
||||
</data>
|
||||
<data name="LyricsPageTitle" xml:space="preserve">
|
||||
<value>BetterLyrics</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsAlignment.Header" xml:space="preserve">
|
||||
<value>조정</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsCenter.Content" xml:space="preserve">
|
||||
<value>센터</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLeft.Content" xml:space="preserve">
|
||||
<value>왼쪽</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsRight.Content" xml:space="preserve">
|
||||
<value>오른쪽</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayBlurAmount.Header" xml:space="preserve">
|
||||
<value>앨범 아트 배경 흐림 금액</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurAmount.Header" xml:space="preserve">
|
||||
<value>흐림 금액</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurAmountSideEffect.Text" xml:space="preserve">
|
||||
<value>이 값을 조정하면 앨범 이미지의 배경 흐림 강도가 증가합니다.</value>
|
||||
</data>
|
||||
<data name="SettingsPageSliderPrefix.Text" xml:space="preserve">
|
||||
<value>현재 가치 :</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlurHighGPUUsage.Text" xml:space="preserve">
|
||||
<value>Blur가 활성화 될 때 상당히 높은 GPU 사용량 (> 0)</value>
|
||||
</data>
|
||||
<data name="SettingsPageCoverOverlayGPUUsage.Text" xml:space="preserve">
|
||||
<value>이 기능을 활성화하면 GPU 사용률이 약간 증가합니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsVerticalEdgeOpacity.Header" xml:space="preserve">
|
||||
<value>상단 및 하단 가장자리 불투명도</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLineSpacingFactor.Header" xml:space="preserve">
|
||||
<value>라인 간격</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLineSpacingFactorUnit.Text" xml:space="preserve">
|
||||
<value>X 라인 높이</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontSize.Header" xml:space="preserve">
|
||||
<value>글꼴 크기</value>
|
||||
</data>
|
||||
<data name="MainPageLyriscOnly.Content" xml:space="preserve">
|
||||
<value>가사 만</value>
|
||||
</data>
|
||||
<data name="MainWindowImmersiveMode.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>몰입 형 모드</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumOverlay.Content" xml:space="preserve">
|
||||
<value>앨범 배경</value>
|
||||
</data>
|
||||
<data name="SettingsPageAbout.Content" xml:space="preserve">
|
||||
<value>에 대한</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLib.Content" xml:space="preserve">
|
||||
<value>가사 도서관</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppAppearance.Content" xml:space="preserve">
|
||||
<value>앱 모양</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffect.Header" xml:space="preserve">
|
||||
<value>글로우 효과</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScope.Header" xml:space="preserve">
|
||||
<value>글로우 효과 범위</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSearchProvidersConfig.Header" xml:space="preserve">
|
||||
<value>가사 검색 제공 업체를 구성하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolderButton.Content" xml:space="preserve">
|
||||
<value>추가하다</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Title" xml:space="preserve">
|
||||
<value>Betterlyrics에 오신 것을 환영합니다</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Subtitle" xml:space="preserve">
|
||||
<value>지금 가사 데이터베이스를 설정합시다</value>
|
||||
</data>
|
||||
<data name="MainPageNoMusicPlaying.Text" xml:space="preserve">
|
||||
<value>지금 음악이 재생되지 않습니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageDev.Content" xml:space="preserve">
|
||||
<value>개발자 옵션</value>
|
||||
</data>
|
||||
<data name="SettingsPageMockMusicPlaying.Header" xml:space="preserve">
|
||||
<value>테스트 음악을 재생하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPagePlayingMockMusicButton.Content" xml:space="preserve">
|
||||
<value>시스템 플레이어를 사용하여 재생하십시오</value>
|
||||
</data>
|
||||
<data name="SettingsPageLog.Header" xml:space="preserve">
|
||||
<value>통나무</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColor.Header" xml:space="preserve">
|
||||
<value>글꼴 색상</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColorDefault.Content" xml:space="preserve">
|
||||
<value>기본</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontColorDominant.Content" xml:space="preserve">
|
||||
<value>앨범 아트 악센트 색상</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumStyle.Content" xml:space="preserve">
|
||||
<value>앨범 아트 스타일</value>
|
||||
</data>
|
||||
<data name="SettingsPageAlbumRadius.Header" xml:space="preserve">
|
||||
<value>코너 반경</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitleBarType.Header" xml:space="preserve">
|
||||
<value>제목 바 크기</value>
|
||||
</data>
|
||||
<data name="SettingsPageCompactTitleBar.Content" xml:space="preserve">
|
||||
<value>콤팩트</value>
|
||||
</data>
|
||||
<data name="SettingsPageExtendedTitleBar.Content" xml:space="preserve">
|
||||
<value>펼친</value>
|
||||
</data>
|
||||
<data name="BaseWindowAOTFlyoutItem.Text" xml:space="preserve">
|
||||
<value>항상 위에</value>
|
||||
</data>
|
||||
<data name="BaseWindowFullScreenFlyoutItem.Text" xml:space="preserve">
|
||||
<value>전체 화면</value>
|
||||
</data>
|
||||
<data name="BaseWindowEnterFullScreenHint" xml:space="preserve">
|
||||
<value>ESC를 눌러 전체 화면 모드를 종료하십시오</value>
|
||||
</data>
|
||||
<data name="MainPageEnterImmersiveModeHint" xml:space="preserve">
|
||||
<value>토글 버튼을 표시하려면 다시 다시 가져옵니다</value>
|
||||
</data>
|
||||
<data name="BaseWindowHostInfoBarCheckBox.Content" xml:space="preserve">
|
||||
<value>이 메시지를 다시 표시하지 마십시오</value>
|
||||
</data>
|
||||
<data name="MainPageNoLocalFilesMatched.Text" xml:space="preserve">
|
||||
<value>로컬 파일이 일치하지 않습니다</value>
|
||||
</data>
|
||||
<data name="MainPageAlbumArtOnly.Content" xml:space="preserve">
|
||||
<value>앨범 아트 만</value>
|
||||
</data>
|
||||
<data name="MainPageSplitView.Content" xml:space="preserve">
|
||||
<value>분할보기</value>
|
||||
</data>
|
||||
<data name="MainPageDisplayTypeSwitcher.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>디스플레이 유형을 변경하십시오</value>
|
||||
</data>
|
||||
<data name="MainPageDesktopLyricsToggler.ToolTipService.ToolTip" xml:space="preserve">
|
||||
<value>데스크탑 가사 모드로 전환하십시오</value>
|
||||
</data>
|
||||
<data name="BaseWindowMiniFlyoutItem.Text" xml:space="preserve">
|
||||
<value>사진 인당 모드</value>
|
||||
</data>
|
||||
<data name="BaseWindowUnMiniFlyoutItem.Text" xml:space="preserve">
|
||||
<value>Picture-in-Picture 모드 종료</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsNotFound.Text" xml:space="preserve">
|
||||
<value>가사를 찾을 수 없습니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsEffect.Content" xml:space="preserve">
|
||||
<value>가사 효과</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsStyle.Content" xml:space="preserve">
|
||||
<value>가사 스타일</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathBeIncludedInfo" xml:space="preserve">
|
||||
<value>이 폴더는 이미 기존 폴더에 포함되어 있으며 다시 추가 할 필요가 없습니다.</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppBehavior.Content" xml:space="preserve">
|
||||
<value>앱 동작</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartWindow.Header" xml:space="preserve">
|
||||
<value>앱을 시작할 때</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartInAppLyrics.Content" xml:space="preserve">
|
||||
<value>표준 모드를 활성화합니다</value>
|
||||
</data>
|
||||
<data name="SettingsPageAutoStartDesktopLyrics.Content" xml:space="preserve">
|
||||
<value>도크 모드를 활성화하십시오</value>
|
||||
</data>
|
||||
<data name="DesktopLyricsRendererPageLyricsNotFound.Text" xml:space="preserve">
|
||||
<value>가사를 찾을 수 없습니다</value>
|
||||
</data>
|
||||
<data name="SystemTrayPageTitle" xml:space="preserve">
|
||||
<value>시스템 트레이 - BetterLyrics</value>
|
||||
</data>
|
||||
<data name="HostWindowDockFlyoutItem.Text" xml:space="preserve">
|
||||
<value>도크 모드</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsFontWeight.Header" xml:space="preserve">
|
||||
<value>글꼴 무게</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsThin.Content" xml:space="preserve">
|
||||
<value>얇은</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraLight.Content" xml:space="preserve">
|
||||
<value>여분의 빛</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsLight.Content" xml:space="preserve">
|
||||
<value>빛</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSemiLight.Content" xml:space="preserve">
|
||||
<value>반 빛</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsNormal.Content" xml:space="preserve">
|
||||
<value>정상</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsMedium.Content" xml:space="preserve">
|
||||
<value>중간</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsSemiBold.Content" xml:space="preserve">
|
||||
<value>반 대담한</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBold.Content" xml:space="preserve">
|
||||
<value>용감한</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraBold.Content" xml:space="preserve">
|
||||
<value>추가 대담한</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsBlack.Content" xml:space="preserve">
|
||||
<value>검은색</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsExtraBlack.Content" xml:space="preserve">
|
||||
<value>여분의 검은 색</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeWholeLyrics.Content" xml:space="preserve">
|
||||
<value>전체 가사</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeCurrentLine.Content" xml:space="preserve">
|
||||
<value>현재 라인</value>
|
||||
</data>
|
||||
<data name="SettingsPageLyricsGlowEffectScopeCurrentChar.Content" xml:space="preserve">
|
||||
<value>현재 숯</value>
|
||||
</data>
|
||||
<data name="HostWindowSettingsFlyoutItem.Text" xml:space="preserve">
|
||||
<value>설정</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsLoading.Text" xml:space="preserve">
|
||||
<value>가사로드 ...</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalLrcFile" xml:space="preserve">
|
||||
<value>로컬 .LRC 파일</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalMusicFile" xml:space="preserve">
|
||||
<value>로컬 음악 파일</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLrcLib" xml:space="preserve">
|
||||
<value>LRCLIB</value>
|
||||
</data>
|
||||
<data name="SettingsPageJA.Content" xml:space="preserve">
|
||||
<value>日本語</value>
|
||||
</data>
|
||||
<data name="SettingsPageKO.Content" xml:space="preserve">
|
||||
<value>한국어</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderEslrcFile" xml:space="preserve">
|
||||
<value>로컬 .ESLRC 파일</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderTtmlFile" xml:space="preserve">
|
||||
<value>로컬 .TTML 파일</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathIncludingOthersInfo" xml:space="preserve">
|
||||
<value>이 폴더에는 추가 된 폴더가 포함되어 있습니다. 폴더를 추가하려면이 폴더를 삭제하십시오.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -121,10 +121,7 @@
|
||||
<value>本地音乐媒体库</value>
|
||||
</data>
|
||||
<data name="SettingsPageMusicLib.Description" xml:space="preserve">
|
||||
<value>添加存放音乐或歌词的文件夹以构建歌词索引数据库</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenPath.Content" xml:space="preserve">
|
||||
<value>在文件资源管理器中打开</value>
|
||||
<value>添加存放音乐或歌词的文件夹</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenLogFolderButton.Content" xml:space="preserve">
|
||||
<value>在文件资源管理器中打开</value>
|
||||
@@ -294,18 +291,12 @@
|
||||
<data name="SettingsPageLyricsGlowEffectScope.Header" xml:space="preserve">
|
||||
<value>辉光效果作用范围</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabase.Header" xml:space="preserve">
|
||||
<value>重构歌词索引数据库</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseButton.Content" xml:space="preserve">
|
||||
<value>重构</value>
|
||||
<data name="SettingsPageLyricsSearchProvidersConfig.Header" xml:space="preserve">
|
||||
<value>配置歌词搜索服务</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolderButton.Content" xml:space="preserve">
|
||||
<value>添加</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseDesc.Text" xml:space="preserve">
|
||||
<value>重构数据库中,请稍候...</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Title" xml:space="preserve">
|
||||
<value>欢迎使用 BetterLyrics</value>
|
||||
</data>
|
||||
@@ -468,4 +459,31 @@
|
||||
<data name="HostWindowSettingsFlyoutItem.Text" xml:space="preserve">
|
||||
<value>设置</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsLoading.Text" xml:space="preserve">
|
||||
<value>加载歌词中...</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalLrcFile" xml:space="preserve">
|
||||
<value>本地 .LRC 文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalMusicFile" xml:space="preserve">
|
||||
<value>本地音乐文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLrcLib" xml:space="preserve">
|
||||
<value>LRCLIB</value>
|
||||
</data>
|
||||
<data name="SettingsPageJA.Content" xml:space="preserve">
|
||||
<value>日本語</value>
|
||||
</data>
|
||||
<data name="SettingsPageKO.Content" xml:space="preserve">
|
||||
<value>한국어</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderEslrcFile" xml:space="preserve">
|
||||
<value>本地 .ESLRC 文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderTtmlFile" xml:space="preserve">
|
||||
<value>本地 .TTML 文件</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathIncludingOthersInfo" xml:space="preserve">
|
||||
<value>该文件夹包含已添加文件夹,请删除这些文件夹以添加该文件夹</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -121,10 +121,7 @@
|
||||
<value>本地音樂媒體庫</value>
|
||||
</data>
|
||||
<data name="SettingsPageMusicLib.Description" xml:space="preserve">
|
||||
<value>新增存放音樂或歌詞的資料夾以建立歌詞索引資料庫</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenPath.Content" xml:space="preserve">
|
||||
<value>在檔案總管中開啟</value>
|
||||
<value>新增存放音樂或歌詞的資料夾</value>
|
||||
</data>
|
||||
<data name="SettingsPageOpenLogFolderButton.Content" xml:space="preserve">
|
||||
<value>在檔案總管中開啟</value>
|
||||
@@ -294,18 +291,12 @@
|
||||
<data name="SettingsPageLyricsGlowEffectScope.Header" xml:space="preserve">
|
||||
<value>輝光效果作用範圍</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabase.Header" xml:space="preserve">
|
||||
<value>重構歌詞索引資料庫</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseButton.Content" xml:space="preserve">
|
||||
<value>重構</value>
|
||||
<data name="SettingsPageLyricsSearchProvidersConfig.Header" xml:space="preserve">
|
||||
<value>配置歌詞搜尋服務</value>
|
||||
</data>
|
||||
<data name="SettingsPageAddFolderButton.Content" xml:space="preserve">
|
||||
<value>添加</value>
|
||||
</data>
|
||||
<data name="SettingsPageRebuildDatabaseDesc.Text" xml:space="preserve">
|
||||
<value>重構資料庫中,請稍候...</value>
|
||||
</data>
|
||||
<data name="MainPageWelcomeTeachingTip.Title" xml:space="preserve">
|
||||
<value>歡迎使用 BetterLyrics</value>
|
||||
</data>
|
||||
@@ -468,4 +459,31 @@
|
||||
<data name="HostWindowSettingsFlyoutItem.Text" xml:space="preserve">
|
||||
<value>設定</value>
|
||||
</data>
|
||||
<data name="MainPageLyricsLoading.Text" xml:space="preserve">
|
||||
<value>載入歌詞中...</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalLrcFile" xml:space="preserve">
|
||||
<value>本地 .lRC 文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLocalMusicFile" xml:space="preserve">
|
||||
<value>本地音樂文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderLrcLib" xml:space="preserve">
|
||||
<value>LRCLIB</value>
|
||||
</data>
|
||||
<data name="SettingsPageJA.Content" xml:space="preserve">
|
||||
<value>日本語</value>
|
||||
</data>
|
||||
<data name="SettingsPageKO.Content" xml:space="preserve">
|
||||
<value>한국어</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderEslrcFile" xml:space="preserve">
|
||||
<value>本地 .ESLRC 文件</value>
|
||||
</data>
|
||||
<data name="LyricsSearchProviderTtmlFile" xml:space="preserve">
|
||||
<value>本地 .TTML 文件</value>
|
||||
</data>
|
||||
<data name="SettingsPagePathIncludingOthersInfo" xml:space="preserve">
|
||||
<value>該文件夾包含已添加文件夾,請刪除這些文件夾以添加該文件夾</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
|
||||
namespace BetterLyrics.WinUI3.Rendering
|
||||
{
|
||||
public partial class BaseRendererViewModel(ISettingsService settingsService)
|
||||
: BaseViewModel(settingsService)
|
||||
{
|
||||
public TimeSpan TotalTime { get; set; } = TimeSpan.Zero;
|
||||
public TimeSpan ElapsedTime { get; set; } = TimeSpan.Zero;
|
||||
|
||||
public virtual void Calculate(
|
||||
ICanvasAnimatedControl control,
|
||||
CanvasAnimatedUpdateEventArgs args
|
||||
)
|
||||
{
|
||||
TotalTime += args.Timing.ElapsedTime;
|
||||
ElapsedTime = args.Timing.ElapsedTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Microsoft.UI.Dispatching;
|
||||
|
||||
|
||||
@@ -5,13 +5,12 @@ using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Messages;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using H.NotifyIcon.Interop;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Windows.UI;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using BetterInAppLyrics.WinUI3.ViewModels;
|
||||
@@ -6,8 +7,7 @@ using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Messages;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Services.Playback;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
@@ -21,7 +21,8 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
public partial class LyricsPageViewModel
|
||||
: BaseViewModel,
|
||||
IRecipient<PropertyChangedMessage<int>>,
|
||||
IRecipient<PropertyChangedMessage<bool>>
|
||||
IRecipient<PropertyChangedMessage<bool>>,
|
||||
IRecipient<PropertyChangedMessage<LyricsStatus>>
|
||||
{
|
||||
private LyricsDisplayType? _preferredDisplayTypeBeforeSwitchToDockMode;
|
||||
|
||||
@@ -40,10 +41,16 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
[ObservableProperty]
|
||||
public partial SongInfo? SongInfo { get; set; } = null;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial LyricsStatus LyricsStatus { get; set; } = LyricsStatus.Loading;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial LyricsDisplayType? PreferredDisplayType { get; set; } =
|
||||
LyricsDisplayType.SplitView;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial int LyricsFontSize { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool AboutToUpdateUI { get; set; }
|
||||
|
||||
@@ -73,6 +80,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
)
|
||||
: base(settingsService)
|
||||
{
|
||||
LyricsFontSize = _settingsService.LyricsFontSize;
|
||||
CoverImageRadius = _settingsService.CoverImageRadius;
|
||||
|
||||
_playbackService = playbackService;
|
||||
@@ -173,13 +181,20 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
public void Receive(PropertyChangedMessage<int> message)
|
||||
{
|
||||
if (message.Sender.GetType() == typeof(SettingsViewModel))
|
||||
if (message.Sender is SettingsViewModel)
|
||||
{
|
||||
if (message.PropertyName == nameof(SettingsViewModel.CoverImageRadius))
|
||||
{
|
||||
CoverImageRadius = message.NewValue;
|
||||
}
|
||||
}
|
||||
if (message.Sender is LyricsSettingsControlViewModel)
|
||||
{
|
||||
if (message.PropertyName == nameof(LyricsSettingsControlViewModel.LyricsFontSize))
|
||||
{
|
||||
LyricsFontSize = message.NewValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(PropertyChangedMessage<bool> message)
|
||||
@@ -201,17 +216,15 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
TrySwitchToPreferredDisplayType(SongInfo);
|
||||
}
|
||||
}
|
||||
else if (message.Sender is SettingsViewModel)
|
||||
}
|
||||
|
||||
public void Receive(PropertyChangedMessage<LyricsStatus> message)
|
||||
{
|
||||
if (message.Sender is LyricsRendererViewModel)
|
||||
{
|
||||
if (
|
||||
message.PropertyName
|
||||
== nameof(SettingsViewModel.IsRebuildingLyricsIndexDatabase)
|
||||
)
|
||||
if (message.PropertyName == nameof(LyricsRendererViewModel.LyricsStatus))
|
||||
{
|
||||
if (!message.NewValue)
|
||||
{
|
||||
_playbackService.ReSendingMessages();
|
||||
}
|
||||
LyricsStatus = message.NewValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BetterInAppLyrics.WinUI3.ViewModels;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Events;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Messages;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Rendering;
|
||||
using BetterLyrics.WinUI3.Services.Playback;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
@@ -24,11 +20,7 @@ using Microsoft.Graphics.Canvas.Effects;
|
||||
using Microsoft.Graphics.Canvas.Text;
|
||||
using Microsoft.Graphics.Canvas.UI.Xaml;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Text;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.UI;
|
||||
@@ -36,7 +28,7 @@ using Windows.UI;
|
||||
namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
public partial class LyricsRendererViewModel
|
||||
: BaseRendererViewModel,
|
||||
: BaseViewModel,
|
||||
IRecipient<PropertyChangedMessage<int>>,
|
||||
IRecipient<PropertyChangedMessage<float>>,
|
||||
IRecipient<PropertyChangedMessage<double>>,
|
||||
@@ -47,7 +39,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
IRecipient<PropertyChangedMessage<LyricsAlignmentType>>,
|
||||
IRecipient<PropertyChangedMessage<ElementTheme>>,
|
||||
IRecipient<PropertyChangedMessage<LyricsFontWeight>>,
|
||||
IRecipient<PropertyChangedMessage<LyricsGlowEffectScope>>
|
||||
IRecipient<PropertyChangedMessage<LyricsGlowEffectScope>>,
|
||||
IRecipient<PropertyChangedMessage<ObservableCollection<LyricsSearchProviderInfo>>>,
|
||||
IRecipient<PropertyChangedMessage<ObservableCollection<LocalLyricsFolder>>>
|
||||
{
|
||||
private protected CanvasTextFormat _textFormat = new()
|
||||
{
|
||||
@@ -55,38 +49,27 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
VerticalAlignment = CanvasVerticalAlignment.Top,
|
||||
};
|
||||
|
||||
public TimeSpan TotalTime { get; set; } = TimeSpan.Zero;
|
||||
public TimeSpan ElapsedTime { get; set; } = TimeSpan.Zero;
|
||||
|
||||
public LyricsDisplayType DisplayType { get; set; }
|
||||
|
||||
private float _rotateAngle = 0f;
|
||||
private byte[] _shaderByteCode = File.ReadAllBytes(AppInfo.CustomShaderPath);
|
||||
|
||||
private Color ActivatedWindowAccentColor { get; set; } = Colors.Transparent;
|
||||
private Color? _albumArtAccentColor = null;
|
||||
|
||||
private bool IsDockMode { get; set; } = false;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial SongInfo? SongInfo { get; set; }
|
||||
|
||||
private List<List<LyricsLine>> _multiLangLyrics = [];
|
||||
private int _langIndex = 0;
|
||||
|
||||
private List<LyricsLine>? _lyricsForGlowEffect = [];
|
||||
|
||||
private SoftwareBitmap? _lastSoftwareBitmap = null;
|
||||
private SoftwareBitmap? _softwareBitmap = null;
|
||||
private SoftwareBitmap? SoftwareBitmap
|
||||
{
|
||||
get => _softwareBitmap;
|
||||
set
|
||||
{
|
||||
if (_softwareBitmap != null)
|
||||
{
|
||||
_lastSoftwareBitmap = _softwareBitmap;
|
||||
_transitionStartTime = DateTimeOffset.Now;
|
||||
_isTransitioning = true;
|
||||
_transitionAlpha = 0f;
|
||||
}
|
||||
|
||||
_softwareBitmap = value;
|
||||
}
|
||||
}
|
||||
private SoftwareBitmap? _lastAlbumArtBitmap = null;
|
||||
private SoftwareBitmap? _albumArtBitmap = null;
|
||||
|
||||
public int CoverImageRadius { get; set; }
|
||||
public bool IsCoverOverlayEnabled { get; set; }
|
||||
@@ -94,8 +77,11 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
public int CoverOverlayOpacity { get; set; }
|
||||
public int CoverOverlayBlurAmount { get; set; }
|
||||
|
||||
private bool _isPlaying = true;
|
||||
|
||||
[NotifyPropertyChangedRecipients]
|
||||
[ObservableProperty]
|
||||
public partial bool IsPlaying { get; set; }
|
||||
public partial LyricsStatus LyricsStatus { get; set; } = LyricsStatus.Loading;
|
||||
|
||||
private protected Color _fontColor;
|
||||
|
||||
@@ -110,24 +96,15 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private readonly int _lineEnteringDurationMs = 800;
|
||||
private readonly int _lineExitingDurationMs = 800;
|
||||
private readonly int _lineScrollDurationMs = 800;
|
||||
|
||||
private float _lastTotalYScroll = 0.0f;
|
||||
private float _totalYScroll = 0.0f;
|
||||
|
||||
private int _startVisibleLineIndex = -1;
|
||||
private int _endVisibleLineIndex = -1;
|
||||
|
||||
private bool _forceToScroll = false;
|
||||
|
||||
private readonly float _lyricsGlowEffectAmount = 6f;
|
||||
|
||||
private readonly double _rightMargin = 36;
|
||||
private readonly float _topMargin = 0f;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial double LimitedLineWidth { get; set; }
|
||||
|
||||
private protected bool _isRelayoutNeeded = true;
|
||||
|
||||
[ObservableProperty]
|
||||
@@ -152,26 +129,49 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
public LyricsGlowEffectScope LyricsGlowEffectScope { get; set; }
|
||||
|
||||
private protected readonly IPlaybackService _playbackService;
|
||||
|
||||
private float _transitionAlpha = 1f;
|
||||
private TimeSpan _transitionDuration = TimeSpan.FromMilliseconds(1000);
|
||||
private DateTimeOffset _transitionStartTime;
|
||||
private bool _isTransitioning = false;
|
||||
private protected readonly IMusicSearchService _musicSearchService;
|
||||
private readonly ILibWatcherService _libWatcherService;
|
||||
|
||||
private readonly float _coverRotateSpeed = 0.003f;
|
||||
|
||||
private Color _currentBgColor;
|
||||
private Color _targetBgColor;
|
||||
private float _colorTransitionProgress = 1f;
|
||||
private const float ColorTransitionDuration = 0.3f; // 秒
|
||||
private bool _isColorTransitioning = false;
|
||||
private readonly ValueTransition<Color> _immersiveBgrTransition = new(
|
||||
initialValue: Colors.Transparent,
|
||||
durationSeconds: 0.3f,
|
||||
interpolator: (from, to, progress) =>
|
||||
Helper.ColorHelper.GetInterpolatedColor(progress, from, to)
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _albumArtBgTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 1.0f,
|
||||
interpolator: (from, to, progress) => from + (to - from) * progress
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _canvasYScrollTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.8f,
|
||||
interpolator: (from, to, progress) =>
|
||||
from + (to - from) * EasingHelper.SmootherStep(progress)
|
||||
);
|
||||
|
||||
private readonly ValueTransition<float> _limitedLineWidthTransition = new(
|
||||
initialValue: 0f,
|
||||
durationSeconds: 0.8f,
|
||||
interpolator: (from, to, progress) => to
|
||||
);
|
||||
|
||||
public LyricsRendererViewModel(
|
||||
ISettingsService settingsService,
|
||||
IPlaybackService playbackService
|
||||
IPlaybackService playbackService,
|
||||
IMusicSearchService musicSearchService,
|
||||
ILibWatcherService libWatcherService
|
||||
)
|
||||
: base(settingsService)
|
||||
{
|
||||
_musicSearchService = musicSearchService;
|
||||
_playbackService = playbackService;
|
||||
_libWatcherService = libWatcherService;
|
||||
|
||||
CoverImageRadius = _settingsService.CoverImageRadius;
|
||||
IsCoverOverlayEnabled = _settingsService.IsCoverOverlayEnabled;
|
||||
IsDynamicCoverOverlayEnabled = _settingsService.IsDynamicCoverOverlayEnabled;
|
||||
@@ -188,16 +188,68 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
IsLyricsGlowEffectEnabled = _settingsService.IsLyricsGlowEffectEnabled;
|
||||
LyricsGlowEffectScope = _settingsService.LyricsGlowEffectScope;
|
||||
|
||||
_playbackService = playbackService;
|
||||
_libWatcherService.MusicLibraryFilesChanged +=
|
||||
LibWatcherService_MusicLibraryFilesChanged;
|
||||
|
||||
_playbackService.IsPlayingChanged += PlaybackService_IsPlayingChanged;
|
||||
_playbackService.SongInfoChanged += PlaybackService_SongInfoChanged;
|
||||
_playbackService.PositionChanged += PlaybackService_PositionChanged;
|
||||
|
||||
RefreshPlaybackInfo();
|
||||
|
||||
UpdateFontColor();
|
||||
}
|
||||
|
||||
private void LibWatcherService_MusicLibraryFilesChanged(
|
||||
object? sender,
|
||||
Events.LibChangedEventArgs e
|
||||
)
|
||||
{
|
||||
RefreshLyricsAsync().ConfigureAwait(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should invoke this function when:
|
||||
/// 1. The song info is changed (new song is played).
|
||||
/// 2. Lyrics search provider info is changed (change order, enable or disable any provider).
|
||||
/// 3. Local music/lyrics files are changed (added, removed, renamed).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RefreshLyricsAsync()
|
||||
{
|
||||
_multiLangLyrics = [];
|
||||
_isRelayoutNeeded = true;
|
||||
LyricsStatus = LyricsStatus.Loading;
|
||||
string? lyricsRaw = null;
|
||||
LyricsFormat? lyricsFormat = null;
|
||||
|
||||
if (SongInfo != null)
|
||||
{
|
||||
(lyricsRaw, lyricsFormat) = await _musicSearchService.SearchLyricsAsync(
|
||||
SongInfo.Title,
|
||||
SongInfo.Artist,
|
||||
SongInfo.Album ?? "",
|
||||
SongInfo.DurationMs ?? 0
|
||||
);
|
||||
}
|
||||
|
||||
if (lyricsRaw == null)
|
||||
{
|
||||
LyricsStatus = LyricsStatus.NotFound;
|
||||
}
|
||||
else if (SongInfo != null)
|
||||
{
|
||||
_multiLangLyrics = new LyricsParser().Parse(
|
||||
lyricsRaw,
|
||||
lyricsFormat,
|
||||
SongInfo.Title,
|
||||
SongInfo.Artist,
|
||||
(int)(SongInfo.DurationMs ?? 0)
|
||||
);
|
||||
_isRelayoutNeeded = true;
|
||||
LyricsStatus = LyricsStatus.Found;
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestRelayout()
|
||||
{
|
||||
_isRelayoutNeeded = true;
|
||||
@@ -215,29 +267,43 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private void PlaybackService_IsPlayingChanged(object? sender, IsPlayingChangedEventArgs e)
|
||||
{
|
||||
IsPlaying = e.IsPlaying;
|
||||
_isPlaying = e.IsPlaying;
|
||||
}
|
||||
|
||||
public void RefreshPlaybackInfo()
|
||||
{
|
||||
IsPlaying = _playbackService.IsPlaying;
|
||||
_isPlaying = _playbackService.IsPlaying;
|
||||
SongInfo = _playbackService.SongInfo;
|
||||
TotalTime = _playbackService.Position;
|
||||
}
|
||||
|
||||
partial void OnLimitedLineWidthChanged(double value)
|
||||
async partial void OnSongInfoChanged(SongInfo? oldValue, SongInfo? newValue)
|
||||
{
|
||||
_isRelayoutNeeded = true;
|
||||
}
|
||||
TotalTime = TimeSpan.Zero;
|
||||
|
||||
async partial void OnSongInfoChanged(SongInfo? value)
|
||||
{
|
||||
if (value?.AlbumArt is byte[] bytes)
|
||||
SoftwareBitmap = await (
|
||||
_lastAlbumArtBitmap = _albumArtBitmap;
|
||||
|
||||
if (newValue?.AlbumArt is byte[] bytes)
|
||||
{
|
||||
_albumArtBitmap = await (
|
||||
await ImageHelper.GetDecoderFromByte(bytes)
|
||||
).GetSoftwareBitmapAsync(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
|
||||
_albumArtAccentColor = (
|
||||
await ImageHelper.GetAccentColorsFromByte(bytes)
|
||||
).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
_albumArtBitmap = null;
|
||||
_albumArtAccentColor = null;
|
||||
}
|
||||
|
||||
UpdateFontColor();
|
||||
_isRelayoutNeeded = true;
|
||||
|
||||
_albumArtBgTransition.Reset(0f);
|
||||
_albumArtBgTransition.StartTransition(1f);
|
||||
|
||||
await RefreshLyricsAsync();
|
||||
}
|
||||
|
||||
partial void OnLyricsFontSizeChanged(int value)
|
||||
@@ -267,36 +333,39 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private protected void UpdateFontColor()
|
||||
{
|
||||
switch (LyricsFontColorType)
|
||||
Color fallback = Colors.Transparent;
|
||||
switch (Theme)
|
||||
{
|
||||
case LyricsFontColorType.Default:
|
||||
switch (Theme)
|
||||
case ElementTheme.Default:
|
||||
switch (Application.Current.RequestedTheme)
|
||||
{
|
||||
case ElementTheme.Default:
|
||||
switch (Application.Current.RequestedTheme)
|
||||
{
|
||||
case ApplicationTheme.Light:
|
||||
_fontColor = _darkFontColor;
|
||||
break;
|
||||
case ApplicationTheme.Dark:
|
||||
_fontColor = _lightFontColor;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case ApplicationTheme.Light:
|
||||
fallback = _darkFontColor;
|
||||
break;
|
||||
case ElementTheme.Light:
|
||||
_fontColor = _darkFontColor;
|
||||
break;
|
||||
case ElementTheme.Dark:
|
||||
_fontColor = _lightFontColor;
|
||||
case ApplicationTheme.Dark:
|
||||
fallback = _lightFontColor;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ElementTheme.Light:
|
||||
fallback = _darkFontColor;
|
||||
break;
|
||||
case ElementTheme.Dark:
|
||||
fallback = _lightFontColor;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (LyricsFontColorType)
|
||||
{
|
||||
case LyricsFontColorType.Default:
|
||||
_fontColor = fallback;
|
||||
break;
|
||||
case LyricsFontColorType.Dominant:
|
||||
_fontColor = SongInfo?.CoverImageDominantColors?[0] ?? _lightFontColor;
|
||||
_fontColor = _albumArtAccentColor ?? fallback;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -305,10 +374,10 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private int GetCurrentPlayingLineIndex()
|
||||
{
|
||||
for (int i = 0; i < SongInfo?.LyricsLines?.Count; i++)
|
||||
for (int i = 0; i < _multiLangLyrics.SafeGet(_langIndex)?.Count; i++)
|
||||
{
|
||||
var line = SongInfo?.LyricsLines?[i];
|
||||
if (line.EndPlayingTimestampMs < TotalTime.TotalMilliseconds)
|
||||
var line = _multiLangLyrics.SafeGet(_langIndex)?[i];
|
||||
if (line?.EndMs < TotalTime.TotalMilliseconds)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -326,12 +395,16 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private Tuple<int, int> GetMaxLyricsLineIndexBoundaries()
|
||||
{
|
||||
if (SongInfo == null || SongInfo.LyricsLines == null || SongInfo.LyricsLines.Count == 0)
|
||||
if (
|
||||
SongInfo == null
|
||||
|| _multiLangLyrics.SafeGet(_langIndex) == null
|
||||
|| _multiLangLyrics[_langIndex].Count == 0
|
||||
)
|
||||
{
|
||||
return new Tuple<int, int>(-1, -1);
|
||||
}
|
||||
|
||||
return new Tuple<int, int>(0, SongInfo.LyricsLines.Count - 1);
|
||||
return new Tuple<int, int>(0, _multiLangLyrics[_langIndex].Count - 1);
|
||||
}
|
||||
|
||||
private void DrawLyrics(
|
||||
@@ -345,8 +418,6 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
var (displayStartLineIndex, displayEndLineIndex) =
|
||||
GetVisibleLyricsLineIndexBoundaries();
|
||||
|
||||
var currentPlayingLineIndex = GetCurrentPlayingLineIndex();
|
||||
|
||||
for (
|
||||
int i = displayStartLineIndex;
|
||||
source?.Count > 0 && i >= 0 && i < source?.Count && i <= displayEndLineIndex;
|
||||
@@ -359,7 +430,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
control,
|
||||
line?.Text,
|
||||
_textFormat,
|
||||
(float)LimitedLineWidth,
|
||||
(float)_limitedLineWidthTransition.Value,
|
||||
(float)control.Size.Height
|
||||
);
|
||||
|
||||
@@ -377,11 +448,11 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
break;
|
||||
case LyricsAlignmentType.Center:
|
||||
textLayout.HorizontalAlignment = CanvasHorizontalAlignment.Center;
|
||||
centerX += (float)LimitedLineWidth / 2;
|
||||
centerX += (float)_limitedLineWidthTransition.Value / 2;
|
||||
break;
|
||||
case LyricsAlignmentType.Right:
|
||||
textLayout.HorizontalAlignment = CanvasHorizontalAlignment.Right;
|
||||
centerX += (float)LimitedLineWidth;
|
||||
centerX += (float)_limitedLineWidthTransition.Value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -463,8 +534,10 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
ds.Transform =
|
||||
Matrix3x2.CreateScale(line.Scale, new Vector2(centerX, centerY))
|
||||
* Matrix3x2.CreateTranslation(
|
||||
(float)(control.Size.Width - _rightMargin - LimitedLineWidth),
|
||||
_totalYScroll + (float)(control.Size.Height / 2)
|
||||
(float)(
|
||||
control.Size.Width - _rightMargin - _limitedLineWidthTransition.Value
|
||||
),
|
||||
_canvasYScrollTransition.Value + (float)(control.Size.Height / 2)
|
||||
);
|
||||
|
||||
ds.DrawTextLayout(textLayout, position, Colors.Transparent);
|
||||
@@ -533,13 +606,17 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
Color = withGradient
|
||||
? Color.FromArgb(
|
||||
211,
|
||||
_currentBgColor.R,
|
||||
_currentBgColor.G,
|
||||
_currentBgColor.B
|
||||
_immersiveBgrTransition.Value.R,
|
||||
_immersiveBgrTransition.Value.G,
|
||||
_immersiveBgrTransition.Value.B
|
||||
)
|
||||
: _currentBgColor,
|
||||
: _immersiveBgrTransition.Value,
|
||||
},
|
||||
new CanvasGradientStop
|
||||
{
|
||||
Position = 1,
|
||||
Color = _immersiveBgrTransition.Value,
|
||||
},
|
||||
new CanvasGradientStop { Position = 1, Color = _currentBgColor },
|
||||
]
|
||||
)
|
||||
{
|
||||
@@ -556,14 +633,30 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
var overlappedCovers = new CanvasCommandList(control.Device);
|
||||
using var overlappedCoversDs = overlappedCovers.CreateDrawingSession();
|
||||
|
||||
if (_isTransitioning && _lastSoftwareBitmap != null)
|
||||
if (_albumArtBgTransition.IsTransitioning)
|
||||
{
|
||||
DrawImgae(control, overlappedCoversDs, _lastSoftwareBitmap, 1 - _transitionAlpha);
|
||||
DrawImgae(control, overlappedCoversDs, SoftwareBitmap, _transitionAlpha);
|
||||
if (_lastAlbumArtBitmap != null)
|
||||
{
|
||||
DrawImgae(
|
||||
control,
|
||||
overlappedCoversDs,
|
||||
_lastAlbumArtBitmap,
|
||||
1 - _albumArtBgTransition.Value
|
||||
);
|
||||
}
|
||||
if (_albumArtBitmap != null)
|
||||
{
|
||||
DrawImgae(
|
||||
control,
|
||||
overlappedCoversDs,
|
||||
_albumArtBitmap,
|
||||
_albumArtBgTransition.Value
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (_albumArtBitmap != null)
|
||||
{
|
||||
DrawImgae(control, overlappedCoversDs, SoftwareBitmap, 1);
|
||||
DrawImgae(control, overlappedCoversDs, _albumArtBitmap, 1f);
|
||||
}
|
||||
|
||||
using var coverOverlayEffect = new OpacityEffect
|
||||
@@ -582,15 +675,14 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
public void Draw(ICanvasAnimatedControl control, CanvasDrawingSession ds)
|
||||
{
|
||||
bool isAlbumArtOverlayDrawn = IsCoverOverlayEnabled && SoftwareBitmap != null;
|
||||
if (isAlbumArtOverlayDrawn)
|
||||
if (IsCoverOverlayEnabled)
|
||||
{
|
||||
DrawAlbumArtBackground(control, ds);
|
||||
}
|
||||
|
||||
if (IsDockMode)
|
||||
{
|
||||
DrawImmersiveBackground(control, ds, isAlbumArtOverlayDrawn);
|
||||
DrawImmersiveBackground(control, ds, IsCoverOverlayEnabled);
|
||||
}
|
||||
|
||||
// Original lyrics only layer
|
||||
@@ -607,7 +699,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
DrawLyrics(
|
||||
control,
|
||||
lyricsDs,
|
||||
SongInfo?.LyricsLines,
|
||||
_multiLangLyrics.SafeGet(_langIndex),
|
||||
_defaultOpacity,
|
||||
LyricsHighlightType.LineByLine
|
||||
);
|
||||
@@ -769,6 +861,10 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
ds.FillRectangle(new Rect(0, 0, control.Size.Width, control.Size.Height), maskBrush);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reassigns positions (x,y) to lyrics lines based on the current control size and font size.
|
||||
/// </summary>
|
||||
/// <param name="control"></param>
|
||||
private void ReLayout(ICanvasAnimatedControl control)
|
||||
{
|
||||
if (control == null)
|
||||
@@ -779,16 +875,21 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
float y = _topMargin;
|
||||
|
||||
// Init Positions
|
||||
for (int i = 0; i < SongInfo?.LyricsLines?.Count; i++)
|
||||
for (int i = 0; i < _multiLangLyrics.SafeGet(_langIndex)?.Count; i++)
|
||||
{
|
||||
var line = SongInfo?.LyricsLines?[i];
|
||||
var line = _multiLangLyrics[_langIndex].SafeGet(i);
|
||||
|
||||
if (line == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Calculate layout bounds
|
||||
using var textLayout = new CanvasTextLayout(
|
||||
control,
|
||||
line.Text,
|
||||
_textFormat,
|
||||
(float)LimitedLineWidth,
|
||||
(float)_limitedLineWidthTransition.Value,
|
||||
(float)control.Size.Height
|
||||
);
|
||||
line.Position = new Vector2(0, y);
|
||||
@@ -800,47 +901,23 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public override void Calculate(
|
||||
ICanvasAnimatedControl control,
|
||||
CanvasAnimatedUpdateEventArgs args
|
||||
)
|
||||
public void Update(ICanvasAnimatedControl control, CanvasAnimatedUpdateEventArgs args)
|
||||
{
|
||||
base.Calculate(control, args);
|
||||
|
||||
if (_isColorTransitioning)
|
||||
if (_isPlaying)
|
||||
{
|
||||
_colorTransitionProgress +=
|
||||
(float)ElapsedTime.TotalSeconds / ColorTransitionDuration;
|
||||
if (_colorTransitionProgress >= 1f)
|
||||
{
|
||||
_colorTransitionProgress = 1f;
|
||||
_isColorTransitioning = false;
|
||||
_currentBgColor = _targetBgColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentBgColor = Helper.ColorHelper.GetInterpolatedColor(
|
||||
_colorTransitionProgress,
|
||||
_currentBgColor,
|
||||
_targetBgColor
|
||||
);
|
||||
}
|
||||
TotalTime += args.Timing.ElapsedTime;
|
||||
}
|
||||
|
||||
if (_isTransitioning)
|
||||
{
|
||||
var elapsed = DateTimeOffset.Now - _transitionStartTime;
|
||||
float progress = (float)(
|
||||
elapsed.TotalMilliseconds / _transitionDuration.TotalMilliseconds
|
||||
);
|
||||
_transitionAlpha = Math.Clamp(progress, 0f, 1f);
|
||||
ElapsedTime = args.Timing.ElapsedTime;
|
||||
|
||||
if (_transitionAlpha >= 1f)
|
||||
{
|
||||
_isTransitioning = false;
|
||||
_lastSoftwareBitmap?.Dispose();
|
||||
_lastSoftwareBitmap = null;
|
||||
}
|
||||
if (_immersiveBgrTransition.IsTransitioning)
|
||||
{
|
||||
_immersiveBgrTransition.Update(ElapsedTime);
|
||||
}
|
||||
|
||||
if (_albumArtBgTransition.IsTransitioning)
|
||||
{
|
||||
_albumArtBgTransition.Update(ElapsedTime);
|
||||
}
|
||||
|
||||
if (IsDynamicCoverOverlayEnabled)
|
||||
@@ -849,31 +926,37 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
_rotateAngle %= MathF.PI * 2;
|
||||
}
|
||||
|
||||
if (_limitedLineWidthTransition.IsTransitioning)
|
||||
{
|
||||
_limitedLineWidthTransition.Update(ElapsedTime);
|
||||
_isRelayoutNeeded = true;
|
||||
}
|
||||
|
||||
if (_isRelayoutNeeded)
|
||||
{
|
||||
ReLayout(control);
|
||||
_isRelayoutNeeded = false;
|
||||
_forceToScroll = true;
|
||||
}
|
||||
|
||||
int currentPlayingLineIndex = GetCurrentPlayingLineIndex();
|
||||
|
||||
CalculateLinesProps(SongInfo?.LyricsLines, currentPlayingLineIndex, _defaultOpacity);
|
||||
CalculateCanvasYScrollOffset(control, currentPlayingLineIndex);
|
||||
UpdateLinesProps(_multiLangLyrics.SafeGet(_langIndex), _defaultOpacity);
|
||||
UpdateCanvasYScrollOffset(control);
|
||||
|
||||
if (IsLyricsGlowEffectEnabled)
|
||||
{
|
||||
// Deep copy lyrics lines for glow effect
|
||||
_lyricsForGlowEffect = SongInfo?.LyricsLines?.Select(line => line.Clone()).ToList();
|
||||
_lyricsForGlowEffect = _multiLangLyrics
|
||||
.SafeGet(_langIndex)
|
||||
?.Select(line => line.Clone())
|
||||
.ToList();
|
||||
switch (LyricsGlowEffectScope)
|
||||
{
|
||||
case LyricsGlowEffectScope.WholeLyrics:
|
||||
break;
|
||||
case LyricsGlowEffectScope.CurrentLine:
|
||||
CalculateLinesProps(_lyricsForGlowEffect, currentPlayingLineIndex, 0);
|
||||
UpdateLinesProps(_lyricsForGlowEffect, 0);
|
||||
break;
|
||||
case LyricsGlowEffectScope.CurrentChar:
|
||||
CalculateLinesProps(_lyricsForGlowEffect, currentPlayingLineIndex, 0);
|
||||
UpdateLinesProps(_lyricsForGlowEffect, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -881,17 +964,75 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateLinesProps(
|
||||
List<LyricsLine>? source,
|
||||
int currentPlayingLineIndex,
|
||||
float defaultOpacity
|
||||
)
|
||||
private float GetLinePlayingProgress(LyricsLine line)
|
||||
{
|
||||
float playProgress = 0f;
|
||||
int now = (int)TotalTime.TotalMilliseconds;
|
||||
|
||||
if (line.CharTimings != null && line.CharTimings.Count > 0)
|
||||
{
|
||||
int charIndex = 0;
|
||||
for (; charIndex < line.CharTimings.Count; charIndex++)
|
||||
{
|
||||
var timing = line.CharTimings[charIndex];
|
||||
if (now < timing.StartMs)
|
||||
{
|
||||
// 当前时间还没到这个字,停在上一个字
|
||||
break;
|
||||
}
|
||||
if (now >= timing.StartMs && now <= timing.EndMs)
|
||||
{
|
||||
float charProgress = 1f;
|
||||
if (timing.EndMs != timing.StartMs)
|
||||
{
|
||||
charProgress =
|
||||
(now - timing.StartMs) / (float)(timing.EndMs - timing.StartMs);
|
||||
}
|
||||
// 当前时间在这个字的高亮区间
|
||||
playProgress = charIndex + charProgress;
|
||||
playProgress /= line.CharTimings.Count;
|
||||
return playProgress;
|
||||
}
|
||||
}
|
||||
// 如果超出最后一个字的结束时间
|
||||
if (now > line.CharTimings[^1].EndMs)
|
||||
{
|
||||
// 如果还没到行尾,保持最后一个字高亮
|
||||
if (now < line.EndMs)
|
||||
{
|
||||
playProgress = 1f; // 全部字高亮
|
||||
}
|
||||
else
|
||||
{
|
||||
playProgress = 1f; // 行已结束
|
||||
}
|
||||
}
|
||||
else if (charIndex == 0)
|
||||
{
|
||||
playProgress = 0f; // 还没到第一个字
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
playProgress = (now - line.StartMs) / (float)(line.DurationMs);
|
||||
}
|
||||
return playProgress;
|
||||
}
|
||||
|
||||
private void UpdateLinesProps(List<LyricsLine>? source, float defaultOpacity)
|
||||
{
|
||||
var (startLineIndex, endLineIndex) = GetMaxLyricsLineIndexBoundaries();
|
||||
|
||||
for (int i = startLineIndex; source?.Count > 0 && i <= endLineIndex; i++)
|
||||
var currentPlayingLineIndex = GetCurrentPlayingLineIndex();
|
||||
|
||||
for (int i = startLineIndex; i <= endLineIndex; i++)
|
||||
{
|
||||
var line = source?[i];
|
||||
var line = source?.SafeGet(i);
|
||||
|
||||
if (line == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool linePlaying = i == currentPlayingLineIndex;
|
||||
|
||||
@@ -923,12 +1064,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
scale = _highlightedScale;
|
||||
opacity = _highlightedOpacity;
|
||||
|
||||
playProgress =
|
||||
((float)TotalTime.TotalMilliseconds - line.StartPlayingTimestampMs)
|
||||
/ line.DurationMs;
|
||||
playProgress = GetLinePlayingProgress(line);
|
||||
|
||||
var durationFromStartMs =
|
||||
TotalTime.TotalMilliseconds - line.StartPlayingTimestampMs;
|
||||
var durationFromStartMs = TotalTime.TotalMilliseconds - line.StartMs;
|
||||
lineEntering = durationFromStartMs <= lineEnteringDurationMs;
|
||||
if (lineEntering)
|
||||
{
|
||||
@@ -948,8 +1086,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
line.PlayingState = LyricsPlayingState.Played;
|
||||
playProgress = 1;
|
||||
|
||||
var durationToEndMs =
|
||||
TotalTime.TotalMilliseconds - line.EndPlayingTimestampMs;
|
||||
var durationToEndMs = TotalTime.TotalMilliseconds - line.EndMs;
|
||||
lineExiting = durationToEndMs <= lineExitingDurationMs;
|
||||
if (lineExiting)
|
||||
{
|
||||
@@ -979,11 +1116,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateCanvasYScrollOffset(
|
||||
ICanvasAnimatedControl control,
|
||||
int currentPlayingLineIndex
|
||||
)
|
||||
private void UpdateCanvasYScrollOffset(ICanvasAnimatedControl control)
|
||||
{
|
||||
var currentPlayingLineIndex = GetCurrentPlayingLineIndex();
|
||||
if (currentPlayingLineIndex < 0)
|
||||
{
|
||||
return;
|
||||
@@ -997,7 +1132,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
|
||||
// Set _scrollOffsetY
|
||||
LyricsLine? currentPlayingLine = SongInfo?.LyricsLines?[currentPlayingLineIndex];
|
||||
LyricsLine? currentPlayingLine = _multiLangLyrics
|
||||
.SafeGet(_langIndex)
|
||||
?[currentPlayingLineIndex];
|
||||
|
||||
if (currentPlayingLine == null)
|
||||
{
|
||||
@@ -1008,63 +1145,49 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
control,
|
||||
currentPlayingLine.Text,
|
||||
_textFormat,
|
||||
(float)LimitedLineWidth,
|
||||
(float)_limitedLineWidthTransition.Value,
|
||||
(float)control.Size.Height
|
||||
);
|
||||
|
||||
var lineScrollingProgress =
|
||||
(TotalTime.TotalMilliseconds - currentPlayingLine.StartPlayingTimestampMs)
|
||||
/ Math.Min(_lineScrollDurationMs, currentPlayingLine.DurationMs);
|
||||
|
||||
float targetYScrollOffset =
|
||||
(float?)(
|
||||
-currentPlayingLine.Position.Y
|
||||
+ SongInfo?.LyricsLines?[0].Position.Y
|
||||
+ _multiLangLyrics.SafeGet(_langIndex)?[0].Position.Y
|
||||
- playingTextLayout.LayoutBounds.Height / 2
|
||||
- _lastTotalYScroll
|
||||
) ?? 0f;
|
||||
|
||||
var yScrollOffset =
|
||||
targetYScrollOffset
|
||||
* EasingHelper.SmootherStep((float)Math.Min(1, lineScrollingProgress));
|
||||
|
||||
bool isScrollingNow = lineScrollingProgress <= 1;
|
||||
|
||||
if (isScrollingNow)
|
||||
if (!_canvasYScrollTransition.IsTransitioning)
|
||||
{
|
||||
_totalYScroll = _lastTotalYScroll + yScrollOffset;
|
||||
_canvasYScrollTransition.StartTransition(targetYScrollOffset);
|
||||
}
|
||||
else
|
||||
|
||||
if (_canvasYScrollTransition.IsTransitioning)
|
||||
{
|
||||
if (_forceToScroll && Math.Abs(targetYScrollOffset) >= 1)
|
||||
{
|
||||
_totalYScroll = _lastTotalYScroll + targetYScrollOffset;
|
||||
_forceToScroll = false;
|
||||
}
|
||||
_lastTotalYScroll = _totalYScroll;
|
||||
_canvasYScrollTransition.Update(ElapsedTime);
|
||||
}
|
||||
|
||||
_startVisibleLineIndex = _endVisibleLineIndex = -1;
|
||||
|
||||
// Update visible line indices
|
||||
for (
|
||||
int i = startLineIndex;
|
||||
i >= 0 && i <= endLineIndex && i < SongInfo?.LyricsLines?.Count;
|
||||
i++
|
||||
)
|
||||
for (int i = startLineIndex; i <= endLineIndex; i++)
|
||||
{
|
||||
var line = SongInfo?.LyricsLines?[i];
|
||||
var line = _multiLangLyrics.SafeGet(_langIndex)?.SafeGet(i);
|
||||
|
||||
if (line == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
using var textLayout = new CanvasTextLayout(
|
||||
control,
|
||||
line.Text,
|
||||
line?.Text,
|
||||
_textFormat,
|
||||
(float)LimitedLineWidth,
|
||||
(float)_limitedLineWidthTransition.Value,
|
||||
(float)control.Size.Height
|
||||
);
|
||||
|
||||
if (
|
||||
_totalYScroll
|
||||
_canvasYScrollTransition.Value
|
||||
+ (float)(control.Size.Height / 2)
|
||||
+ line.Position.Y
|
||||
+ textLayout.LayoutBounds.Height
|
||||
@@ -1077,7 +1200,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
}
|
||||
if (
|
||||
_totalYScroll
|
||||
_canvasYScrollTransition.Value
|
||||
+ (float)(control.Size.Height / 2)
|
||||
+ line.Position.Y
|
||||
+ textLayout.LayoutBounds.Height
|
||||
@@ -1261,7 +1384,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
if (message.PropertyName == nameof(LyricsPageViewModel.LimitedLineWidth))
|
||||
{
|
||||
LimitedLineWidth = message.NewValue;
|
||||
_limitedLineWidthTransition.StartTransition((float)message.NewValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1302,17 +1425,33 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
if (message.PropertyName == nameof(HostWindowViewModel.ActivatedWindowAccentColor))
|
||||
{
|
||||
_currentBgColor = _isColorTransitioning
|
||||
? Helper.ColorHelper.GetInterpolatedColor(
|
||||
_colorTransitionProgress,
|
||||
_currentBgColor,
|
||||
_targetBgColor
|
||||
)
|
||||
: ActivatedWindowAccentColor;
|
||||
_targetBgColor = message.NewValue;
|
||||
_colorTransitionProgress = 0f;
|
||||
_isColorTransitioning = true;
|
||||
ActivatedWindowAccentColor = message.NewValue;
|
||||
_immersiveBgrTransition.StartTransition(message.NewValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(
|
||||
PropertyChangedMessage<ObservableCollection<LyricsSearchProviderInfo>> message
|
||||
)
|
||||
{
|
||||
if (message.Sender is SettingsViewModel)
|
||||
{
|
||||
if (message.PropertyName == nameof(SettingsViewModel.LyricsSearchProvidersInfo))
|
||||
{
|
||||
// Lyrics search providers info changed, re-fetch lyrics
|
||||
RefreshLyricsAsync().ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(PropertyChangedMessage<ObservableCollection<LocalLyricsFolder>> message)
|
||||
{
|
||||
if (message.Sender is SettingsViewModel)
|
||||
{
|
||||
if (message.PropertyName == nameof(SettingsViewModel.LocalLyricsFolders))
|
||||
{
|
||||
// Music lib changed, re-fetch lyrics
|
||||
RefreshLyricsAsync().ConfigureAwait(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Services.Playback;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Microsoft.UI;
|
||||
using Windows.UI;
|
||||
|
||||
namespace BetterInAppLyrics.WinUI3.ViewModels
|
||||
{
|
||||
|
||||
@@ -2,38 +2,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Messages;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Services.Database;
|
||||
using BetterLyrics.WinUI3.Services.Playback;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.ApplicationModel.Core;
|
||||
using Windows.Globalization;
|
||||
using Windows.Media;
|
||||
using Windows.Media.Playback;
|
||||
using Windows.System;
|
||||
using Windows.UI;
|
||||
using WinRT.Interop;
|
||||
using WinUIEx.Messaging;
|
||||
|
||||
namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
public partial class SettingsViewModel : ObservableRecipient
|
||||
{
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedRecipients]
|
||||
public partial bool IsRebuildingLyricsIndexDatabase { get; set; } = false;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedRecipients]
|
||||
public partial ElementTheme ThemeType { get; set; }
|
||||
@@ -49,9 +41,12 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
[ObservableProperty]
|
||||
public partial AutoStartWindowType AutoStartWindowType { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial ObservableCollection<LocalLyricsFolder> LocalLyricsFolders { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedRecipients]
|
||||
public partial ObservableCollection<string> MusicLibraries { get; set; }
|
||||
public partial ObservableCollection<LyricsSearchProviderInfo> LyricsSearchProvidersInfo { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedRecipients]
|
||||
@@ -73,26 +68,51 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
[NotifyPropertyChangedRecipients]
|
||||
public partial int CoverOverlayBlurAmount { get; set; }
|
||||
|
||||
partial void OnMusicLibrariesChanged(
|
||||
ObservableCollection<string> oldValue,
|
||||
ObservableCollection<string> newValue
|
||||
)
|
||||
{
|
||||
if (oldValue != null)
|
||||
{
|
||||
oldValue.CollectionChanged -= (_, _) =>
|
||||
_settingsService.MusicLibraries = [.. MusicLibraries];
|
||||
}
|
||||
if (newValue != null)
|
||||
{
|
||||
newValue.CollectionChanged += (_, _) =>
|
||||
_settingsService.MusicLibraries = [.. MusicLibraries];
|
||||
}
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
public partial Enums.Language Language { get; set; }
|
||||
|
||||
public string Version { get; set; } = AppInfo.AppVersion;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial object NavViewSelectedItemTag { get; set; } = "LyricsLib";
|
||||
|
||||
[ObservableProperty]
|
||||
public partial Thickness RootGridMargin { get; set; } = new(0, 0, 0, 0);
|
||||
|
||||
private readonly MediaPlayer _mediaPlayer = new();
|
||||
private readonly ISettingsService _settingsService;
|
||||
private readonly ILibWatcherService _libWatcherService;
|
||||
private readonly IPlaybackService _playbackService;
|
||||
|
||||
public SettingsViewModel(
|
||||
ISettingsService settingsService,
|
||||
ILibWatcherService libWatcherService,
|
||||
IPlaybackService playbackService
|
||||
)
|
||||
{
|
||||
_settingsService = settingsService;
|
||||
_libWatcherService = libWatcherService;
|
||||
_playbackService = playbackService;
|
||||
|
||||
RootGridMargin = new Thickness(0, _settingsService.TitleBarType.GetHeight(), 0, 0);
|
||||
|
||||
LocalLyricsFolders = [.. _settingsService.LocalLyricsFolders];
|
||||
LyricsSearchProvidersInfo = [.. _settingsService.LyricsSearchProvidersInfo];
|
||||
|
||||
Language = _settingsService.Language;
|
||||
CoverImageRadius = _settingsService.CoverImageRadius;
|
||||
ThemeType = _settingsService.ThemeType;
|
||||
BackdropType = _settingsService.BackdropType;
|
||||
TitleBarType = _settingsService.TitleBarType;
|
||||
|
||||
AutoStartWindowType = _settingsService.AutoStartWindowType;
|
||||
|
||||
IsCoverOverlayEnabled = _settingsService.IsCoverOverlayEnabled;
|
||||
IsDynamicCoverOverlayEnabled = _settingsService.IsDynamicCoverOverlayEnabled;
|
||||
CoverOverlayOpacity = _settingsService.CoverOverlayOpacity;
|
||||
CoverOverlayBlurAmount = _settingsService.CoverOverlayBlurAmount;
|
||||
}
|
||||
|
||||
partial void OnLanguageChanged(Enums.Language value)
|
||||
{
|
||||
switch (value)
|
||||
@@ -109,52 +129,18 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
case Enums.Language.TraditionalChinese:
|
||||
ApplicationLanguages.PrimaryLanguageOverride = "zh-TW";
|
||||
break;
|
||||
case Enums.Language.Japanese:
|
||||
ApplicationLanguages.PrimaryLanguageOverride = "ja-JP";
|
||||
break;
|
||||
case Enums.Language.Korean:
|
||||
ApplicationLanguages.PrimaryLanguageOverride = "ko-KR";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_settingsService.Language = Language;
|
||||
}
|
||||
|
||||
private readonly MediaPlayer _mediaPlayer = new();
|
||||
|
||||
private readonly IDatabaseService _databaseService;
|
||||
private readonly ISettingsService _settingsService;
|
||||
|
||||
public string Version { get; set; } = AppInfo.AppVersion;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial object NavViewSelectedItemTag { get; set; } = "LyricsLib";
|
||||
|
||||
[ObservableProperty]
|
||||
public partial Thickness RootGridMargin { get; set; } = new(0, 0, 0, 0);
|
||||
|
||||
public SettingsViewModel(IDatabaseService databaseService, ISettingsService settingsService)
|
||||
{
|
||||
_databaseService = databaseService;
|
||||
_settingsService = settingsService;
|
||||
|
||||
RootGridMargin = new Thickness(0, _settingsService.TitleBarType.GetHeight(), 0, 0);
|
||||
|
||||
MusicLibraries = [.. _settingsService.MusicLibraries];
|
||||
Language = _settingsService.Language;
|
||||
CoverImageRadius = _settingsService.CoverImageRadius;
|
||||
ThemeType = _settingsService.ThemeType;
|
||||
BackdropType = _settingsService.BackdropType;
|
||||
TitleBarType = _settingsService.TitleBarType;
|
||||
|
||||
AutoStartWindowType = _settingsService.AutoStartWindowType;
|
||||
|
||||
IsCoverOverlayEnabled = _settingsService.IsCoverOverlayEnabled;
|
||||
IsDynamicCoverOverlayEnabled = _settingsService.IsDynamicCoverOverlayEnabled;
|
||||
CoverOverlayOpacity = _settingsService.CoverOverlayOpacity;
|
||||
CoverOverlayBlurAmount = _settingsService.CoverOverlayBlurAmount;
|
||||
}
|
||||
|
||||
partial void OnMusicLibrariesChanged(ObservableCollection<string> value)
|
||||
{
|
||||
_settingsService.MusicLibraries = [.. value];
|
||||
}
|
||||
|
||||
partial void OnThemeTypeChanged(ElementTheme value)
|
||||
{
|
||||
_settingsService.ThemeType = value;
|
||||
@@ -201,18 +187,22 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
_settingsService.CoverOverlayBlurAmount = value;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task RebuildLyricsIndexDatabaseAsync()
|
||||
public void RemoveFolderAsync(LocalLyricsFolder folder)
|
||||
{
|
||||
IsRebuildingLyricsIndexDatabase = true;
|
||||
await _databaseService.RebuildDatabaseAsync(MusicLibraries);
|
||||
IsRebuildingLyricsIndexDatabase = false;
|
||||
LocalLyricsFolders.Remove(folder);
|
||||
_settingsService.LocalLyricsFolders = [.. LocalLyricsFolders];
|
||||
_libWatcherService.UpdateWatchers([.. LocalLyricsFolders]);
|
||||
Broadcast(LocalLyricsFolders, LocalLyricsFolders, nameof(LocalLyricsFolders));
|
||||
}
|
||||
|
||||
public async Task RemoveFolderAsync(string path)
|
||||
public void OnLyricsSearchProvidersReordered()
|
||||
{
|
||||
MusicLibraries.Remove(path);
|
||||
await RebuildLyricsIndexDatabaseAsync();
|
||||
_settingsService.LyricsSearchProvidersInfo = [.. LyricsSearchProvidersInfo];
|
||||
Broadcast(
|
||||
LyricsSearchProvidersInfo,
|
||||
LyricsSearchProvidersInfo,
|
||||
nameof(LyricsSearchProvidersInfo)
|
||||
);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -229,27 +219,26 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
if (folder != null)
|
||||
{
|
||||
if (MusicLibraries.Any((item) => folder.Path.StartsWith(item)))
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(
|
||||
new ShowNotificatonMessage(
|
||||
new Notification(
|
||||
App.ResourceLoader!.GetString("SettingsPagePathBeIncludedInfo")
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
await AddFolderAsync(folder.Path);
|
||||
}
|
||||
AddFolderAsync(folder.Path);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task AddFolderAsync(string path)
|
||||
private void AddFolderAsync(string path)
|
||||
{
|
||||
bool existed = MusicLibraries.Any((x) => x == path);
|
||||
if (existed)
|
||||
var normalizedPath =
|
||||
Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar)
|
||||
+ Path.DirectorySeparatorChar;
|
||||
|
||||
if (
|
||||
LocalLyricsFolders.Any(x =>
|
||||
Path.GetFullPath(x.Path)
|
||||
.TrimEnd(Path.DirectorySeparatorChar)
|
||||
.Equals(
|
||||
normalizedPath.TrimEnd(Path.DirectorySeparatorChar),
|
||||
StringComparison.OrdinalIgnoreCase
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(
|
||||
new ShowNotificatonMessage(
|
||||
@@ -259,17 +248,55 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (
|
||||
LocalLyricsFolders.Any(item =>
|
||||
normalizedPath.StartsWith(
|
||||
Path.GetFullPath(item.Path).TrimEnd(Path.DirectorySeparatorChar)
|
||||
+ Path.DirectorySeparatorChar,
|
||||
StringComparison.OrdinalIgnoreCase
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
// 添加的文件夹是现有文件夹的子文件夹
|
||||
WeakReferenceMessenger.Default.Send(
|
||||
new ShowNotificatonMessage(
|
||||
new Notification(
|
||||
App.ResourceLoader!.GetString("SettingsPagePathBeIncludedInfo")
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (
|
||||
LocalLyricsFolders.Any(item =>
|
||||
Path.GetFullPath(item.Path)
|
||||
.TrimEnd(Path.DirectorySeparatorChar)
|
||||
.StartsWith(normalizedPath, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
)
|
||||
{
|
||||
// 添加的文件夹是现有文件夹的父文件夹
|
||||
WeakReferenceMessenger.Default.Send(
|
||||
new ShowNotificatonMessage(
|
||||
new Notification(
|
||||
App.ResourceLoader!.GetString("SettingsPagePathIncludingOthersInfo")
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
MusicLibraries.Add(path);
|
||||
await RebuildLyricsIndexDatabaseAsync();
|
||||
LocalLyricsFolders.Add(new LocalLyricsFolder(path, true));
|
||||
_settingsService.LocalLyricsFolders = [.. LocalLyricsFolders];
|
||||
_libWatcherService.UpdateWatchers([.. LocalLyricsFolders]);
|
||||
Broadcast(LocalLyricsFolders, LocalLyricsFolders, nameof(LocalLyricsFolders));
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task LaunchProjectGitHubPageAsync()
|
||||
{
|
||||
await Launcher.LaunchUriAsync(new Uri(Helper.AppInfo.GithubUrl));
|
||||
await Launcher.LaunchUriAsync(new Uri(AppInfo.GithubUrl));
|
||||
}
|
||||
|
||||
private void OpenFolderInFileExplorer(string path)
|
||||
@@ -284,9 +311,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
);
|
||||
}
|
||||
|
||||
public void OpenMusicFolder(string path)
|
||||
public void OpenMusicFolder(LocalLyricsFolder folder)
|
||||
{
|
||||
OpenFolderInFileExplorer(path);
|
||||
OpenFolderInFileExplorer(folder.Path);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -311,9 +338,9 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task PlayTestingMusicTask()
|
||||
private void PlayTestingMusicTask()
|
||||
{
|
||||
await AddFolderAsync(AppInfo.AssetsFolder);
|
||||
AddFolderAsync(AppInfo.AssetsFolder);
|
||||
_mediaPlayer.SetUriSource(new Uri(AppInfo.TestMusicPath));
|
||||
_mediaPlayer.Play();
|
||||
}
|
||||
@@ -323,5 +350,21 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
OpenFolderInFileExplorer(AppInfo.LogDirectory);
|
||||
}
|
||||
|
||||
public void ToggleLyricsSearchProvider(LyricsSearchProviderInfo providerInfo)
|
||||
{
|
||||
_settingsService.LyricsSearchProvidersInfo = [.. LyricsSearchProvidersInfo];
|
||||
Broadcast(
|
||||
LyricsSearchProvidersInfo,
|
||||
LyricsSearchProvidersInfo,
|
||||
nameof(LyricsSearchProvidersInfo)
|
||||
);
|
||||
}
|
||||
|
||||
public void ToggleLocalLyricsFolder(LocalLyricsFolder folder)
|
||||
{
|
||||
_settingsService.LocalLyricsFolders = [.. LocalLyricsFolders];
|
||||
Broadcast(LocalLyricsFolders, LocalLyricsFolders, nameof(LocalLyricsFolders));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid x:Name="RootGrid" RequestedTheme="{x:Bind ViewModel.ThemeType, Mode=OneWay}">
|
||||
<Grid
|
||||
x:Name="RootGrid"
|
||||
PointerMoved="RootGrid_PointerMoved"
|
||||
RequestedTheme="{x:Bind ViewModel.ThemeType, Mode=OneWay}">
|
||||
|
||||
<Frame
|
||||
x:Name="RootFrame"
|
||||
@@ -25,8 +28,7 @@
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
Opacity="0"
|
||||
PointerEntered="TopCommandGrid_PointerEntered"
|
||||
PointerExited="TopCommandGrid_PointerExited">
|
||||
PointerMoved="TopCommandGrid_PointerMoved">
|
||||
<Grid.OpacityTransition>
|
||||
<ScalarTransition />
|
||||
</Grid.OpacityTransition>
|
||||
|
||||
@@ -3,7 +3,7 @@ using BetterInAppLyrics.WinUI3.ViewModels;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Helper;
|
||||
using BetterLyrics.WinUI3.Messages;
|
||||
using BetterLyrics.WinUI3.Services.Settings;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
@@ -162,6 +162,7 @@ namespace BetterLyrics.WinUI3.Views
|
||||
RestoreButton.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
TopCommandGrid.Opacity = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -220,21 +221,32 @@ namespace BetterLyrics.WinUI3.Views
|
||||
}
|
||||
}
|
||||
|
||||
private void TopCommandGrid_PointerEntered(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
if (TopCommandGrid.Opacity == 0)
|
||||
TopCommandGrid.Opacity = .5;
|
||||
}
|
||||
|
||||
private void TopCommandGrid_PointerExited(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
if (TopCommandGrid.Opacity == .5)
|
||||
TopCommandGrid.Opacity = 0;
|
||||
}
|
||||
|
||||
private void SettingsMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowHelper.OpenSettingsWindow();
|
||||
}
|
||||
|
||||
private void TopCommandGrid_PointerMoved(object sender, PointerRoutedEventArgs e) { }
|
||||
|
||||
private void RootGrid_PointerMoved(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
var point = e.GetCurrentPoint(RootGrid);
|
||||
double y = point.Position.Y;
|
||||
|
||||
if (y >= 0 && y <= TopCommandGrid.ActualHeight + 5)
|
||||
{
|
||||
if (TopCommandGrid.Opacity == 0)
|
||||
{
|
||||
TopCommandGrid.Opacity = .5;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TopCommandGrid.Opacity == .5)
|
||||
{
|
||||
TopCommandGrid.Opacity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<renderer:LyricsRenderer />
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="36">
|
||||
<Grid Margin="36,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="36" />
|
||||
@@ -45,24 +45,34 @@
|
||||
<ScalarTransition />
|
||||
</Grid.OpacityTransition>
|
||||
<StackPanel
|
||||
x:Name="LyricsPlaceholderStackPanel"
|
||||
x:Name="LyricsNotFoundPlaceholder"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="12">
|
||||
<StackPanel.OpacityTransition>
|
||||
<ScalarTransition />
|
||||
</StackPanel.OpacityTransition>
|
||||
<FontIcon
|
||||
FontFamily="Segoe Fluent Icons"
|
||||
FontSize="{StaticResource DisplayTextBlockFontSize}"
|
||||
Glyph="" />
|
||||
<TextBlock x:Uid="MainPageLyricsNotFound" FontSize="{StaticResource TitleTextBlockFontSize}" />
|
||||
<TextBlock x:Uid="MainPageLyricsNotFound" FontSize="{x:Bind ViewModel.LyricsFontSize, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
x:Name="LyricsLoadingPlaceholder"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="12">
|
||||
<StackPanel.OpacityTransition>
|
||||
<ScalarTransition />
|
||||
</StackPanel.OpacityTransition>
|
||||
<TextBlock x:Uid="MainPageLyricsLoading" FontSize="{x:Bind ViewModel.LyricsFontSize, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Song info area -->
|
||||
<Grid x:Name="SongInfoInnerGrid">
|
||||
<Grid x:Name="SongInfoInnerGrid" Margin="0,36">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<!-- Cover area -->
|
||||
@@ -311,42 +321,6 @@
|
||||
<FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
<TextBlock Text="{x:Bind ViewModel.SongInfo.Artist, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||
<FontIcon FontFamily="Segoe Fluent Icons" Glyph="" />
|
||||
<ListView
|
||||
x:Name="MatchedFilesListView"
|
||||
ItemsSource="{x:Bind ViewModel.SongInfo.FilesFound, Mode=OneWay}"
|
||||
SelectionMode="None">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<HyperlinkButton
|
||||
VerticalAlignment="Center"
|
||||
Click="OpenMatchedFileButton_Click"
|
||||
RelativePanel.AlignLeftWithPanel="True"
|
||||
Tag="{Binding Mode=OneWay}">
|
||||
<TextBlock
|
||||
MaxWidth="300"
|
||||
Text="{Binding Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
</HyperlinkButton>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<TextBlock
|
||||
x:Name="NoLocalFilesMatchedTextBlock"
|
||||
x:Uid="MainPageNoLocalFilesMatched"
|
||||
Visibility="Collapsed" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
@@ -449,34 +423,32 @@
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="FilesMatchStates">
|
||||
<VisualState x:Name="Matched" />
|
||||
<VisualState x:Name="NotMatched">
|
||||
<VisualStateGroup x:Name="LyricsStatus">
|
||||
<VisualState x:Name="Loading">
|
||||
<VisualState.StateTriggers>
|
||||
<ui:IsNullOrEmptyStateTrigger Value="{x:Bind ViewModel.SongInfo.FilesFound, Mode=OneWay}" />
|
||||
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.LyricsStatus, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}" To="2" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NoLocalFilesMatchedTextBlock.Visibility" Value="Visible" />
|
||||
<Setter Target="MatchedFilesListView.Visibility" Value="Collapsed" />
|
||||
<Setter Target="LyricsNotFoundPlaceholder.Opacity" Value="0" />
|
||||
<Setter Target="LyricsLoadingPlaceholder.Opacity" Value=".5" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="LyricsExistenceStates">
|
||||
<VisualState x:Name="Existed">
|
||||
<VisualState x:Name="Found">
|
||||
<VisualState.StateTriggers>
|
||||
<StateTrigger IsActive="{x:Bind ViewModel.SongInfo.IsLyricsExisted, Mode=OneWay}" />
|
||||
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.LyricsStatus, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}" To="1" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="LyricsPlaceholderStackPanel.Opacity" Value="0" />
|
||||
<Setter Target="LyricsNotFoundPlaceholder.Opacity" Value="0" />
|
||||
<Setter Target="LyricsLoadingPlaceholder.Opacity" Value="0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="NotExisted">
|
||||
<VisualState x:Name="NotFound">
|
||||
<VisualState.StateTriggers>
|
||||
<StateTrigger IsActive="{x:Bind ViewModel.SongInfo.IsLyricsExisted, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
|
||||
<ui:IsEqualStateTrigger Value="{x:Bind ViewModel.LyricsStatus, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}" To="0" />
|
||||
</VisualState.StateTriggers>
|
||||
<VisualState.Setters>
|
||||
<Setter Target="LyricsPlaceholderStackPanel.Opacity" Value=".5" />
|
||||
<Setter Target="LyricsNotFoundPlaceholder.Opacity" Value=".5" />
|
||||
<Setter Target="LyricsLoadingPlaceholder.Opacity" Value="0" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
@@ -64,11 +64,6 @@ namespace BetterLyrics.WinUI3.Views
|
||||
ViewModel.LimitedLineWidth = e.NewSize.Width;
|
||||
}
|
||||
|
||||
private void OpenMatchedFileButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.OpenMatchedFileFolderInFileExplorer((string)(sender as HyperlinkButton)!.Tag);
|
||||
}
|
||||
|
||||
private void CoverImageGrid_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
ViewModel.CoverImageGridActualHeight = e.NewSize.Height;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:local="using:BetterLyrics.WinUI3.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="using:BetterLyrics.WinUI3.Models"
|
||||
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||
xmlns:vm="using:BetterLyrics.WinUI3.ViewModels"
|
||||
mc:Ignorable="d">
|
||||
@@ -73,21 +74,26 @@
|
||||
<controls:SettingsExpander
|
||||
x:Uid="SettingsPageMusicLib"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}"
|
||||
IsEnabled="{x:Bind ViewModel.IsRebuildingLyricsIndexDatabase, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
|
||||
IsExpanded="True"
|
||||
ItemsSource="{x:Bind ViewModel.MusicLibraries, Mode=OneWay}">
|
||||
ItemsSource="{x:Bind ViewModel.LocalLyricsFolders, Mode=OneWay}">
|
||||
<controls:SettingsExpander.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<controls:SettingsCard Header="{Binding}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<controls:SettingsCard>
|
||||
<controls:SettingsCard.Header>
|
||||
<HyperlinkButton
|
||||
x:Uid="SettingsPageOpenPath"
|
||||
Click="SettingsPageOpenPathButton_Click"
|
||||
Content="{Binding Path, Mode=OneWay}"
|
||||
Tag="{Binding}" />
|
||||
</controls:SettingsCard.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<HyperlinkButton
|
||||
x:Uid="SettingsPageRemovePath"
|
||||
Click="SettingsPageRemovePathButton_Click"
|
||||
Tag="{Binding}" />
|
||||
<ToggleSwitch
|
||||
DataContext="{Binding}"
|
||||
IsOn="{Binding IsEnabled, Mode=TwoWay}"
|
||||
Toggled="LocalLyricsFolderToggleSwitch_Toggled" />
|
||||
</StackPanel>
|
||||
</controls:SettingsCard>
|
||||
</DataTemplate>
|
||||
@@ -104,13 +110,13 @@
|
||||
<interactivity:Interaction.Behaviors>
|
||||
|
||||
<interactivity:DataTriggerBehavior
|
||||
Binding="{x:Bind ViewModel.MusicLibraries.Count, Mode=OneWay}"
|
||||
Binding="{x:Bind ViewModel.LocalLyricsFolders.Count, Mode=OneWay}"
|
||||
ComparisonCondition="Equal"
|
||||
Value="0">
|
||||
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||
</interactivity:DataTriggerBehavior>
|
||||
<interactivity:DataTriggerBehavior
|
||||
Binding="{x:Bind ViewModel.MusicLibraries.Count, Mode=OneWay}"
|
||||
Binding="{x:Bind ViewModel.LocalLyricsFolders.Count, Mode=OneWay}"
|
||||
ComparisonCondition="NotEqual"
|
||||
Value="0">
|
||||
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||
@@ -131,21 +137,38 @@
|
||||
</controls:SettingsExpander>
|
||||
|
||||
<controls:SettingsCard
|
||||
x:Uid="SettingsPageRebuildDatabase"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}"
|
||||
IsEnabled="{x:Bind ViewModel.IsRebuildingLyricsIndexDatabase, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
|
||||
<controls:SettingsCard.Description>
|
||||
<TextBlock x:Uid="SettingsPageRebuildDatabaseDesc" Visibility="{x:Bind ViewModel.IsRebuildingLyricsIndexDatabase, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||
</controls:SettingsCard.Description>
|
||||
<StackPanel>
|
||||
<Button x:Uid="SettingsPageRebuildDatabaseButton" Command="{x:Bind ViewModel.RebuildLyricsIndexDatabaseCommand}" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="True"
|
||||
ShowError="False"
|
||||
ShowPaused="False"
|
||||
Visibility="{x:Bind ViewModel.IsRebuildingLyricsIndexDatabase, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</controls:SettingsCard>
|
||||
x:Name="LyricsSearchProvidersSettingsExpander"
|
||||
x:Uid="SettingsPageLyricsSearchProvidersConfig"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}" />
|
||||
|
||||
<ListView
|
||||
x:Name="LyricsSearchProvidersListView"
|
||||
Margin="0,-4,0,0"
|
||||
AllowDrop="True"
|
||||
CanDragItems="True"
|
||||
CanReorderItems="True"
|
||||
DragItemsCompleted="LyricsSearchProvidersListView_DragItemsCompleted"
|
||||
ItemsSource="{x:Bind ViewModel.LyricsSearchProvidersInfo, Mode=OneWay}"
|
||||
SelectionMode="None">
|
||||
<ListView.OpacityTransition>
|
||||
<ScalarTransition />
|
||||
</ListView.OpacityTransition>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:LyricsSearchProviderInfo">
|
||||
<controls:SettingsCard Padding="60,0,48,0" Header="{Binding Provider, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}, Mode=OneWay}">
|
||||
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" Toggled="LyricsSearchProviderToggleSwitch_Toggled" />
|
||||
</controls:SettingsCard>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
</controls:Case>
|
||||
@@ -166,8 +189,6 @@
|
||||
<ComboBoxItem x:Uid="SettingsPageMica" />
|
||||
<ComboBoxItem x:Uid="SettingsPageMicaAlt" />
|
||||
<ComboBoxItem x:Uid="SettingsPageDesktopAcrylic" />
|
||||
<!--<ComboBoxItem x:Uid="SettingsPageAcrylicThin" />
|
||||
<ComboBoxItem x:Uid="SettingsPageAcrylicBase" />-->
|
||||
<ComboBoxItem x:Uid="SettingsPageTransparent" />
|
||||
</ComboBox>
|
||||
</controls:SettingsCard>
|
||||
@@ -188,6 +209,8 @@
|
||||
<ComboBoxItem x:Uid="SettingsPageEN" />
|
||||
<ComboBoxItem x:Uid="SettingsPageSC" />
|
||||
<ComboBoxItem x:Uid="SettingsPageTC" />
|
||||
<ComboBoxItem x:Uid="SettingsPageJA" />
|
||||
<ComboBoxItem x:Uid="SettingsPageKO" />
|
||||
</ComboBox>
|
||||
<controls:SettingsExpander.Items>
|
||||
<controls:SettingsCard>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using System.Threading.Tasks;
|
||||
using BetterInAppLyrics.WinUI3.ViewModels;
|
||||
using BetterLyrics.WinUI3.Enums;
|
||||
using BetterLyrics.WinUI3.Models;
|
||||
using BetterLyrics.WinUI3.Services;
|
||||
using BetterLyrics.WinUI3.ViewModels;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
@@ -29,15 +33,15 @@ namespace BetterLyrics.WinUI3.Views
|
||||
Microsoft.UI.Xaml.RoutedEventArgs e
|
||||
)
|
||||
{
|
||||
ViewModel.OpenMusicFolder((string)(sender as HyperlinkButton)!.Tag);
|
||||
ViewModel.OpenMusicFolder((LocalLyricsFolder)(sender as HyperlinkButton)!.Tag);
|
||||
}
|
||||
|
||||
private async void SettingsPageRemovePathButton_Click(
|
||||
private void SettingsPageRemovePathButton_Click(
|
||||
object sender,
|
||||
Microsoft.UI.Xaml.RoutedEventArgs e
|
||||
)
|
||||
{
|
||||
await ViewModel.RemoveFolderAsync((string)(sender as HyperlinkButton)!.Tag);
|
||||
ViewModel.RemoveFolderAsync((LocalLyricsFolder)(sender as HyperlinkButton)!.Tag);
|
||||
}
|
||||
|
||||
private void NavView_SelectionChanged(
|
||||
@@ -47,5 +51,35 @@ namespace BetterLyrics.WinUI3.Views
|
||||
{
|
||||
ViewModel.NavViewSelectedItemTag = (args.SelectedItem as NavigationViewItem)!.Tag;
|
||||
}
|
||||
|
||||
private void LyricsSearchProviderToggleSwitch_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ToggleSwitch toggleSwitch)
|
||||
{
|
||||
if (toggleSwitch.DataContext is LyricsSearchProviderInfo providerInfo)
|
||||
{
|
||||
ViewModel.ToggleLyricsSearchProvider(providerInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LyricsSearchProvidersListView_DragItemsCompleted(
|
||||
ListViewBase sender,
|
||||
DragItemsCompletedEventArgs args
|
||||
)
|
||||
{
|
||||
ViewModel.OnLyricsSearchProvidersReordered();
|
||||
}
|
||||
|
||||
private void LocalLyricsFolderToggleSwitch_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ToggleSwitch toggleSwitch)
|
||||
{
|
||||
if (toggleSwitch.DataContext is LocalLyricsFolder localLyricsFolder)
|
||||
{
|
||||
ViewModel.ToggleLocalLyricsFolder(localLyricsFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
188
README.CN.md
Normal file
188
README.CN.md
Normal file
@@ -0,0 +1,188 @@
|
||||
<a href="https://github.com/jayfunc/BetterLyrics/blob/dev/README.md">_**Click here to see the English version**_</a>
|
||||
|
||||
<div align="center">
|
||||
<img src="BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Logo.png" alt="" width="64"/>
|
||||
</div>
|
||||
|
||||
<h2 align="center">
|
||||
BetterLyrics
|
||||
</h2>
|
||||
|
||||
<h3 align="center">
|
||||
基于 WinUI 3 打造的流畅动态本地歌词显示工具
|
||||
</h3>
|
||||
|
||||
---
|
||||
|
||||
## 亮点
|
||||
|
||||
- 支持将模糊专辑封面设为背景
|
||||
- 歌词淡入淡出、缩放等动画流畅自然
|
||||
- 切换歌曲时界面无缝过渡
|
||||
- 支持每个字符的渐变卡拉OK(发光)效果
|
||||
- 沉浸式桌面歌词(Dock 模式)
|
||||
|
||||
> 项目仍在开发中,`dev` 分支可能存在 bug。
|
||||
|
||||
---
|
||||
|
||||
## 支持的歌词源
|
||||
|
||||
- 本地歌词:
|
||||
- 音乐文件内嵌歌词(通过 [Audio Tools Library (ATL) for .NET](https://github.com/Zeugma440/atldotnet) 读取和解析)
|
||||
- `.lrc` 文件
|
||||
|
||||
- 在线歌词源:
|
||||
- [LRCLIB](https://lrclib.net/)
|
||||
- QQ 音乐(通过 [Lyricify-Lyrics-Helper](https://github.com/WXRIW/Lyricify-Lyrics-Helper) 获取和解码)
|
||||
|
||||
---
|
||||
|
||||
## 多种个性化设置选项
|
||||
|
||||
提供了丰富的自定义项:
|
||||
|
||||
- 主题模式(浅色、深色、跟随系统)
|
||||
- 背景样式(无、Mica 云母、Acrylic 亚克力、透明)
|
||||
- 专辑封面背景(动态显示、模糊程度、透明度)
|
||||
- 歌词样式(对齐方式、字体大小、颜色 **(从专辑封面中提取主题色)**、行间距、透明度、模糊强度、动态**发光**特效)
|
||||
- 语言(英文、简体中文、繁体中文)
|
||||
|
||||
---
|
||||
|
||||
## 软件截图
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
## 演示视频
|
||||
|
||||
观看我们的介绍视频「BetterLyrics 阶段性开发成果展示」(上传于 2025 年 5 月 31 日):
|
||||
[点此观看 B 站视频](https://b23.tv/QjKkYmL)
|
||||
|
||||
---
|
||||
|
||||
## 立即体验
|
||||
|
||||
### 稳定版本
|
||||
|
||||
<a href="https://apps.microsoft.com/detail/9P1WCD1P597R?referrer=appbadge&mode=direct">
|
||||
<img src="https://get.microsoft.com/images/en-us%20dark.svg" width="200"/>
|
||||
</a>
|
||||
|
||||
> **推荐方式**,**永久免费试用或购买**(免费与付费功能上无差别,若喜欢可购买支持作者)
|
||||
|
||||
也可从 Google Drive 下载(详见 [release 页面](https://github.com/jayfunc/BetterLyrics/releases/latest))
|
||||
|
||||
> 注意:这是一个 `.zip` 压缩包,请参考[安装指南](How2Install/How2Install.md)进行安装。
|
||||
|
||||
### 最新开发版本
|
||||
|
||||
可通过 `git clone` 克隆本仓库后自行构建运行。
|
||||
|
||||
---
|
||||
|
||||
## 播放器适配说明
|
||||
|
||||
本项目通过监听 [SMTC](https://learn.microsoft.com/en-ca/windows/uwp/audio-video-camera/integrate-with-systemmediatransportcontrols) 获取当前播放歌曲信息。
|
||||
理论上,**只要你的播放器支持 SMTC 控件**,加载本地音乐或歌词后即可使用。
|
||||
|
||||
兼容性良好的播放器包括但不限于:
|
||||
|
||||
- Spotify
|
||||
- Groove 音乐
|
||||
- Apple Music
|
||||
- Windows 媒体播放器
|
||||
- VLC
|
||||
- QQ 音乐
|
||||
- 酷狗音乐
|
||||
- 酷我音乐
|
||||
|
||||
>(注:未测试全部播放器,如有异常欢迎反馈 issue)
|
||||
|
||||
---
|
||||
|
||||
## 后续工作
|
||||
|
||||
敬请期待。
|
||||
|
||||
---
|
||||
|
||||
## 特别感谢
|
||||
|
||||
- [LRCLIB](https://lrclib.net/)
|
||||
- 在线歌词 API 提供源
|
||||
- [Audio Tools Library (ATL) for .NET](https://github.com/Zeugma440/atldotnet)
|
||||
- 本地音频元信息读取
|
||||
- [WinUIEx](https://github.com/dotMorten/WinUIEx)
|
||||
- 简化 Win32 窗口操作
|
||||
- [TagLib#](https://github.com/mono/taglib-sharp)
|
||||
- 曾用作元信息解析库
|
||||
- [Stackoverflow - WPF 动画 Margin 属性](https://stackoverflow.com/a/21542882/11048731)
|
||||
- [DevWinUI](https://github.com/ghost1372/DevWinUI)
|
||||
- [Bilibili -【WinUI3】SystemBackdropController 教程](https://www.bilibili.com/video/BV1PY4FevEkS)
|
||||
- [博客园 - .NET App 与 SMTC 交互](https://www.cnblogs.com/TwilightLemon/p/18279496)
|
||||
- [Win2D 游戏循环教程](https://www.cnblogs.com/walterlv/p/10236395.html)
|
||||
- [Win2D Iris Blur 示例](https://github.com/r2d2rigo/Win2D-Samples/blob/master/IrisBlurWin2D/IrisBlurWin2D/MainPage.xaml.cs)
|
||||
- [CommunityToolkit - 教程合集](https://mvvm.coldwind.top/)
|
||||
|
||||
---
|
||||
|
||||
## 灵感来源
|
||||
|
||||
- [refined-now-playing-netease](https://github.com/solstice23/refined-now-playing-netease)
|
||||
- [Lyricify-App](https://github.com/WXRIW/Lyricify-App)
|
||||
- [椒盐音乐 Salt Player](https://moriafly.com/program/salt-player)
|
||||
- [MyToolBar](https://github.com/TwilightLemon/MyToolBar)
|
||||
|
||||
---
|
||||
|
||||
## 使用的第三方库
|
||||
|
||||
```xml
|
||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.MarqueeText" Version="0.1.230830" />
|
||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.OpacityMaskView" Version="0.1.250513-build.2126" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
||||
<PackageReference Include="Lyricify.Lyrics.Helper" Version="0.1.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.6" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.6" />
|
||||
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
||||
<PackageReference Include="WinUIEx" Version="2.5.1" />
|
||||
<PackageReference Include="z440.atl.core" Version="6.25.0" />
|
||||
```
|
||||
|
||||
## Star 历史
|
||||
|
||||
[](https://www.star-history.com/#jayfunc/BetterLyrics&Date)
|
||||
|
||||
## 欢迎提出反馈或建议
|
||||
|
||||
感谢。
|
||||
|
||||
|
||||
141
README.md
141
README.md
@@ -1,3 +1,5 @@
|
||||
<a href="https://github.com/jayfunc/BetterLyrics/blob/dev/README.CN.md">_**点此处查看中文说明**_</a>
|
||||
|
||||
<div align="center">
|
||||
<img src="BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Logo.png" alt="" width="64"/>
|
||||
</div>
|
||||
@@ -17,24 +19,63 @@ Your smooth dynamic local lyrics display built with WinUI 3
|
||||
- Dynamic blur album art as background
|
||||
- Smooth lyrics fade in/out, zoom in/out effects
|
||||
- Smooth user interface change from song to song
|
||||
- Gradient Karaoke effect on every single character
|
||||
- Immersive desktop lyrics
|
||||
- Gradient Karaoke (with glow) effect on every single character
|
||||
- Immersive desktop lyrics (dock mode)
|
||||
|
||||
> This project is still under development now, bugs and unexpected behaviors may be existed in the latest dev branch.
|
||||
|
||||
## Supported lyrics source
|
||||
|
||||
- From your local storage
|
||||
- Music files (with embedded lyrics)
|
||||
- [.lrc](https://en.wikipedia.org/wiki/LRC_(file_format)) files (with both core format and enhanced format)
|
||||
- [.eslrc](https://github.com/ESLyric/release) files
|
||||
- [.ttml](https://en.wikipedia.org/wiki/Timed_Text_Markup_Language) files
|
||||
|
||||
- From online lyrics providers
|
||||
- [LRCLIB](https://lrclib.net/)
|
||||
|
||||
## Customize in your way
|
||||
|
||||
We provide more than one setting item to better align with your preference
|
||||
|
||||
- Theme (light, dark, follow system)
|
||||
- Theme
|
||||
- Light
|
||||
- Dark
|
||||
- Follow system
|
||||
|
||||
- Backdrop (none, mica, acrylic, transparent)
|
||||
- Backdrop
|
||||
- None
|
||||
- Mica
|
||||
- Acrylic
|
||||
- Transparent
|
||||
|
||||
- Album art as background (dynamic, blur amount, opacity)
|
||||
- Album art as background
|
||||
- Dynamic
|
||||
- Blur amount
|
||||
- Opacity
|
||||
|
||||
- Lyrics (alignment, font size, font color **(picked from album art accent color)** line spacing, opacity, blur amount, dynamic **glow** effect)
|
||||
- Album art as cover
|
||||
- Corner radius
|
||||
|
||||
- Language (English, Simplified Chinese, Traditional Chinese)
|
||||
- Lyrics
|
||||
- Alignment
|
||||
- Font size
|
||||
- Font color **(from album art accent color)**
|
||||
- Line spacing
|
||||
- Opacity
|
||||
- Blur amount
|
||||
- Dynamic **glow** effect
|
||||
- Whole lyrics
|
||||
- Line by line
|
||||
- Word by word
|
||||
|
||||
- Language
|
||||
- English
|
||||
- Simplified Chinese
|
||||
- Traditional Chinese
|
||||
- Japanese
|
||||
- Korean
|
||||
|
||||
|
||||
## Screenshots
|
||||
@@ -43,8 +84,14 @@ We provide more than one setting item to better align with your preference
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
@@ -53,7 +100,7 @@ We provide more than one setting item to better align with your preference
|
||||
|
||||
## Demonstration
|
||||
|
||||
Watch our introduction video「BetterLyrics 阶段性开发成果展示」(uploaded on 31 May 2025) on Bilibili [here](https://b23.tv/QjKkYmL).
|
||||
Watch our introduction video (uploaded on 31 May 2025) on Bilibili [here](https://b23.tv/QjKkYmL).
|
||||
|
||||
## Try it now
|
||||
|
||||
@@ -75,38 +122,33 @@ You can `git clone` this project and build it yourself.
|
||||
|
||||
## Setup your app
|
||||
|
||||
This project relies on listening messages from [SMTC](https://learn.microsoft.com/en-ca/windows/uwp/audio-video-camera/integrate-with-systemmediatransportcontrols).
|
||||
So technically, as long as you are using the music apps (like
|
||||
This project relies on listening messages from [SMTC](https://learn.microsoft.com/en-ca/windows/uwp/audio-video-camera/integrate-with-systemmediatransportcontrols), so most of the music players will work.
|
||||
|
||||
- Spotify
|
||||
- Groove Music
|
||||
- Apple Music
|
||||
- Windows Media Player
|
||||
- VLC Media Player
|
||||
- QQ 音乐
|
||||
- 网易云音乐
|
||||
- 酷狗音乐
|
||||
- 酷我音乐
|
||||
### About lyrics
|
||||
|
||||
) which support SMTC, then possibly (I didn't test all of themif you find one fail to listen to, you can open an issue) all you need to do is just load your local music/lyrics lib and you are good to go.
|
||||
For a better experience, you can use [LDDC](https://github.com/chenmozhijin/LDDC) to download lyrics.
|
||||
|
||||
## Future work
|
||||
|
||||
- Watching file changes
|
||||
When you downloading lyrics (using some other tools or your own scripts) while listening to new musics (non-existed on your local disks), this app can automatically load those new files.
|
||||
|
||||
> Please note: we are not planning support directly load lyrics files via some music software APIs due to copyright issues.
|
||||
To be added later.
|
||||
|
||||
## Many thanks to
|
||||
|
||||
- [LRCLIB](https://lrclib.net/)
|
||||
- Online lyrics API provider
|
||||
- [Audio Tools Library (ATL) for .NET](https://github.com/Zeugma440/atldotnet)
|
||||
- [DevWinUI](https://github.com/ghost1372/DevWinUI)
|
||||
- [Stackoverflow - How to animate Margin property in WPF](https://stackoverflow.com/a/21542882/11048731)
|
||||
- Used for extracting pictures in music files
|
||||
- [WinUIEx](https://github.com/dotMorten/WinUIEx)
|
||||
- Provide easy ways to access Win32 API regarding windowing
|
||||
- [TagLib#](https://github.com/mono/taglib-sharp)
|
||||
- Used for reading original lyrics content
|
||||
- [Stackoverflow - How to animate Margin property in WPF](https://stackoverflow.com/a/21542882/11048731)
|
||||
- [DevWinUI](https://github.com/ghost1372/DevWinUI)
|
||||
- [Bilibili -【WinUI3】SystemBackdropController:定义云母、亚克力效果](https://www.bilibili.com/video/BV1PY4FevEkS)
|
||||
- [cnblogs - .NET App 与 Windows 系统媒体控制(SMTC)交互](https://www.cnblogs.com/TwilightLemon/p/18279496)
|
||||
- [Win2D 中的游戏循环:CanvasAnimatedControl](https://www.cnblogs.com/walterlv/p/10236395.html)
|
||||
- [r2d2rigo/Win2D-Samples](https://github.com/r2d2rigo/Win2D-Samples/blob/master/IrisBlurWin2D/IrisBlurWin2D/MainPage.xaml.cs)
|
||||
- [CommunityToolkit - 从入门到精通](https://mvvm.coldwind.top/)
|
||||
|
||||
## Inspired by
|
||||
|
||||
@@ -118,33 +160,24 @@ So technically, as long as you are using the music apps (like
|
||||
## Third-party libraries that this project uses
|
||||
|
||||
```
|
||||
CommunityToolkit.Labs.WinUI.MarqueeText
|
||||
CommunityToolkit.Labs.WinUI.OpacityMaskView
|
||||
CommunityToolkit.Mvvm
|
||||
CommunityToolkit.WinUI.Behaviors
|
||||
CommunityToolkit.WinUI.Controls.Primitives
|
||||
CommunityToolkit.WinUI.Controls.Segmented
|
||||
CommunityToolkit.WinUI.Controls.SettingsControls
|
||||
CommunityToolkit.WinUI.Converters
|
||||
CommunityToolkit.WinUI.Extensions
|
||||
CommunityToolkit.WinUI.Helpers
|
||||
CommunityToolkit.WinUI.Media
|
||||
Microsoft.Extensions.DependencyInjection
|
||||
Microsoft.Extensions.Logging
|
||||
Microsoft.Graphics.Win2D
|
||||
Microsoft.Windows.SDK.BuildTools
|
||||
Microsoft.WindowsAppSDK
|
||||
Microsoft.Xaml.Behaviors.WinUI.Managed
|
||||
Newtonsoft.Json
|
||||
Serilog.Extensions.Logging
|
||||
Serilog.Sinks.File
|
||||
sqlite-net-pcl
|
||||
System.Drawing.Common
|
||||
System.Text.Encoding.CodePages
|
||||
Ude.NetStandard
|
||||
WinUIEx
|
||||
z440.atl.core
|
||||
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.6" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.6" />
|
||||
<PackageReference Include="TagLibSharp" Version="2.3.0" />
|
||||
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
||||
<PackageReference Include="WinUIEx" Version="2.5.1" />
|
||||
<PackageReference Include="z440.atl.core" Version="6.26.0" />S
|
||||
```
|
||||
|
||||
## Star History
|
||||
@@ -153,4 +186,4 @@ z440.atl.core
|
||||
|
||||
## Any issues and PRs are welcomed
|
||||
|
||||
If you find a bug please file it in issues or if you have any ideas feel free to share it here.
|
||||
If you find a bug please file it in issues or if you have any ideas feel free to share it here.
|
||||
|
||||
BIN
Screenshots/dock.gif
Normal file
BIN
Screenshots/dock.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
BIN
Screenshots/glow.gif
Normal file
BIN
Screenshots/glow.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 MiB |
BIN
Screenshots/immersive-dock.gif
Normal file
BIN
Screenshots/immersive-dock.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 MiB |
Reference in New Issue
Block a user