Compare commits
296 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfc877f924 | ||
|
|
af55446004 | ||
|
|
faf8acf669 | ||
|
|
5b79a54117 | ||
|
|
4ef55f6ece | ||
|
|
0593f9aa3f | ||
|
|
b09a6494ff | ||
|
|
b043f9acd0 | ||
|
|
7b2ff0cc8f | ||
|
|
7c9ab73a34 | ||
|
|
a08bf91784 | ||
|
|
61906670fd | ||
|
|
430b2f4d28 | ||
|
|
eb05c1ea13 | ||
|
|
9bebf36e6a | ||
|
|
d2b0b6afb1 | ||
|
|
9c2f4fbff9 | ||
|
|
1b69493afd | ||
|
|
c524dc013c | ||
|
|
9ca5939e57 | ||
|
|
860abd4037 | ||
|
|
618415016f | ||
|
|
bfcba1425d | ||
|
|
0dc9ebf18e | ||
|
|
366d396b93 | ||
|
|
35ca28ac7b | ||
|
|
1505933107 | ||
|
|
958227d0f2 | ||
|
|
b1978fec09 | ||
|
|
010040b376 | ||
|
|
35272d8324 | ||
|
|
29a714fe87 | ||
|
|
78edc2b3ce | ||
|
|
932f9d3a4f | ||
|
|
a56a7af08c | ||
|
|
5427c1992f | ||
|
|
64d69f44c3 | ||
|
|
d75fe4b27a | ||
|
|
eac9b3e28a | ||
|
|
d6975ba2d4 | ||
|
|
aae8e1322a | ||
|
|
88aac0eaf0 | ||
|
|
c463d9bc5c | ||
|
|
f305b469f2 | ||
|
|
ea276f3e2e | ||
|
|
15601e6ee4 | ||
|
|
44b14cab17 | ||
|
|
0a97c56c77 | ||
|
|
ac5dc5991f | ||
|
|
d22dc673e8 | ||
|
|
9eb2b83796 | ||
|
|
1cf6226a06 | ||
|
|
bce330a9e0 | ||
|
|
687e286c2e | ||
|
|
fc05035053 | ||
|
|
f45f5ead01 | ||
|
|
0eeea77896 | ||
|
|
78ca7d8435 | ||
|
|
98d2ac404d | ||
|
|
b4b1ffd58e | ||
|
|
2522bd00ab | ||
|
|
0601039fcf | ||
|
|
857b95e525 | ||
|
|
4be855f11a | ||
|
|
9e1018770d | ||
|
|
1235a09d19 | ||
|
|
1647c3a2f1 | ||
|
|
588838acaa | ||
|
|
25c772434c | ||
|
|
2c597a3b37 | ||
|
|
80a44977a6 | ||
|
|
0389fa6a56 | ||
|
|
30ca476d8d | ||
|
|
6439dee5ef | ||
|
|
f6e5a24fe4 | ||
|
|
77aad546bc | ||
|
|
7fdbe664ba | ||
|
|
df76074ce9 | ||
|
|
31939630a3 | ||
|
|
50500626f8 | ||
|
|
fb1f0c8fc7 | ||
|
|
9036b3be5f | ||
|
|
51f840c0ef | ||
|
|
b3a98cdaa2 | ||
|
|
7799a8dd94 | ||
|
|
e84d1faf71 | ||
|
|
66f0fd0f8f | ||
|
|
4f0dbe4836 | ||
|
|
d7a53e360a | ||
|
|
cb76341666 | ||
|
|
537584e557 | ||
|
|
e06a50d8e8 | ||
|
|
01776ed9a8 | ||
|
|
1b7f53c055 | ||
|
|
3233d35a05 | ||
|
|
ee52dafa0b | ||
|
|
03ddf42152 | ||
|
|
bb4ee6bae7 | ||
|
|
cb5a9f8042 | ||
|
|
1d5d3bfa72 | ||
|
|
06379ebaba | ||
|
|
45eb2a1506 | ||
|
|
0e96c35d2d | ||
|
|
152ecc7ff0 | ||
|
|
8b38aa1e33 | ||
|
|
79e6995384 | ||
|
|
1d6e19a718 | ||
|
|
23cb4b11a9 | ||
|
|
11461a615b | ||
|
|
e8f0359fb2 | ||
|
|
eba81e8be3 | ||
|
|
2e0d437b08 | ||
|
|
cbb0b87392 | ||
|
|
3f63043150 | ||
|
|
77f2474562 | ||
|
|
8aa5c392df | ||
|
|
a453f4862d | ||
|
|
0e6702f3c3 | ||
|
|
412cdbdaf4 | ||
|
|
02dbbf983c | ||
|
|
8cf9830644 | ||
|
|
b04dfedf7e | ||
|
|
3d4e3209e6 | ||
|
|
e92130af85 | ||
|
|
de3d6f1695 | ||
|
|
da377838e8 | ||
|
|
67cf6e47c8 | ||
|
|
abf4c3498f | ||
|
|
ff8c85b2d0 | ||
|
|
8cbdb32931 | ||
|
|
757f9f4156 | ||
|
|
c632f4b01a | ||
|
|
a843d0a0e3 | ||
|
|
905df92b05 | ||
|
|
7445299537 | ||
|
|
ba4958f837 | ||
|
|
8ca5245bf5 | ||
|
|
89aa97552a | ||
|
|
aa692e2735 | ||
|
|
c7ee26f284 | ||
|
|
b103e6efd1 | ||
|
|
16cd12e22b | ||
|
|
34bdbc89bc | ||
|
|
b649e9761d | ||
|
|
a9807f4f09 | ||
|
|
def287715d | ||
|
|
966f926112 | ||
|
|
4568293b51 | ||
|
|
10115ab0a8 | ||
|
|
ecefaedcb9 | ||
|
|
b9aae0866d | ||
|
|
afbfcc921e | ||
|
|
8f997ca3d9 | ||
|
|
042d557eb1 | ||
|
|
153679228d | ||
|
|
5a4fe54ac2 | ||
|
|
14e8d88cd1 | ||
|
|
79e726db33 | ||
|
|
d4f1949833 | ||
|
|
6135f996bf | ||
|
|
5b97621af4 | ||
|
|
0f084d04f8 | ||
|
|
bcb114a171 | ||
|
|
7bbe2a3045 | ||
|
|
fab4e8fe22 | ||
|
|
bc4a06577e | ||
|
|
22a790fff0 | ||
|
|
5e3d0cb78f | ||
|
|
59ee2a6fc3 | ||
|
|
fd5e752b43 | ||
|
|
df31d03da7 | ||
|
|
a7ebba4a62 | ||
|
|
6ca1a84a54 | ||
|
|
bab5a827f6 | ||
|
|
3b1e0389aa | ||
|
|
ae05a55d31 | ||
|
|
4b6d417db3 | ||
|
|
86118bac02 | ||
|
|
7bfbec4b01 | ||
|
|
a5d6dd1305 | ||
|
|
68f690e1a7 | ||
|
|
34d7f3f319 | ||
|
|
07b82191d0 | ||
|
|
f8c6060d32 | ||
|
|
bfdb36ff95 | ||
|
|
ce83777c1d | ||
|
|
d709e70fa2 | ||
|
|
8fe4f8fd58 | ||
|
|
b6319e522a | ||
|
|
58d74c1515 | ||
|
|
806f3fdd63 | ||
|
|
90d2055dff | ||
|
|
a29e5c98f8 | ||
|
|
78a6ba8e1f | ||
|
|
352ceca81d | ||
|
|
2f99d44b86 | ||
|
|
03386e72b2 | ||
|
|
54ba0a0c85 | ||
|
|
7bf8b2894d | ||
|
|
875da76e6b | ||
|
|
547ca6d631 | ||
|
|
60fb088bea | ||
|
|
3a89236af0 | ||
|
|
7d16bdbc88 | ||
|
|
812d23a101 | ||
|
|
4381a34191 | ||
|
|
6e21e5636b | ||
|
|
ff65429b16 | ||
|
|
ab03870b6a | ||
|
|
23bafc4d75 | ||
|
|
3bdce0d975 | ||
|
|
454edbeaba | ||
|
|
1e7e63032a | ||
|
|
0eca011054 | ||
|
|
68b7601b0f | ||
|
|
894fe935a5 | ||
|
|
0befdf48dd | ||
|
|
827602766d | ||
|
|
11c3002b77 | ||
|
|
9d193b7b71 | ||
|
|
811cd760d4 | ||
|
|
fe5039db78 | ||
|
|
a42a3cdb88 | ||
|
|
ee003e1764 | ||
|
|
749ab2ca1a | ||
|
|
4bbde71bfa | ||
|
|
7f3fbda237 | ||
|
|
06d2e19ee2 | ||
|
|
cbcb140bec | ||
|
|
bc8fd4de31 | ||
|
|
9e8bc3b7df | ||
|
|
f9070eed5d | ||
|
|
447533db12 | ||
|
|
1fe8675743 | ||
|
|
6775f9af57 | ||
|
|
bf9107754d | ||
|
|
906d8d7d49 | ||
|
|
517e026ca9 | ||
|
|
9535306a92 | ||
|
|
222ac42357 | ||
|
|
703fc26ceb | ||
|
|
52ae59154a | ||
|
|
82f22ac5d1 | ||
|
|
f0f74ba195 | ||
|
|
8e5e35ec23 | ||
|
|
0a63b6d8cd | ||
|
|
8b01e47c8e | ||
|
|
66d8705066 | ||
|
|
aa1f9f071f | ||
|
|
81c2f45f95 | ||
|
|
d5ae75e5a4 | ||
|
|
3ca2b90eff | ||
|
|
d1e48e95b7 | ||
|
|
12b78b374c | ||
|
|
cd857a2807 | ||
|
|
def2c9820a | ||
|
|
63c0577e73 | ||
|
|
e028ec2f0f | ||
|
|
4258ab6957 | ||
|
|
894081b097 | ||
|
|
772f41b236 | ||
|
|
e6db08c593 | ||
|
|
ea4a4ad072 | ||
|
|
b4bd479d3c | ||
|
|
9745b7e558 | ||
|
|
eb666fd8f2 | ||
|
|
2404c54bb6 | ||
|
|
221cd67c39 | ||
|
|
7c311972b5 | ||
|
|
9b42aebb56 | ||
|
|
e96320c9ad | ||
|
|
fdafb96852 | ||
|
|
cf5e4a7e8c | ||
|
|
4b4651bf6e | ||
|
|
a3e7503537 | ||
|
|
30fab426df | ||
|
|
7746a04bd9 | ||
|
|
a437f382cb | ||
|
|
852741bbfc | ||
|
|
7d839c655f | ||
|
|
ba8aad9831 | ||
|
|
2970b5e246 | ||
|
|
80a68b2612 | ||
|
|
088d2fa78b | ||
|
|
a4bc63d352 | ||
|
|
e8c428614a | ||
|
|
4f336282bb | ||
|
|
74daa48536 | ||
|
|
3dc14e52d8 | ||
|
|
1a736c13d5 | ||
|
|
377d68d83c | ||
|
|
f512e686b0 | ||
|
|
004dcbb4f4 | ||
|
|
1bfad8740c | ||
|
|
5b71f44bf3 | ||
|
|
81651abfec |
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [jayfunc]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
|
polar: # Replace with a single Polar username
|
||||||
|
buy_me_a_coffee: founchoo
|
||||||
|
thanks_dev: # Replace with a single thanks.dev username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
18
.github/workflows/issues-translator.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: 'issue-translator'
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: usthe/issues-translate-action@v2.7
|
||||||
|
with:
|
||||||
|
IS_MODIFY_TITLE: false
|
||||||
|
# not require, default false, . Decide whether to modify the issue title
|
||||||
|
# if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot.
|
||||||
|
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
|
||||||
|
# not require. Customize the translation robot prefix message.
|
||||||
28
.github/workflows/release-to-telegram.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Notify Telegram on GitHub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send release info to Telegram
|
||||||
|
env:
|
||||||
|
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||||
|
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||||
|
THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }}
|
||||||
|
RELEASE_URL: ${{ github.event.release.html_url }}
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
RELEASE_NAME: ${{ github.event.release.name }}
|
||||||
|
RELEASE_BODY: ${{ github.event.release.body }}
|
||||||
|
run: |
|
||||||
|
TEXT="🚀 *New Release:* ${RELEASE_TAG} - ${RELEASE_NAME}%0A"
|
||||||
|
TEXT+="📝 *Description:*%0A${RELEASE_BODY}%0A"
|
||||||
|
TEXT+="🔗 [View on GitHub](${RELEASE_URL})"
|
||||||
|
|
||||||
|
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
|
||||||
|
-d chat_id="${CHAT_ID}" \
|
||||||
|
-d message_thread_id="${THREAD_ID}" \
|
||||||
|
-d text="${TEXT}"
|
||||||
22
.github/workflows/releases-to-discord.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Notify Discord on GitHub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
github-releases-to-discord:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: GitHub Releases to Discord
|
||||||
|
uses: SethCohen/github-releases-to-discord@v1
|
||||||
|
with:
|
||||||
|
webhook_url: ${{ secrets.WEBHOOK_URL }}
|
||||||
|
color: "2105893"
|
||||||
|
username: "GitHub"
|
||||||
|
avatar_url: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png"
|
||||||
|
content: "||@everyone||"
|
||||||
|
footer_title: "Changelog"
|
||||||
|
reduce_headings: true
|
||||||
2
.gitignore
vendored
@@ -405,3 +405,5 @@ FodyWeavers.xsd
|
|||||||
|
|
||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
|
/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/BetterLyrics.WinUI3 (Package)_TemporaryKey.pfx
|
||||||
|
/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/LastFM.cs
|
||||||
|
|||||||
@@ -1,149 +1,150 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '15.0'">
|
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '15.0'">
|
||||||
<VisualStudioVersion>15.0</VisualStudioVersion>
|
<VisualStudioVersion>15.0</VisualStudioVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|x86">
|
<ProjectConfiguration Include="Debug|x86">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>x86</Platform>
|
<Platform>x86</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x86">
|
<ProjectConfiguration Include="Release|x86">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x86</Platform>
|
<Platform>x86</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x64">
|
<ProjectConfiguration Include="Release|x64">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Debug|ARM64">
|
<ProjectConfiguration Include="Debug|ARM64">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>ARM64</Platform>
|
<Platform>ARM64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|ARM64">
|
<ProjectConfiguration Include="Release|ARM64">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>ARM64</Platform>
|
<Platform>ARM64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
|
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
|
||||||
<PathToXAMLWinRTImplementations>BetterLyrics.WinUI3\</PathToXAMLWinRTImplementations>
|
<PathToXAMLWinRTImplementations>BetterLyrics.WinUI3\</PathToXAMLWinRTImplementations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
|
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>6576cd19-ef92-4099-b37d-e2d8ebdb6bf5</ProjectGuid>
|
<ProjectGuid>6576cd19-ef92-4099-b37d-e2d8ebdb6bf5</ProjectGuid>
|
||||||
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
|
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
|
||||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||||
<AssetTargetFallback>net8.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
|
<AssetTargetFallback>net8.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
|
||||||
<DefaultLanguage>zh-CN</DefaultLanguage>
|
<DefaultLanguage>zh-CN</DefaultLanguage>
|
||||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||||
<EntryPointProjectUniqueName>..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj</EntryPointProjectUniqueName>
|
<EntryPointProjectUniqueName>..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj</EntryPointProjectUniqueName>
|
||||||
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
||||||
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||||
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||||
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
|
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
|
||||||
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
||||||
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
|
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
|
||||||
<PackageCertificateKeyFile>BetterLyrics.WinUI3 %28Package%29_TemporaryKey.pfx</PackageCertificateKeyFile>
|
<PackageCertificateKeyFile>BetterLyrics.WinUI3 %28Package%29_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
<AppxBundle>Always</AppxBundle>
|
<AppxBundle>Always</AppxBundle>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AppxManifest Include="Package.appxmanifest">
|
<AppxManifest Include="Package.appxmanifest">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</AppxManifest>
|
</AppxManifest>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="BetterLyrics.WinUI3 %28Package%29_TemporaryKey.pfx" />
|
<None Include="BetterLyrics.WinUI3 %28Package%29_TemporaryKey.pfx" />
|
||||||
<Content Include="Images\LargeTile.scale-100.png" />
|
<Content Include="Images\LargeTile.scale-100.png" />
|
||||||
<Content Include="Images\LargeTile.scale-125.png" />
|
<Content Include="Images\LargeTile.scale-125.png" />
|
||||||
<Content Include="Images\LargeTile.scale-150.png" />
|
<Content Include="Images\LargeTile.scale-150.png" />
|
||||||
<Content Include="Images\LargeTile.scale-200.png" />
|
<Content Include="Images\LargeTile.scale-200.png" />
|
||||||
<Content Include="Images\LargeTile.scale-400.png" />
|
<Content Include="Images\LargeTile.scale-400.png" />
|
||||||
<Content Include="Images\SmallTile.scale-100.png" />
|
<Content Include="Images\SmallTile.scale-100.png" />
|
||||||
<Content Include="Images\SmallTile.scale-125.png" />
|
<Content Include="Images\SmallTile.scale-125.png" />
|
||||||
<Content Include="Images\SmallTile.scale-150.png" />
|
<Content Include="Images\SmallTile.scale-150.png" />
|
||||||
<Content Include="Images\SmallTile.scale-200.png" />
|
<Content Include="Images\SmallTile.scale-200.png" />
|
||||||
<Content Include="Images\SmallTile.scale-400.png" />
|
<Content Include="Images\SmallTile.scale-400.png" />
|
||||||
<Content Include="Images\SplashScreen.scale-100.png" />
|
<Content Include="Images\SplashScreen.scale-100.png" />
|
||||||
<Content Include="Images\SplashScreen.scale-125.png" />
|
<Content Include="Images\SplashScreen.scale-125.png" />
|
||||||
<Content Include="Images\SplashScreen.scale-150.png" />
|
<Content Include="Images\SplashScreen.scale-150.png" />
|
||||||
<Content Include="Images\SplashScreen.scale-200.png" />
|
<Content Include="Images\SplashScreen.scale-200.png" />
|
||||||
<Content Include="Images\LockScreenLogo.scale-200.png" />
|
<Content Include="Images\LockScreenLogo.scale-200.png" />
|
||||||
<Content Include="Images\SplashScreen.scale-400.png" />
|
<Content Include="Images\SplashScreen.scale-400.png" />
|
||||||
<Content Include="Images\Square150x150Logo.scale-100.png" />
|
<Content Include="Images\Square150x150Logo.scale-100.png" />
|
||||||
<Content Include="Images\Square150x150Logo.scale-125.png" />
|
<Content Include="Images\Square150x150Logo.scale-125.png" />
|
||||||
<Content Include="Images\Square150x150Logo.scale-150.png" />
|
<Content Include="Images\Square150x150Logo.scale-150.png" />
|
||||||
<Content Include="Images\Square150x150Logo.scale-200.png" />
|
<Content Include="Images\Square150x150Logo.scale-200.png" />
|
||||||
<Content Include="Images\Square150x150Logo.scale-400.png" />
|
<Content Include="Images\Square150x150Logo.scale-400.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
|
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
|
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
|
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
|
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
|
<Content Include="Images\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-16.png" />
|
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-16.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-256.png" />
|
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-256.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-32.png" />
|
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-32.png" />
|
||||||
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-48.png" />
|
<Content Include="Images\Square44x44Logo.altform-unplated_targetsize-48.png" />
|
||||||
<Content Include="Images\Square44x44Logo.scale-100.png" />
|
<Content Include="Images\Square44x44Logo.scale-100.png" />
|
||||||
<Content Include="Images\Square44x44Logo.scale-125.png" />
|
<Content Include="Images\Square44x44Logo.scale-125.png" />
|
||||||
<Content Include="Images\Square44x44Logo.scale-150.png" />
|
<Content Include="Images\Square44x44Logo.scale-150.png" />
|
||||||
<Content Include="Images\Square44x44Logo.scale-200.png" />
|
<Content Include="Images\Square44x44Logo.scale-200.png" />
|
||||||
<Content Include="Images\Square44x44Logo.scale-400.png" />
|
<Content Include="Images\Square44x44Logo.scale-400.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-16.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-16.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-24.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-24.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-256.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-256.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-32.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-32.png" />
|
||||||
<Content Include="Images\Square44x44Logo.targetsize-48.png" />
|
<Content Include="Images\Square44x44Logo.targetsize-48.png" />
|
||||||
<Content Include="Images\StoreLogo.scale-100.png" />
|
<Content Include="Images\StoreLogo.scale-100.png" />
|
||||||
<Content Include="Images\StoreLogo.scale-125.png" />
|
<Content Include="Images\StoreLogo.scale-125.png" />
|
||||||
<Content Include="Images\StoreLogo.scale-150.png" />
|
<Content Include="Images\StoreLogo.scale-150.png" />
|
||||||
<Content Include="Images\StoreLogo.scale-200.png" />
|
<Content Include="Images\StoreLogo.scale-200.png" />
|
||||||
<Content Include="Images\StoreLogo.scale-400.png" />
|
<Content Include="Images\StoreLogo.scale-400.png" />
|
||||||
<Content Include="Images\Wide310x150Logo.scale-100.png" />
|
<Content Include="Images\Wide310x150Logo.scale-100.png" />
|
||||||
<Content Include="Images\Wide310x150Logo.scale-125.png" />
|
<Content Include="Images\Wide310x150Logo.scale-125.png" />
|
||||||
<Content Include="Images\Wide310x150Logo.scale-150.png" />
|
<Content Include="Images\Wide310x150Logo.scale-150.png" />
|
||||||
<Content Include="Images\Wide310x150Logo.scale-200.png" />
|
<Content Include="Images\Wide310x150Logo.scale-200.png" />
|
||||||
<Content Include="Images\Wide310x150Logo.scale-400.png" />
|
<Content Include="Images\Wide310x150Logo.scale-400.png" />
|
||||||
<None Include="Package.StoreAssociation.xml" />
|
<None Include="Package.StoreAssociation.xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj">
|
<ProjectReference Include="..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj">
|
||||||
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
|
<EnableMsixTooling>true</EnableMsixTooling>
|
||||||
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
|
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
|
||||||
</ProjectReference>
|
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
|
||||||
</ItemGroup>
|
</ProjectReference>
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4654" />
|
||||||
</ItemGroup>
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
|
||||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
</ItemGroup>
|
||||||
|
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -5,50 +5,62 @@
|
|||||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
|
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
|
||||||
xmlns:uap18="http://schemas.microsoft.com/appx/manifest/uap/windows10/18"
|
xmlns:uap18="http://schemas.microsoft.com/appx/manifest/uap/windows10/18"
|
||||||
IgnorableNamespaces="uap rescap uap18">
|
IgnorableNamespaces="uap rescap uap18">
|
||||||
|
|
||||||
<Identity
|
<Identity
|
||||||
Name="37412.BetterLyrics"
|
Name="37412.BetterLyrics"
|
||||||
Publisher="CN=E1428B0E-DC1D-4EA4-ACB1-4556569D5BA9"
|
Publisher="CN=E1428B0E-DC1D-4EA4-ACB1-4556569D5BA9"
|
||||||
Version="1.0.2.0" />
|
Version="1.0.46.0" />
|
||||||
|
|
||||||
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>BetterLyrics</DisplayName>
|
<DisplayName>BetterLyrics</DisplayName>
|
||||||
<PublisherDisplayName>founchoo</PublisherDisplayName>
|
<PublisherDisplayName>founchoo</PublisherDisplayName>
|
||||||
<Logo>Images\StoreLogo.png</Logo>
|
<Logo>Images\StoreLogo.png</Logo>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
<Dependencies>
|
<Dependencies>
|
||||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
||||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
||||||
</Dependencies>
|
</Dependencies>
|
||||||
|
|
||||||
<Resources>
|
<Resources>
|
||||||
<Resource Language="en-US"/>
|
<Resource Language="en-US"/>
|
||||||
<Resource Language="zh-CN"/>
|
<Resource Language="zh-CN"/>
|
||||||
<Resource Language="zh-TW"/>
|
<Resource Language="zh-TW"/>
|
||||||
</Resources>
|
<Resource Language="ja-JP"/>
|
||||||
|
<Resource Language="ko-KR"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
<Applications>
|
<Applications>
|
||||||
<Application Id="App"
|
<Application Id="App"
|
||||||
Executable="$targetnametoken$.exe"
|
Executable="$targetnametoken$.exe"
|
||||||
EntryPoint="$targetentrypoint$">
|
EntryPoint="$targetentrypoint$">
|
||||||
<uap:VisualElements
|
<uap:VisualElements
|
||||||
DisplayName="BetterLyrics"
|
DisplayName="BetterLyrics"
|
||||||
Description="BetterLyrics.WinUI3 (Package)"
|
Description="BetterLyrics.WinUI3 (Package)"
|
||||||
BackgroundColor="transparent"
|
BackgroundColor="transparent"
|
||||||
Square150x150Logo="Images\Square150x150Logo.png"
|
Square150x150Logo="Images\Square150x150Logo.png"
|
||||||
Square44x44Logo="Images\Square44x44Logo.png">
|
Square44x44Logo="Images\Square44x44Logo.png">
|
||||||
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
||||||
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
||||||
</uap:VisualElements>
|
</uap:VisualElements>
|
||||||
</Application>
|
<Extensions>
|
||||||
</Applications>
|
<uap5:Extension
|
||||||
|
Category="windows.startupTask">
|
||||||
|
<uap5:StartupTask
|
||||||
|
TaskId="AutoStartup"
|
||||||
|
Enabled="false"
|
||||||
|
DisplayName="BetterLyrics" />
|
||||||
|
</uap5:Extension>
|
||||||
|
</Extensions>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
<Capabilities>
|
<Capabilities>
|
||||||
<rescap:Capability Name="runFullTrust" />
|
<rescap:Capability Name="runFullTrust" />
|
||||||
</Capabilities>
|
</Capabilities>
|
||||||
</Package>
|
</Package>
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converter="using:BetterLyrics.WinUI3.Converter"
|
xmlns:converter="using:BetterLyrics.WinUI3.Converter"
|
||||||
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
||||||
xmlns:local="using:BetterLyrics.WinUI3">
|
xmlns:local="using:BetterLyrics.WinUI3"
|
||||||
|
xmlns:media="using:CommunityToolkit.WinUI.Media">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsExpander/SettingsExpander.xaml" />
|
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsExpander/SettingsExpander.xaml" />
|
||||||
|
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.Segmented/Segmented/Segmented.xaml" />
|
||||||
<!-- Other merged dictionaries here -->
|
<!-- Other merged dictionaries here -->
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
@@ -40,15 +42,24 @@
|
|||||||
<ExponentialEase x:Key="EaseIn" EasingMode="EaseIn" />
|
<ExponentialEase x:Key="EaseIn" EasingMode="EaseIn" />
|
||||||
|
|
||||||
<!-- Converter -->
|
<!-- Converter -->
|
||||||
<converter:ThemeTypeToElementThemeConverter x:Key="ThemeTypeToElementThemeConverter" />
|
<converter:EnumToIntConverter x:Key="EnumToIntConverter" />
|
||||||
<converter:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
<converter:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||||
|
<converter:MatchedLocalFilesPathToVisibilityConverter x:Key="MatchedLocalFilesPathToVisibilityConverter" />
|
||||||
|
<converter:IntToCornerRadius x:Key="IntToCornerRadius" />
|
||||||
|
<converter:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />
|
||||||
|
<converter:LyricsSearchProviderToDisplayNameConverter x:Key="LyricsSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:TranslationSearchProviderToDisplayNameConverter x:Key="TranslationSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:AlbumArtSearchProviderToDisplayNameConverter x:Key="AlbumArtSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:SecondsToFormattedTimeConverter x:Key="SecondsToFormattedTimeConverter" />
|
||||||
|
<converter:MediaSourceProviderToLogoUriConverter x:Key="MediaSourceProviderToLogoUriConverter" />
|
||||||
|
<converter:MediaSourceProviderToDisplayedNameConverter x:Key="MediaSourceProviderToDisplayedNameConverter" />
|
||||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||||
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
||||||
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
||||||
|
|
||||||
<x:Double x:Key="SettingsCardSpacing">4</x:Double>
|
<x:Double x:Key="SettingsCardSpacing">4</x:Double>
|
||||||
|
|
||||||
<!-- Style (inc. the correct spacing) of a section header -->
|
<!-- Style -->
|
||||||
<Style
|
<Style
|
||||||
x:Key="SettingsSectionHeaderTextBlockStyle"
|
x:Key="SettingsSectionHeaderTextBlockStyle"
|
||||||
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
||||||
@@ -58,34 +69,254 @@
|
|||||||
</Style.Setters>
|
</Style.Setters>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
|
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Padding" Value="16,0" />
|
<Setter Property="Padding" Value="16,9,16,11" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="GhostButtonStyle" TargetType="Button">
|
<Style x:Key="GhostButtonStyle" TargetType="Button">
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Padding" Value="8" />
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="TitleBarToggleButtonStyle" TargetType="ToggleButton">
|
<Style
|
||||||
|
x:Key="TitleBarToggleButtonStyle"
|
||||||
|
BasedOn="{StaticResource ToggleButtonRevealStyle}"
|
||||||
|
TargetType="ToggleButton">
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Padding" Value="16,0" />
|
<Setter Property="Padding" Value="16,9,16,11" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="GhostToggleButtonStyle" TargetType="ToggleButton">
|
<Style x:Key="GhostToggleButtonStyle" TargetType="ToggleButton">
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="8" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style x:Key="CardGridStyle" TargetType="Grid">
|
||||||
|
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="CornerRadius" Value="6" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="GhostSliderStyle" TargetType="Slider">
|
||||||
|
<Setter Property="Background" Value="{ThemeResource ControlStrokeColorOnAccentDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" />
|
||||||
|
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
|
||||||
|
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||||
|
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||||
|
<Setter Property="ManipulationMode" Value="None" />
|
||||||
|
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
|
||||||
|
<Setter Property="FocusVisualMargin" Value="-7,0,-7,0" />
|
||||||
|
<Setter Property="IsFocusEngagementEnabled" Value="True" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Slider">
|
||||||
|
<Grid Margin="{TemplateBinding Padding}">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Style x:Key="SliderThumbStyle" TargetType="Thumb">
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Background" Value="{ThemeResource TextFillColorPrimaryBrush}" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Thumb">
|
||||||
|
<Border
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="0,1,1,0" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ContentPresenter
|
||||||
|
x:Name="HeaderContentPresenter"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="{ThemeResource SliderTopHeaderMargin}"
|
||||||
|
x:DeferLoadStrategy="Lazy"
|
||||||
|
Content="{TemplateBinding Header}"
|
||||||
|
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||||
|
FontWeight="{ThemeResource SliderHeaderThemeFontWeight}"
|
||||||
|
Foreground="{ThemeResource SliderHeaderForeground}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Grid
|
||||||
|
x:Name="SliderContainer"
|
||||||
|
Grid.Row="1"
|
||||||
|
Background="{ThemeResource SliderContainerBackground}"
|
||||||
|
Control.IsTemplateFocusTarget="True">
|
||||||
|
<Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="{ThemeResource SliderPreContentMargin}" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="{ThemeResource SliderPostContentMargin}" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Rectangle
|
||||||
|
x:Name="HorizontalTrackRect"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="2"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="HorizontalDecreaseRect"
|
||||||
|
Grid.Row="1"
|
||||||
|
Fill="{TemplateBinding Foreground}" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="TopTickBar"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,0,0,4"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="HorizontalInlineTickBar"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="2"
|
||||||
|
Fill="{ThemeResource SliderInlineTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="BottomTickBar"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Thumb
|
||||||
|
x:Name="HorizontalThumb"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="2"
|
||||||
|
Height="2"
|
||||||
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
|
DataContext="{TemplateBinding Value}"
|
||||||
|
FocusVisualMargin="-14,-6,-14,-6"
|
||||||
|
Style="{StaticResource SliderThumbStyle}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
x:Name="VerticalTemplate"
|
||||||
|
MinWidth="{ThemeResource SliderVerticalWidth}"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Rectangle
|
||||||
|
x:Name="VerticalTrackRect"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="{ThemeResource SliderTrackThemeHeight}"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="VerticalDecreaseRect"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Fill="{TemplateBinding Foreground}" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="LeftTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,0,4,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="VerticalInlineTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="{ThemeResource SliderTrackThemeHeight}"
|
||||||
|
Fill="{ThemeResource SliderInlineTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="RightTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="2"
|
||||||
|
Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Thumb
|
||||||
|
x:Name="VerticalThumb"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Width="24"
|
||||||
|
Height="8"
|
||||||
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
|
DataContext="{TemplateBinding Value}"
|
||||||
|
FocusVisualMargin="-6,-14,-6,-14"
|
||||||
|
Style="{StaticResource SliderThumbStyle}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ListViewStretchedItemContainerStyle" TargetType="ListViewItem">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="SettingsScrollViewerStyle"
|
||||||
|
BasedOn="{StaticResource DefaultScrollViewerStyle}"
|
||||||
|
TargetType="ScrollViewer">
|
||||||
|
<Setter Property="Padding" Value="36,0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SettingsGridStyle" TargetType="Grid">
|
||||||
|
<Setter Property="Padding" Value="0,0,0,36" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundChecked" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPressed" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
|
||||||
<!-- Dimensions -->
|
<!-- Dimensions -->
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<FontFamily x:Key="IconFontFamily">ms-appx:///Assets/Segoe Fluent Icons.ttf#Segoe Fluent Icons</FontFamily>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
||||||
</Application>
|
</Application>
|
||||||
|
|||||||
@@ -1,49 +1,52 @@
|
|||||||
using System;
|
// 2025/6/23 by Zhe Fang
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using BetterLyrics.WinUI3.Enums;
|
||||||
using System.Text;
|
using BetterLyrics.WinUI3.Helper;
|
||||||
using BetterLyrics.WinUI3.Models;
|
using BetterLyrics.WinUI3.Services;
|
||||||
using BetterLyrics.WinUI3.Services.Database;
|
using BetterLyrics.WinUI3.Services.AlbumArtSearchService;
|
||||||
using BetterLyrics.WinUI3.Services.Settings;
|
using BetterLyrics.WinUI3.Services.LastFMService;
|
||||||
|
using BetterLyrics.WinUI3.Services.LibWatcherService;
|
||||||
|
using BetterLyrics.WinUI3.Services.LyricsSearchService;
|
||||||
|
using BetterLyrics.WinUI3.Services.MediaSessionsService;
|
||||||
|
using BetterLyrics.WinUI3.Services.SettingsService;
|
||||||
|
using BetterLyrics.WinUI3.Services.TranslateService;
|
||||||
using BetterLyrics.WinUI3.ViewModels;
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel;
|
||||||
using BetterLyrics.WinUI3.Views;
|
using BetterLyrics.WinUI3.Views;
|
||||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.UI.Dispatching;
|
using Microsoft.UI.Dispatching;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.Windows.ApplicationModel.Resources;
|
using Microsoft.Windows.ApplicationModel.Resources;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Core;
|
using ShadowViewer.Controls;
|
||||||
using Windows.ApplicationModel.Core;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
// To learn more about WinUI, the WinUI project structure,
|
using System.Linq;
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Vanara.PInvoke;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3
|
namespace BetterLyrics.WinUI3
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Provides application-specific behavior to supplement the default Application class.
|
|
||||||
/// </summary>
|
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly ILogger<App> _logger;
|
private readonly ILogger<App> _logger;
|
||||||
|
|
||||||
public static new App Current => (App)Application.Current;
|
public static new App Current => (App)Application.Current;
|
||||||
public BaseWindow? MainWindow { get; private set; }
|
|
||||||
public BaseWindow? SettingsWindow { get; set; }
|
|
||||||
|
|
||||||
public static ResourceLoader? ResourceLoader { get; private set; }
|
|
||||||
|
|
||||||
public static DispatcherQueue? DispatcherQueue { get; private set; }
|
public static DispatcherQueue? DispatcherQueue { get; private set; }
|
||||||
public static DispatcherQueueTimer? DispatcherQueueTimer { get; private set; }
|
public static DispatcherQueueTimer? DispatcherQueueTimer { get; private set; }
|
||||||
|
public static ResourceLoader? ResourceLoader { get; private set; }
|
||||||
|
|
||||||
|
public NotificationPanel? LyricsWindowNotificationPanel { get; set; }
|
||||||
|
public NotificationPanel? SettingsWindowNotificationPanel { get; set; }
|
||||||
|
|
||||||
|
private static Mutex? _instanceMutex;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the singleton application object. This is the first line of authored code
|
|
||||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
|
||||||
/// </summary>
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
@@ -52,19 +55,49 @@ namespace BetterLyrics.WinUI3
|
|||||||
DispatcherQueueTimer = DispatcherQueue.CreateTimer();
|
DispatcherQueueTimer = DispatcherQueue.CreateTimer();
|
||||||
ResourceLoader = new ResourceLoader();
|
ResourceLoader = new ResourceLoader();
|
||||||
|
|
||||||
Helper.AppInfo.EnsureDirectories();
|
EnsureSingleInstance();
|
||||||
|
|
||||||
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
PathHelper.EnsureDirectories();
|
||||||
ConfigureServices();
|
ConfigureServices();
|
||||||
|
|
||||||
_logger = Ioc.Default.GetService<ILogger<App>>()!;
|
_logger = Ioc.Default.GetRequiredService<ILogger<App>>();
|
||||||
|
|
||||||
UnhandledException += App_UnhandledException;
|
UnhandledException += App_UnhandledException;
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
|
||||||
|
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EnsureSingleInstance()
|
||||||
|
{
|
||||||
|
bool createdNew;
|
||||||
|
_instanceMutex = new Mutex(true, Constants.App.AppName, out createdNew);
|
||||||
|
|
||||||
|
if (!createdNew)
|
||||||
|
{
|
||||||
|
User32.MessageBox(HWND.NULL, ResourceLoader!.GetString("TryRunMultipleInstance"), null, User32.MB_FLAGS.MB_APPLMODAL);
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||||
|
{
|
||||||
|
WindowHelper.OpenWindow<LyricsWindow>();
|
||||||
|
|
||||||
|
var lyricsWindow = WindowHelper.GetWindowByWindowType<LyricsWindow>();
|
||||||
|
if (lyricsWindow != null)
|
||||||
|
{
|
||||||
|
lyricsWindow.ViewModel.InitLockHotKey();
|
||||||
|
lyricsWindow.AutoSelectLyricsMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ConfigureServices()
|
private static void ConfigureServices()
|
||||||
{
|
{
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Debug()
|
.MinimumLevel.Is(Serilog.Events.LogEventLevel.Verbose)
|
||||||
.WriteTo.File(Helper.AppInfo.LogFilePattern, rollingInterval: RollingInterval.Day)
|
.WriteTo.File(PathHelper.LogFilePattern, rollingInterval: RollingInterval.Day)
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
// Register services
|
// Register services
|
||||||
@@ -76,37 +109,50 @@ namespace BetterLyrics.WinUI3
|
|||||||
loggingBuilder.AddSerilog();
|
loggingBuilder.AddSerilog();
|
||||||
})
|
})
|
||||||
// Services
|
// Services
|
||||||
.AddSingleton<SettingsService>()
|
.AddSingleton<ISettingsService, SettingsService>()
|
||||||
.AddSingleton<DatabaseService>()
|
.AddSingleton<IMediaSessionsService, MediaSessionsService>()
|
||||||
|
.AddSingleton<IAlbumArtSearchService, AlbumArtSearchService>()
|
||||||
|
.AddSingleton<ILyricsSearchService, LyricsSearchService>()
|
||||||
|
.AddSingleton<ILibWatcherService, LibWatcherService>()
|
||||||
|
.AddSingleton<ITranslateService, TranslateService>()
|
||||||
|
.AddSingleton<ILastFMService, LastFMService>()
|
||||||
// ViewModels
|
// ViewModels
|
||||||
.AddSingleton<BaseWindowModel>()
|
.AddSingleton<AppSettingsControlViewModel>()
|
||||||
.AddSingleton<MainViewModel>()
|
.AddSingleton<LyricsBackgroundSettingsControlViewModel>()
|
||||||
.AddSingleton<SettingsViewModel>()
|
.AddSingleton<AlbumArtLayoutSettingsControlViewModel>()
|
||||||
|
.AddSingleton<PlaybackSettingsControlViewModel>()
|
||||||
|
.AddSingleton<MediaSettingsControlViewModel>()
|
||||||
|
.AddSingleton<AllLyricsSettingsControlViewModel>()
|
||||||
|
.AddSingleton<LyricsWindowViewModel>()
|
||||||
|
.AddSingleton<SettingsWindowViewModel>()
|
||||||
|
.AddSingleton<SystemTrayViewModel>()
|
||||||
|
.AddSingleton<SettingsPageViewModel>()
|
||||||
|
.AddSingleton<LyricsPageViewModel>()
|
||||||
|
.AddSingleton<MusicGalleryViewModel>()
|
||||||
|
.AddSingleton<LyricsRendererViewModel>()
|
||||||
.BuildServiceProvider()
|
.BuildServiceProvider()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void App_UnhandledException(
|
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||||
object sender,
|
|
||||||
Microsoft.UI.Xaml.UnhandledExceptionEventArgs e
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
_logger.LogError(e.Exception, "App_UnhandledException");
|
_logger.LogError(e.Exception, "App_UnhandledException");
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void CurrentDomain_FirstChanceException(object? sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
|
||||||
/// Invoked when the application is launched.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">Details about the launch request and process.</param>
|
|
||||||
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
|
|
||||||
{
|
{
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
_logger.LogError(e.Exception, "CurrentDomain_FirstChanceException");
|
||||||
|
}
|
||||||
|
|
||||||
// Activate the window
|
private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
|
||||||
MainWindow = new BaseWindow();
|
{
|
||||||
MainWindow!.Navigate(typeof(MainPage));
|
_logger.LogError(e.ExceptionObject.ToString(), "CurrentDomain_UnhandledException");
|
||||||
MainWindow.Activate();
|
}
|
||||||
|
|
||||||
|
private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/AIMP.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/AppleMusic.png
Normal file
|
After Width: | Height: | Size: 836 B |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Chrome.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Discord.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Edge.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/EmptyBox.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/EmptyState.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/KugouMusic.png
Normal file
|
After Width: | Height: | Size: 304 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/LXMusic.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/LastFM.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Leaf.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Logo.ico
Normal file
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 260 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/MusicBee.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/PotPlayer.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/QQ.png
Normal file
|
After Width: | Height: | Size: 166 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/QQMusic.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Question.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Spotify.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Telegram.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
328503
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Wiki82.profile.xml
Normal file
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/foobar2000.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/iTunes.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -1,68 +1,274 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
||||||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
||||||
<RootNamespace>BetterLyrics.WinUI3</RootNamespace>
|
<RootNamespace>BetterLyrics.WinUI3</RootNamespace>
|
||||||
<Platforms>x86;x64;ARM64</Platforms>
|
<Platforms>x86;x64;ARM64</Platforms>
|
||||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||||
<UseWinUI>true</UseWinUI>
|
<UseWinUI>true</UseWinUI>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
<LangVersion>preview</LangVersion>
|
||||||
<ItemGroup>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<Content Include="Logo.ico" />
|
</PropertyGroup>
|
||||||
</ItemGroup>
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<Compile Remove="ViewModels\Lyrics\**" />
|
||||||
<Manifest Include="$(ApplicationManifest)" />
|
<Content Remove="ViewModels\Lyrics\**" />
|
||||||
</ItemGroup>
|
<EmbeddedResource Remove="ViewModels\Lyrics\**" />
|
||||||
<ItemGroup>
|
<None Remove="ViewModels\Lyrics\**" />
|
||||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.MarqueeText" Version="0.1.230830" />
|
<Page Remove="ViewModels\Lyrics\**" />
|
||||||
<PackageReference
|
<PRIResource Remove="ViewModels\Lyrics\**" />
|
||||||
Include="CommunityToolkit.Labs.WinUI.OpacityMaskView"
|
</ItemGroup>
|
||||||
Version="0.1.250513-build.2126"
|
<ItemGroup>
|
||||||
/>
|
<None Remove="Assets\Segoe Fluent Icons.ttf" />
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
<None Remove="Assets\Wiki82.profile.xml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
<None Remove="Controls\AlbumArtLayoutSettingsControl.xaml" />
|
||||||
<PackageReference
|
<None Remove="Controls\AllLyricsSettingsControl.xaml" />
|
||||||
Include="CommunityToolkit.WinUI.Controls.SettingsControls"
|
<None Remove="Controls\AppSettingsControl.xaml" />
|
||||||
Version="8.2.250402"
|
<None Remove="Controls\ExtendedSlider.xaml" />
|
||||||
/>
|
<None Remove="Controls\LyricsBavkgroundSettingsControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
<None Remove="Controls\LyricsSettingsControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
<None Remove="Controls\MediaSettingsControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
<None Remove="Controls\PlaybackSettingsControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
<None Remove="Controls\SystemTray.xaml" />
|
||||||
<PackageReference Include="DevWinUI" Version="8.3.0" />
|
<None Remove="Views\MusicGalleryPage.xaml" />
|
||||||
<PackageReference Include="DevWinUI.Controls" Version="8.3.0" />
|
<None Remove="Views\MusicGalleryWindow.xaml" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<None Remove="Views\SettingsWindow.xaml" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.5" />
|
</ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
<Content Include="Logo.ico" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
|
</ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<Manifest Include="$(ApplicationManifest)" />
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
|
</ItemGroup>
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
<ItemGroup>
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
<PackageReference Include="3v.EvtSource" Version="2.0.0" />
|
||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.5" />
|
<PackageReference Include="ColorThief.ImageSharp" Version="1.0.0" />
|
||||||
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
<PackageReference Include="CommunityToolkit.Labs.WinUI.MarqueeText" Version="0.1.230830" />
|
||||||
<PackageReference Include="z440.atl.core" Version="6.24.0" />
|
<PackageReference Include="CommunityToolkit.Labs.WinUI.OpacityMaskView" Version="0.1.250703-build.2173" />
|
||||||
</ItemGroup>
|
<PackageReference Include="CommunityToolkit.Labs.WinUI.Shimmer" Version="0.1.250703-build.2173" />
|
||||||
<ItemGroup>
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||||
<Content Update="Assets\AI - 甜度爆表.mp3">
|
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.MetadataControl" Version="8.2.250402" />
|
||||||
</Content>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||||
</ItemGroup>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||||
<!-- Publish Properties -->
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||||
<PropertyGroup>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.250402" />
|
||||||
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||||
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||||
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
||||||
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
||||||
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
|
<PackageReference Include="Dubya.WindowsMediaController" Version="2.5.5" />
|
||||||
</PropertyGroup>
|
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.3.0" />
|
||||||
<PropertyGroup>
|
<PackageReference Include="Lyricify.Lyrics.Helper-NativeAot" Version="0.1.4-alpha.5" />
|
||||||
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.8" />
|
||||||
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||||
</PropertyGroup>
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4654" />
|
||||||
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
|
||||||
|
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||||
|
<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.1.2" />
|
||||||
|
<PackageReference Include="NTextCat" Version="0.3.65" />
|
||||||
|
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.3-dev-02320" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
|
<PackageReference Include="ShadowViewer.Controls.Notification" Version="1.2.1" />
|
||||||
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="9.0.8" />
|
||||||
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.8" />
|
||||||
|
<PackageReference Include="TagLibSharp" Version="2.3.0" />
|
||||||
|
<PackageReference Include="TinyPinyin.Net" Version="1.0.2" />
|
||||||
|
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.CoreAudio" Version="4.1.6" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.DwmApi" Version="4.1.6" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="4.1.6" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.Shell32" Version="4.1.6" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.User32" Version="4.1.6" />
|
||||||
|
<PackageReference Include="WinUIEx" Version="2.6.0" />
|
||||||
|
<PackageReference Include="z440.atl.core" Version="7.2.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Hqub.Lastfm">
|
||||||
|
<HintPath>..\..\..\Last.fm\src\Hqub.Lastfm\bin\Release\netstandard2.0\Hqub.Lastfm.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Rendering\InAppLyricsRenderer.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Rendering\DesktopLyricsRenderer.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<!--Disable Trimming for Specific Packages-->
|
||||||
|
<ItemGroup>
|
||||||
|
<TrimmerRootAssembly Include="TagLibSharp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="Assets\AIMP.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\AppleMusic.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Chrome.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Discord.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Edge.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\EmptyBox.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\EmptyState.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\foobar2000.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\iTunes.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\KugouMusic.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\LastFM.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Leaf.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Logo.ico">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Logo.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\LXMusic.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\MediaPlayerWindows11.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\MusicBee.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\NetEaseCloudMusic.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\PotPlayer.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\QQ.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\QQMusic.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Question.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Segoe Fluent Icons.ttf">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Spotify.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Telegram.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Wiki82.profile.xml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\ExtendedSlider.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AllLyricsSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\MediaSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\PlaybackSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AlbumArtLayoutSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsBavkgroundSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AppSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\MusicGalleryWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\MusicGalleryPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\SettingsWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\SystemTray.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<!-- Publish Properties -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
||||||
|
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
||||||
|
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
||||||
|
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
||||||
|
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DefineConstants>$(DefineConstants)</DefineConstants>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<ShouldCreateLogs>True</ShouldCreateLogs>
|
||||||
|
<AdvancedSettingsExpanded>True</AdvancedSettingsExpanded>
|
||||||
|
<UpdateAssemblyVersion>False</UpdateAssemblyVersion>
|
||||||
|
<UpdateAssemblyFileVersion>False</UpdateAssemblyFileVersion>
|
||||||
|
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
|
||||||
|
<UpdatePackageVersion>True</UpdatePackageVersion>
|
||||||
|
<AssemblyInfoVersionType>SettingsVersion</AssemblyInfoVersionType>
|
||||||
|
<InheritWinAppVersionFrom>AssemblyVersion</InheritWinAppVersionFrom>
|
||||||
|
<PackageVersionSettings>AssemblyVersion.None.None</PackageVersionSettings>
|
||||||
|
<Version>2025.6.0</Version>
|
||||||
|
<AssemblyVersion>2025.6.18.0110</AssemblyVersion>
|
||||||
|
<FileVersion>2025.6.18.0110</FileVersion>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class AmllTTmlDB
|
||||||
|
{
|
||||||
|
private const string BaseUrl = "https://raw.githubusercontent.com/Steve-xmh/amll-ttml-db/refs/heads/main/";
|
||||||
|
public const string QueryPrefix = $"{BaseUrl}raw-lyrics/";
|
||||||
|
public const string Index = $"{BaseUrl}metadata/raw-lyrics-index.jsonl";
|
||||||
|
}
|
||||||
|
}
|
||||||
16
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/App.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.Constants
|
||||||
|
{
|
||||||
|
public static class App
|
||||||
|
{
|
||||||
|
public const string AppAuthor = "Zhe Fang";
|
||||||
|
public const string AppName = "BetterLyrics";
|
||||||
|
|
||||||
|
public const string AutoStartupTaskId = "AutoStartup";
|
||||||
|
}
|
||||||
|
}
|
||||||
13
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/LXMusic.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class LXMusic
|
||||||
|
{
|
||||||
|
public const string QuerySuffix = "/subscribe-player-status?filter=progress,duration";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class LastFM
|
||||||
|
{
|
||||||
|
public const string ApiKey = "Your api key here";
|
||||||
|
public const string SharedSecret = "Your shared secret here";
|
||||||
|
public const string UnAuthUrl = "https://www.last.fm/settings/applications";
|
||||||
|
public const string SessionKeyCredentialKey = "LastFMSessionKey";
|
||||||
|
}
|
||||||
|
}
|
||||||
16
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/Link.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.Constants
|
||||||
|
{
|
||||||
|
public static class Link
|
||||||
|
{
|
||||||
|
public const string GithubUrl = "https://github.com/jayfunc/BetterLyrics";
|
||||||
|
public const string QQGroupUrl = "https://qun.qq.com/universal-share/share?ac=1&authKey=4Q%2BYTq3wZldYpF5SbS5c19ECFsiYoLZFAIcBNNzYpBUtiEjaZ8sZ%2F%2BnFN0qw3lad&busi_data=eyJncm91cENvZGUiOiIxMDU0NzAwMzg4IiwidG9rZW4iOiJiVnhqemVYN0N5QVc3b1ZkR24wWmZOTUtvUkJoWm1JRWlaWW5iZnlBcXJtZUtGc2FFTHNlUlFZMi9iRm03cWF5IiwidWluIjoiMTM5NTczOTY2MCJ9&data=39UmAihyH_o6CZaOs7nk2mO_lz2ruODoDou6pxxh7utcxP4WF5sbDBDOPvZ_Wqfzeey4441anegsLYQJxkrBAA&svctype=4&tempid=h5_group_info";
|
||||||
|
public const string DiscordUrl = "https://discord.gg/5yAQPnyCKv";
|
||||||
|
public const string TelegramUrl = "https://t.me/+svhSLZ7awPsxNGY1";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class PlayerID
|
||||||
|
{
|
||||||
|
public const string LXMusic = "cn.toside.music.desktop";
|
||||||
|
public const string MediaPlayerWindows11 = "Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic";
|
||||||
|
public const string AIMP = "AIMP.exe";
|
||||||
|
public const string Foobar2000 = "foobar2000.exe";
|
||||||
|
public const string MusicBee = "MusicBee.exe";
|
||||||
|
public const string PotPlayer = "PotPlayerMini64.exe";
|
||||||
|
public const string Spotify = "Spotify.exe";
|
||||||
|
public const string AppleMusic = "AppleInc.AppleMusicWin_nzyj5cx40ttqa!App";
|
||||||
|
public const string NetEaseCloudMusic = "cloudmusic.exe";
|
||||||
|
public const string KugouMusic = "kugou";
|
||||||
|
public const string QQMusic = "QQMusic.exe";
|
||||||
|
public const string iTunes = "49586DaveAntoine.MediaControllerforiTunes_9bzempp7dntjg!App";
|
||||||
|
public const string Chrome = "Chrome";
|
||||||
|
public const string Edge = "MSEdge";
|
||||||
|
public const string BetterLyrics = "37412.BetterLyrics_rd1g0rsrrtxw8!App";
|
||||||
|
public const string BetterLyricsDebug = "37412.BetterLyrics_c8mj3v9sysxb4!App";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public class PlayerName
|
||||||
|
{
|
||||||
|
public const string LXMusic = "LX Music";
|
||||||
|
public const string MediaPlayerWindows11 = "Media Player";
|
||||||
|
public const string AIMP = "AIMP";
|
||||||
|
public const string Foobar2000 = "foobar2000";
|
||||||
|
public const string MusicBee = "MusicBee";
|
||||||
|
public const string PotPlayer = "PotPlayer";
|
||||||
|
public const string Spotify = "Spotify";
|
||||||
|
public const string AppleMusic = "Apple Music";
|
||||||
|
public const string NetEaseCloudMusic = "网易云音乐";
|
||||||
|
public const string KugouMusic = "酷狗音乐";
|
||||||
|
public const string QQMusic = "QQ 音乐";
|
||||||
|
public const string iTunes = "iTunes";
|
||||||
|
public const string Chrome = "Google Chrome";
|
||||||
|
public const string Edge = "Microsoft Edge";
|
||||||
|
public const string BetterLyrics = "BetterLyrics";
|
||||||
|
public const string BetterLyricsDebug = "BetterLyrics (Debug)";
|
||||||
|
}
|
||||||
|
}
|
||||||
13
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/Time.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class Time
|
||||||
|
{
|
||||||
|
public static readonly TimeSpan DebounceTimeout = TimeSpan.FromMilliseconds(300);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/iTunes.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class iTunes
|
||||||
|
{
|
||||||
|
public const string QueryPrefix = "https://itunes.apple.com/search?";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AlbumArtLayoutSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAlbumArt" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageAlbumRadius" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="12"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.AlbumArtLayoutSettings.CoverImageRadius, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageSongInfo" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageSongInfoAlignment" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.AlbumArtLayoutSettings.SongInfoAlignmentType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoLeft" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoCenter" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoRight" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AlbumArtLayoutSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public AlbumArtLayoutSettingsControlViewModel ViewModel => (AlbumArtLayoutSettingsControlViewModel)DataContext;
|
||||||
|
public AlbumArtLayoutSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<AlbumArtLayoutSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AllLyricsSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<controls:SwitchPresenter Margin="0,72,0,0" Value="{Binding SelectedItem.Tag, ElementName=LyricsSettingsSegmentedControl}">
|
||||||
|
<controls:Case Value="Standard">
|
||||||
|
<uc:LyricsSettingsControl LyricsEffectSettings="{x:Bind ViewModel.AppSettings.StandardLyricsEffectSettings, Mode=OneWay}" LyricsStyleSettings="{x:Bind ViewModel.AppSettings.StandardLyricsStyleSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
<controls:Case Value="Desktop">
|
||||||
|
<uc:LyricsSettingsControl LyricsEffectSettings="{x:Bind ViewModel.AppSettings.DesktopLyricsEffectSettings, Mode=OneWay}" LyricsStyleSettings="{x:Bind ViewModel.AppSettings.DesktopLyricsStyleSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
<controls:Case Value="Dock">
|
||||||
|
<uc:LyricsSettingsControl LyricsEffectSettings="{x:Bind ViewModel.AppSettings.DockLyricsEffectSettings, Mode=OneWay}" LyricsStyleSettings="{x:Bind ViewModel.AppSettings.DockLyricsStyleSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
</controls:SwitchPresenter>
|
||||||
|
<controls:Segmented
|
||||||
|
x:Name="LyricsSettingsSegmentedControl"
|
||||||
|
Margin="36,36,36,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
SelectedIndex="0">
|
||||||
|
<controls:SegmentedItem x:Uid="AllLyricsSettingsControlStandard" Tag="Standard" />
|
||||||
|
<controls:SegmentedItem x:Uid="AllLyricsSettingsControlDesktop" Tag="Desktop" />
|
||||||
|
<controls:SegmentedItem x:Uid="AllLyricsSettingsControlDock" Tag="Dock" />
|
||||||
|
</controls:Segmented>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AllLyricsSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public AllLyricsSettingsControlViewModel ViewModel => (AllLyricsSettingsControlViewModel)DataContext;
|
||||||
|
public AllLyricsSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<AllLyricsSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AppSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- App appearance -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppAppearance" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLanguage"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.GeneralSettings.Language, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSystemLanguage" />
|
||||||
|
<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>
|
||||||
|
<Button x:Uid="SettingsPageRestart" Command="{x:Bind ViewModel.RestartAppCommand}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- App behavior -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppBehavior" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageAutoStart" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch
|
||||||
|
x:Name="AutoStartupToggleSwitch"
|
||||||
|
Loaded="AutoStartupToggleSwitch_Loaded"
|
||||||
|
Unloaded="AutoStartupToggleSwitch_Unloaded" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageAutoStartWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.GeneralSettings.AutoStartWindowType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageAutoStartInAppLyrics" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageAutoStartDockLyrics" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageAutoStartDesktopLyrics" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageIgnoreFullscreenWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.IgnoreFullscreenWindow, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageHideWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.HideWindowWhenNotPlaying, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageGlobalDrag" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.IsDragEverywhereEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Desktop mode -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppDesktop" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageAutoLock" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.DesktopModeSettings.AutoLockOnDesktopMode, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLockHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="Ctrl + Alt + " />
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.DesktopModeSettings.LockHotKeyIndex, Mode=TwoWay}">
|
||||||
|
<ComboBoxItem Content="A" />
|
||||||
|
<ComboBoxItem Content="B" />
|
||||||
|
<ComboBoxItem Content="C" />
|
||||||
|
<ComboBoxItem Content="D" />
|
||||||
|
<ComboBoxItem Content="E" />
|
||||||
|
<ComboBoxItem Content="F" />
|
||||||
|
<ComboBoxItem Content="G" />
|
||||||
|
<ComboBoxItem Content="H" />
|
||||||
|
<ComboBoxItem Content="I" />
|
||||||
|
<ComboBoxItem Content="J" />
|
||||||
|
<ComboBoxItem Content="K" />
|
||||||
|
<ComboBoxItem Content="L" />
|
||||||
|
<ComboBoxItem Content="M" />
|
||||||
|
<ComboBoxItem Content="N" />
|
||||||
|
<ComboBoxItem Content="O" />
|
||||||
|
<ComboBoxItem Content="P" />
|
||||||
|
<ComboBoxItem Content="Q" />
|
||||||
|
<ComboBoxItem Content="R" />
|
||||||
|
<ComboBoxItem Content="S" />
|
||||||
|
<ComboBoxItem Content="T" />
|
||||||
|
<ComboBoxItem Content="U" />
|
||||||
|
<ComboBoxItem Content="V" />
|
||||||
|
<ComboBoxItem Content="W" />
|
||||||
|
<ComboBoxItem Content="X" />
|
||||||
|
<ComboBoxItem Content="Y" />
|
||||||
|
<ComboBoxItem Content="Z" />
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Dock mode -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppDock" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageDockMonitor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<ComboBox ItemsSource="{x:Bind ViewModel.MonitorDeviceNames, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.AppSettings.DockModeSettings.DockMonitorDeviceName, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
Command="{x:Bind ViewModel.RefreshMonitorDeviceNamesCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageDockWindowHeight" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="64"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="200"
|
||||||
|
Minimum="64"
|
||||||
|
Unit="px"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.DockModeSettings.DockWindowHeight, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageDockPlacement" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.DockModeSettings.DockPlacement, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDockPlacementTop" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDockPlacementBottom" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AppSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public AppSettingsControlViewModel ViewModel => (AppSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public AppSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<AppSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void AutoStartupToggleSwitch_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutoStartupToggleSwitch.IsOn = await ViewModel.DetectIsAutoStartupEnabledAsync();
|
||||||
|
AutoStartupToggleSwitch.Toggled += AutoStartupToggleSwitch_Toggled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoStartupToggleSwitch_Toggled(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.ToggleAutoStartupAsync(AutoStartupToggleSwitch.IsOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoStartupToggleSwitch_Unloaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutoStartupToggleSwitch.Toggled -= AutoStartupToggleSwitch_Toggled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.ExtendedSlider"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Margin="6,0,2,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind Value, Mode=OneWay}" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,14,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind Unit, Mode=OneWay}" />
|
||||||
|
<Slider
|
||||||
|
Maximum="{x:Bind Maximum, Mode=OneWay}"
|
||||||
|
Minimum="{x:Bind Minimum, Mode=OneWay}"
|
||||||
|
SnapsTo="Ticks"
|
||||||
|
StepFrequency="{x:Bind Frequency, Mode=OneWay}"
|
||||||
|
TickFrequency="{x:Bind Frequency, Mode=OneWay}"
|
||||||
|
TickPlacement="Outside"
|
||||||
|
Value="{x:Bind Value, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="ResetButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}"
|
||||||
|
Visibility="{x:Bind ResetButtonVisibility, Mode=OneWay}" />
|
||||||
|
<Button
|
||||||
|
x:Name="SubtractButton"
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="SubtractButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
<Button
|
||||||
|
x:Name="AddButton"
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="AddButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
using Microsoft.UI.Input;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class ExtendedSlider : UserControl
|
||||||
|
{
|
||||||
|
public ExtendedSlider()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Subtract()
|
||||||
|
{
|
||||||
|
if (Value - Frequency < Minimum)
|
||||||
|
{
|
||||||
|
Value = Minimum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value -= Frequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Add()
|
||||||
|
{
|
||||||
|
if (Value + Frequency > Maximum)
|
||||||
|
{
|
||||||
|
Value = Maximum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value += Frequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubtractTimer_Tick(object? sender, object e)
|
||||||
|
{
|
||||||
|
Subtract();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddTimer_Tick(object? sender, object e)
|
||||||
|
{
|
||||||
|
Add();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty FrequencyProperty =
|
||||||
|
DependencyProperty.Register(nameof(Frequency), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty MinimumProperty =
|
||||||
|
DependencyProperty.Register(nameof(Minimum), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty MaximumProperty =
|
||||||
|
DependencyProperty.Register(nameof(Maximum), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty ValueProperty =
|
||||||
|
DependencyProperty.Register(nameof(Value), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty DefaultProperty =
|
||||||
|
DependencyProperty.Register(nameof(Default), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty ResetButtonVisibilityProperty =
|
||||||
|
DependencyProperty.Register(nameof(ResetButtonVisibility), typeof(Visibility), typeof(ExtendedSlider), new PropertyMetadata(Visibility.Visible));
|
||||||
|
public static readonly DependencyProperty UnitProperty =
|
||||||
|
DependencyProperty.Register(nameof(Unit), typeof(string), typeof(ExtendedSlider), new PropertyMetadata(""));
|
||||||
|
|
||||||
|
public double Frequency
|
||||||
|
{
|
||||||
|
get => (double)GetValue(FrequencyProperty);
|
||||||
|
set => SetValue(FrequencyProperty, value);
|
||||||
|
}
|
||||||
|
public double Minimum
|
||||||
|
{
|
||||||
|
get => (double)GetValue(MinimumProperty);
|
||||||
|
set => SetValue(MinimumProperty, value);
|
||||||
|
}
|
||||||
|
public double Maximum
|
||||||
|
{
|
||||||
|
get => (double)GetValue(MaximumProperty);
|
||||||
|
set => SetValue(MaximumProperty, value);
|
||||||
|
}
|
||||||
|
public double Value
|
||||||
|
{
|
||||||
|
get => (double)GetValue(ValueProperty);
|
||||||
|
set => SetValue(ValueProperty, value);
|
||||||
|
}
|
||||||
|
public double Default
|
||||||
|
{
|
||||||
|
get => (double)GetValue(DefaultProperty);
|
||||||
|
set => SetValue(DefaultProperty, value);
|
||||||
|
}
|
||||||
|
public Visibility ResetButtonVisibility
|
||||||
|
{
|
||||||
|
get => (Visibility)GetValue(ResetButtonVisibilityProperty);
|
||||||
|
set => SetValue(ResetButtonVisibilityProperty, value);
|
||||||
|
}
|
||||||
|
public string Unit
|
||||||
|
{
|
||||||
|
get => (string)GetValue(UnitProperty);
|
||||||
|
set => SetValue(UnitProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Value = Default;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubtractButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Subtract();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Add();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsBavkgroundSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageTheme" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox x:Name="ThemeComboBox" SelectedIndex="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.LyricsBackgroundTheme, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageFollowSystem" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDark" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsPureColorBgOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.PureColorOverlayOpacity, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBackgroundOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.CoverOverlayOpacity, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBackgroundSpeed" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="50"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.CoverOverlaySpeed, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBackgroundBlurAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.CoverOverlayBlurAmount, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageBackgroundAcrylicEffectAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.LyricsBackgroundSettings.CoverAcrylicEffectAmount, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsBavkgroundSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsBackgroundSettingsControlViewModel ViewModel => (LyricsBackgroundSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public LyricsBavkgroundSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<LyricsBackgroundSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,323 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- Lyrics style -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageLyricsStyle" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsAlignment" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsAlignmentType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsLeft" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsCenter" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRight" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFontFamily" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox ItemsSource="{x:Bind SystemFontNames, Mode=OneWay}" SelectedIndex="{x:Bind LyricsStyleSettings.SelectedFontFamilyIndex, Mode=TwoWay}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFontWeight" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsFontWeight, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsThin" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsSemiLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsNormal" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsMedium" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsSemiBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsBlack" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraBlack" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBgFontOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="30"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsBgFontOpacity, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFontStrokeWidth" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="5"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsFontStrokeWidth, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsStrokeFontColor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomStrokeFontColor, Mode=TwoWay}">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</ColorPicker>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBgFontColor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomBgFontColor, Mode=TwoWay}">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</ColorPicker>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFgFontColor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomFgFontColor, Mode=TwoWay}">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</ColorPicker>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFontSize" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="2"
|
||||||
|
Maximum="96"
|
||||||
|
Minimum="12"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsFontSize, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsLineSpacingFactor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsLineSpacingFactorSlider"
|
||||||
|
Default="0.5"
|
||||||
|
Frequency="0.1"
|
||||||
|
Maximum="2"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="x"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsLineSpacingFactor, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsTranslationSeparator" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBox AcceptsReturn="True" Text="{x:Bind LyricsStyleSettings.LyricsTranslationSeparator, Mode=TwoWay}" />
|
||||||
|
<Button Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, FontSize=12, Glyph=}" Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Effect -->
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageLyricsEffect"
|
||||||
|
Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||||
|
Text="Effect" />
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsVerticalEdgeOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsVerticalEdgeOpacitySlider"
|
||||||
|
Default="0"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsVerticalEdgeOpacity, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsBlurAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsBlurAmountExtendedSlider"
|
||||||
|
Default="5"
|
||||||
|
Frequency="1"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsBlurAmount, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsHighlightScope" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsHighlightScope, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeLineStartToCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentLine" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLyricsGlowEffect"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=TwoWay}" />
|
||||||
|
<controls:SettingsExpander.Items>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageScope" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsGlowEffectScope, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeLineStartToCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentLine" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsFloatAnimation" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsFloatAnimationEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageFan" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsFanLyricsEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="SettingsPageScrollEasing"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsScrollEasingType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeLinear" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeSmoothStep" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutSine" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuad" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutCubic" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuart" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuint" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutExpo" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutCirc" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutBack" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutElastic" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutBounce" />
|
||||||
|
</ComboBox>
|
||||||
|
<controls:SettingsExpander.Items>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageScrollTopDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsScrollTopDurationExtendedSlider"
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollTopDuration, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageScrollDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsScrollDurationExtendedSlider"
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollDuration, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageScrollBottomDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsScrollBottomDurationExtendedSlider"
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollBottomDuration, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public ObservableCollection<string> SystemFontNames { get; set; } = [.. FontHelper.SystemFontFamilies];
|
||||||
|
|
||||||
|
public LyricsSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LyricsStyleSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsStyleSettings), typeof(LyricsStyleSettings), typeof(LyricsSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsStyleSettings LyricsStyleSettings
|
||||||
|
{
|
||||||
|
get => (LyricsStyleSettings)GetValue(LyricsStyleSettingsProperty);
|
||||||
|
set => SetValue(LyricsStyleSettingsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LyricsEffectSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsEffectSettings), typeof(LyricsEffectSettings), typeof(LyricsSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsEffectSettings LyricsEffectSettings
|
||||||
|
{
|
||||||
|
get => (LyricsEffectSettings)GetValue(LyricsEffectSettingsProperty);
|
||||||
|
set => SetValue(LyricsEffectSettingsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.MediaSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="SettingsPageMusicLib"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AppSettings.LocalMediaFolders, Mode=OneWay}">
|
||||||
|
<controls:SettingsExpander.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<controls:SettingsCard>
|
||||||
|
<controls:SettingsCard.Header>
|
||||||
|
<HyperlinkButton
|
||||||
|
Click="LocalFolderHyperlinkButton_Click"
|
||||||
|
Content="{Binding Path, Mode=OneWay}"
|
||||||
|
Tag="{Binding Path, Mode=OneWay}" />
|
||||||
|
</controls:SettingsCard.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<HyperlinkButton
|
||||||
|
x:Uid="SettingsPageRemovePath"
|
||||||
|
Click="SettingsPageRemovePathButton_Click"
|
||||||
|
Tag="{Binding}" />
|
||||||
|
<ToggleSwitch DataContext="{Binding}" IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
|
</controls:SettingsExpander.ItemTemplate>
|
||||||
|
<controls:SettingsExpander.ItemsHeader>
|
||||||
|
<InfoBar
|
||||||
|
x:Uid="SettingsPageRemoveInfo"
|
||||||
|
BorderThickness="0"
|
||||||
|
CornerRadius="0"
|
||||||
|
IsClosable="False"
|
||||||
|
IsOpen="True"
|
||||||
|
Severity="Success">
|
||||||
|
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.LocalMediaFolders.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.LocalMediaFolders.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
|
||||||
|
</InfoBar>
|
||||||
|
</controls:SettingsExpander.ItemsHeader>
|
||||||
|
<controls:SettingsExpander.ItemsFooter>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageAddFolder" Style="{StaticResource DefaultSettingsExpanderItemStyle}">
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageAddFolderButton"
|
||||||
|
Command="{x:Bind ViewModel.SelectAndAddFolderCommand}"
|
||||||
|
CommandParameter="{Binding ElementName=RootGrid}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.ItemsFooter>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
using Windows.System;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class MediaSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public MediaSettingsControlViewModel ViewModel => (MediaSettingsControlViewModel)DataContext;
|
||||||
|
public MediaSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<MediaSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettingsPageRemovePathButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.RemoveFolderAsync((LocalMediaFolder)(sender as HyperlinkButton)!.Tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void LocalFolderHyperlinkButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is HyperlinkButton button && button.Tag is string uriStr)
|
||||||
|
{
|
||||||
|
if (Uri.TryCreate(uriStr, UriKind.Absolute, out var uri))
|
||||||
|
{
|
||||||
|
await Launcher.LaunchUriAsync(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,320 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.PlaybackSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:models="using:BetterLyrics.WinUI3.Models"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="0">
|
||||||
|
<NavigationView
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="Transparent"
|
||||||
|
IsBackButtonVisible="Collapsed"
|
||||||
|
IsBackEnabled="False"
|
||||||
|
IsSettingsVisible="False"
|
||||||
|
MenuItemsSource="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo, Mode=OneWay}"
|
||||||
|
PaneDisplayMode="Top"
|
||||||
|
SelectedItem="{x:Bind ViewModel.SelectedMediaSourceProvider, Mode=TwoWay}">
|
||||||
|
<NavigationView.MenuItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:MediaSourceProviderInfo">
|
||||||
|
<NavigationViewItem>
|
||||||
|
<NavigationViewItem.Icon>
|
||||||
|
<ImageIcon Source="{Binding Provider, Converter={StaticResource MediaSourceProviderToLogoUriConverter}, Mode=OneWay}" />
|
||||||
|
</NavigationViewItem.Icon>
|
||||||
|
<NavigationViewItem.Content>
|
||||||
|
<TextBlock
|
||||||
|
MaxWidth="200"
|
||||||
|
Text="{Binding Provider, Converter={StaticResource MediaSourceProviderToDisplayedNameConverter}, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</NavigationViewItem.Content>
|
||||||
|
</NavigationViewItem>
|
||||||
|
</DataTemplate>
|
||||||
|
</NavigationView.MenuItemTemplate>
|
||||||
|
</NavigationView>
|
||||||
|
<ScrollViewer Margin="0,72,0,0" Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageMediaSourceProvidersConfig">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLastFMTrack" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsLastFMTrackEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
|
||||||
|
<!-- 时间轴相关配置 -->
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLyricsTimelineThreshold">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsTimelineThresholdReset"
|
||||||
|
Frequency="100"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="0"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind ViewModel.SelectedMediaSourceProvider.TimelineSyncThreshold, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsExpander x:Uid="MainPagePositionOffsetSlider" IsExpanded="True">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPagePositionOffsetReset"
|
||||||
|
Default="0"
|
||||||
|
Frequency="100"
|
||||||
|
Maximum="5000"
|
||||||
|
Minimum="-5000"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind ViewModel.SelectedMediaSourceProvider.PositionOffset, Mode=TwoWay}" />
|
||||||
|
<controls:SettingsExpander.Items>
|
||||||
|
<controls:SettingsCard x:Uid="LyricsPagePositionOffsetHint">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.ResetPositionOffsetOnSongChanged, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 专辑封面源配置 -->
|
||||||
|
<TextBlock x:Uid="SettingsPageAlbumArtSearchProvidersConfig" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<ListView
|
||||||
|
x:Name="AlbumArtSearchProvidersListView"
|
||||||
|
AllowDrop="True"
|
||||||
|
CanDragItems="True"
|
||||||
|
CanReorderItems="True"
|
||||||
|
DragItemsCompleted="AlbumArtSearchProvidersListView_DragItemsCompleted"
|
||||||
|
ItemContainerStyle="{StaticResource ListViewStretchedItemContainerStyle}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.SelectedMediaSourceProvider.AlbumArtSearchProvidersInfo, Mode=OneWay}"
|
||||||
|
SelectionMode="None">
|
||||||
|
<ListView.OpacityTransition>
|
||||||
|
<ScalarTransition />
|
||||||
|
</ListView.OpacityTransition>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:AlbumArtSearchProviderInfo">
|
||||||
|
<controls:SettingsCard Header="{Binding Provider, Converter={StaticResource AlbumArtSearchProviderToDisplayNameConverter}, Mode=OneWay}">
|
||||||
|
<controls:SettingsCard.HeaderIcon>
|
||||||
|
<FontIcon FontFamily="Segoe UI Symbol" Glyph="⠿" />
|
||||||
|
</controls:SettingsCard.HeaderIcon>
|
||||||
|
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<!-- 歌词源配置 -->
|
||||||
|
<TextBlock x:Uid="SettingsPageLyricsSearchProvidersConfig" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<ListView
|
||||||
|
x:Name="LyricsSearchProvidersListView"
|
||||||
|
AllowDrop="True"
|
||||||
|
CanDragItems="True"
|
||||||
|
CanReorderItems="True"
|
||||||
|
DragItemsCompleted="LyricsSearchProvidersListView_DragItemsCompleted"
|
||||||
|
ItemsSource="{x:Bind ViewModel.SelectedMediaSourceProvider.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 Header="{Binding Provider, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}, Mode=OneWay}">
|
||||||
|
<controls:SettingsCard.HeaderIcon>
|
||||||
|
<FontIcon FontFamily="Segoe UI Symbol" Glyph="⠿" />
|
||||||
|
</controls:SettingsCard.HeaderIcon>
|
||||||
|
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Spacing="12">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<Image MaxWidth="200" Source="/Assets/Leaf.png" />
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPagePlaybackNotFound"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
<!-- Last.fm -->
|
||||||
|
<TextBlock x:Uid="SettingsPageLastFM" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLastFMManager"
|
||||||
|
HeaderIcon="{ui:BitmapIcon Source=ms-appx:///Assets/LastFM.png}"
|
||||||
|
IsExpanded="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageLastFMAuth"
|
||||||
|
Command="{x:Bind ViewModel.LastFMAuthCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageLastFMUnAuth"
|
||||||
|
Command="{x:Bind ViewModel.LastFMUnAuthCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<controls:SettingsExpander.Items>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLastFMUsername" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<HyperlinkButton Content="{x:Bind ViewModel.LastFMUser.Name, Mode=OneWay}" NavigateUri="{x:Bind ViewModel.LastFMUser.Url, Mode=OneWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLastFMPlaycount" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<TextBlock Text="{x:Bind ViewModel.LastFMUser.Playcount, Mode=OneWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLastFMRegistered" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<TextBlock Text="{x:Bind ViewModel.LastFMUser.Registered.ToLongDateString(), Mode=OneWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<Button x:Uid="SettingsPageLastFMRefresh" Command="{x:Bind ViewModel.LastFMRefreshCommand}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
<!-- Lyrics translation -->
|
||||||
|
<TextBlock x:Uid="SettingsPageTranslation" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<controls:SettingsExpander
|
||||||
|
x:Uid="LyricsPageTranslationEnabled"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTranslationEnabled, Mode=TwoWay}" />
|
||||||
|
<controls:SettingsExpander.Items>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageTargetLanguage">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.TranslationSettings.SelectedTargetLanguageIndex, Mode=TwoWay}">
|
||||||
|
<ComboBoxItem Content="العربية" Tag="ar" />
|
||||||
|
<ComboBoxItem Content="Azərbaycan dili" Tag="az" />
|
||||||
|
<ComboBoxItem Content="简体中文" Tag="zh-Hans" />
|
||||||
|
<ComboBoxItem Content="繁體中文" Tag="zh-Hant" />
|
||||||
|
<ComboBoxItem Content="Čeština" Tag="cs" />
|
||||||
|
<ComboBoxItem Content="Dansk" Tag="da" />
|
||||||
|
<ComboBoxItem Content="Nederlands" Tag="nl" />
|
||||||
|
<ComboBoxItem Content="English" Tag="en" />
|
||||||
|
<ComboBoxItem Content="Esperanto" Tag="eo" />
|
||||||
|
<ComboBoxItem Content="Suomi" Tag="fi" />
|
||||||
|
<ComboBoxItem Content="Français" Tag="fr" />
|
||||||
|
<ComboBoxItem Content="Deutsch" Tag="de" />
|
||||||
|
<ComboBoxItem Content="Ελληνικά" Tag="el" />
|
||||||
|
<ComboBoxItem Content="עברית" Tag="he" />
|
||||||
|
<ComboBoxItem Content="हिन्दी" Tag="hi" />
|
||||||
|
<ComboBoxItem Content="Magyar" Tag="hu" />
|
||||||
|
<ComboBoxItem Content="Bahasa Indonesia" Tag="id" />
|
||||||
|
<ComboBoxItem Content="Gaeilge" Tag="ga" />
|
||||||
|
<ComboBoxItem Content="Italiano" Tag="it" />
|
||||||
|
<ComboBoxItem Content="日本語" Tag="ja" />
|
||||||
|
<ComboBoxItem Content="한국어" Tag="ko" />
|
||||||
|
<ComboBoxItem Content="فارسی" Tag="fa" />
|
||||||
|
<ComboBoxItem Content="Polski" Tag="pl" />
|
||||||
|
<ComboBoxItem Content="Português" Tag="pt" />
|
||||||
|
<ComboBoxItem Content="Русский" Tag="ru" />
|
||||||
|
<ComboBoxItem Content="Slovenčina" Tag="sk" />
|
||||||
|
<ComboBoxItem Content="Español" Tag="es" />
|
||||||
|
<ComboBoxItem Content="Svenska" Tag="sv" />
|
||||||
|
<ComboBoxItem Content="Türkçe" Tag="tr" />
|
||||||
|
<ComboBoxItem Content="Українська" Tag="uk" />
|
||||||
|
<ComboBoxItem Content="Tiếng Việt" Tag="vi" />
|
||||||
|
</ComboBox>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageTranslationConfig">
|
||||||
|
<controls:SettingsCard.Description>
|
||||||
|
<HyperlinkButton Margin="0,6,0,0" NavigateUri="https://github.com/LibreTranslate/LibreTranslate">
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageTranslationInfoLink"
|
||||||
|
FontSize="14"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</HyperlinkButton>
|
||||||
|
</controls:SettingsCard.Description>
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsLibreTranslateEnabled, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="SettingsPageLibreTranslateServer" IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsLibreTranslateEnabled, Mode=OneWay}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||||
|
<TextBox
|
||||||
|
x:Name="LibreTranslateServerTextBox"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLibreTranslateServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
|
||||||
|
PlaceholderText="http://localhost:5000"
|
||||||
|
Text="{x:Bind ViewModel.AppSettings.TranslationSettings.LibreTranslateServer, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageServerTestButton"
|
||||||
|
Command="{x:Bind ViewModel.LibreTranslateServerTestCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLibreTranslateServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="LyricsPageTranslationOnly" IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTranslationEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.ShowTranslationOnly, Mode=TwoWay}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</controls:SettingsExpander.Items>
|
||||||
|
</controls:SettingsExpander>
|
||||||
|
<controls:SettingsCard x:Uid="LyricsPageLyricsProviderPrefix">
|
||||||
|
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="{x:Bind ViewModel.LyricsSearchProvider, Mode=OneWay, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<controls:SettingsCard x:Uid="LyricsPageTranslationProviderPrefix">
|
||||||
|
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="{x:Bind ViewModel.TranslationSearchProvider, Mode=OneWay, Converter={StaticResource TranslationSearchProviderToDisplayNameConverter}}" />
|
||||||
|
</controls:SettingsCard>
|
||||||
|
<!-- LX music server -->
|
||||||
|
<TextBlock x:Uid="SettingsPageLXMusicServer" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<controls:SettingsCard>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBox
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLXMusicServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
|
||||||
|
PlaceholderText="http://127.0.0.1:23330"
|
||||||
|
Text="{x:Bind ViewModel.AppSettings.GeneralSettings.LXMusicServer, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageServerTestButton"
|
||||||
|
Command="{x:Bind ViewModel.LXMusicServerTestCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLXMusicServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</controls:SettingsCard>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class PlaybackSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public PlaybackSettingsControlViewModel ViewModel => (PlaybackSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public PlaybackSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<PlaybackSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AlbumArtSearchProvidersListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
||||||
|
{
|
||||||
|
// <20><> AlbumArtSearchProvidersInfo <20><><EFBFBD><EFBFBD> CollectionChanged <20>¼<EFBFBD>
|
||||||
|
ViewModel.SelectedMediaSourceProvider?.AlbumArtSearchProvidersInfo?.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LyricsSearchProvidersListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
||||||
|
{
|
||||||
|
// <20><> LyricsSearchProvidersInfo <20><><EFBFBD><EFBFBD> CollectionChanged <20>¼<EFBFBD>
|
||||||
|
ViewModel.SelectedMediaSourceProvider?.LyricsSearchProvidersInfo?.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.SystemTray"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:tb="using:H.NotifyIcon"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<tb:TaskbarIcon
|
||||||
|
x:Name="TrayIcon"
|
||||||
|
x:FieldModifier="public"
|
||||||
|
ContextMenuMode="SecondWindow"
|
||||||
|
DoubleClickCommand="{x:Bind ViewModel.OpenLyricsWindowCommand}"
|
||||||
|
IconSource="ms-appx:///Assets/Logo.ico"
|
||||||
|
LeftClickCommand="{x:Bind ViewModel.OpenLyricsWindowCommand}"
|
||||||
|
NoLeftClickDelay="True"
|
||||||
|
ToolTipText="{x:Bind ViewModel.ToolTipText, Mode=OneWay}">
|
||||||
|
<tb:TaskbarIcon.ContextFlyout>
|
||||||
|
<MenuFlyout
|
||||||
|
AreOpenCloseAnimationsEnabled="True"
|
||||||
|
LightDismissOverlayMode="On"
|
||||||
|
ShowMode="TransientWithDismissOnPointerMoveAway">
|
||||||
|
<MenuFlyoutItem x:Uid="SystemTrayMusicGallery" Command="{x:Bind ViewModel.OpenMusicGalleryCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SystemTraySettings" Command="{x:Bind ViewModel.OpenSettingsCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SystemTrayResetWindowPosition" Command="{x:Bind ViewModel.ResetWindowPositionCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SystemTrayRestart" Command="{x:Bind ViewModel.RestartAppCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SystemTrayExit" Command="{x:Bind ViewModel.ExitAppCommand}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayUnlock"
|
||||||
|
Command="{x:Bind ViewModel.UnlockWindowCommand}"
|
||||||
|
Visibility="{x:Bind ViewModel.IsLyricsWindowLocked, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
|
</MenuFlyout>
|
||||||
|
</tb:TaskbarIcon.ContextFlyout>
|
||||||
|
</tb:TaskbarIcon>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class SystemTray : UserControl
|
||||||
|
{
|
||||||
|
public SystemTrayViewModel ViewModel => (SystemTrayViewModel)DataContext;
|
||||||
|
|
||||||
|
public SystemTray()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetService<SystemTrayViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class AlbumArtSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is AlbumArtSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
AlbumArtSearchProvider.Local => App.ResourceLoader!.GetString("AlbumArtSearchLocalProvider"),
|
||||||
|
AlbumArtSearchProvider.SMTC => App.ResourceLoader!.GetString("AlbumArtSearchSMTCProvider"),
|
||||||
|
AlbumArtSearchProvider.iTunes => "iTunes",
|
||||||
|
_ => throw new Exception($"Unknown AlbumArtSearchProvider: {provider}"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
throw new ArgumentException("Value must be of type AlbumArtSearchProvider", nameof(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
using System;
|
// 2025/6/23 by Zhe Fang
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
using Microsoft.UI.Xaml.Media;
|
using Microsoft.UI.Xaml.Media;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Converter
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
{
|
{
|
||||||
public class ColorToBrushConverter : IValueConverter
|
public partial class ColorToBrushConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, string language)
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,27 +1,22 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Converter
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
{
|
{
|
||||||
internal class ThemeTypeToElementThemeConverter : IValueConverter
|
public partial class CornerRadiusToDoubleConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, string language)
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
{
|
{
|
||||||
if (value is int themeType)
|
if (value is Microsoft.UI.Xaml.CornerRadius cornerRadius)
|
||||||
{
|
{
|
||||||
return (ElementTheme)themeType;
|
return (double)cornerRadius.TopLeft;
|
||||||
}
|
}
|
||||||
return ElementTheme.Default;
|
return .0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
{
|
{
|
||||||
return 0;
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class EnumToIntConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is Enum)
|
||||||
|
{
|
||||||
|
return System.Convert.ToInt32(value);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int && targetType.IsEnum)
|
||||||
|
{
|
||||||
|
return Enum.ToObject(targetType, value);
|
||||||
|
}
|
||||||
|
return Enum.ToObject(targetType, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class IntToCornerRadius : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int intValue && parameter is double controlHeight)
|
||||||
|
{
|
||||||
|
return new Microsoft.UI.Xaml.CornerRadius(intValue / 100f * controlHeight / 2);
|
||||||
|
}
|
||||||
|
return new Microsoft.UI.Xaml.CornerRadius(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class LyricsSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
LyricsSearchProvider.LrcLib => "LrcLib",
|
||||||
|
LyricsSearchProvider.QQ => "QQ 音乐",
|
||||||
|
LyricsSearchProvider.Netease => "网易云音乐",
|
||||||
|
LyricsSearchProvider.Kugou => "酷狗音乐",
|
||||||
|
LyricsSearchProvider.AmllTtmlDb => "amll-ttml-db",
|
||||||
|
LyricsSearchProvider.LocalLrcFile => App.ResourceLoader!.GetString("LyricsSearchProviderLocalLrcFile"),
|
||||||
|
LyricsSearchProvider.LocalMusicFile => App.ResourceLoader!.GetString("LyricsSearchProviderLocalMusicFile"),
|
||||||
|
LyricsSearchProvider.LocalEslrcFile => App.ResourceLoader!.GetString("LyricsSearchProviderEslrcFile"),
|
||||||
|
LyricsSearchProvider.LocalTtmlFile => App.ResourceLoader!.GetString("LyricsSearchProviderTtmlFile"),
|
||||||
|
_ => "N/A",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class MatchedLocalFilesPathToVisibilityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string path)
|
||||||
|
{
|
||||||
|
if (path == App.ResourceLoader!.GetString("MainPageNoLocalFilesMatched"))
|
||||||
|
{
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using BetterLyrics.WinUI3.Constants;
|
||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class MediaSourceProviderToDisplayedNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
PlayerID.Spotify => PlayerName.Spotify,
|
||||||
|
PlayerID.AppleMusic => PlayerName.AppleMusic,
|
||||||
|
PlayerID.iTunes => PlayerName.iTunes,
|
||||||
|
PlayerID.KugouMusic => PlayerName.KugouMusic,
|
||||||
|
PlayerID.NetEaseCloudMusic => PlayerName.NetEaseCloudMusic,
|
||||||
|
PlayerID.QQMusic => PlayerName.QQMusic,
|
||||||
|
PlayerID.LXMusic => PlayerName.LXMusic,
|
||||||
|
PlayerID.MediaPlayerWindows11 => PlayerName.MediaPlayerWindows11,
|
||||||
|
PlayerID.AIMP => PlayerName.AIMP,
|
||||||
|
PlayerID.Foobar2000 => PlayerName.Foobar2000,
|
||||||
|
PlayerID.MusicBee => PlayerName.MusicBee,
|
||||||
|
PlayerID.PotPlayer => PlayerName.PotPlayer,
|
||||||
|
PlayerID.Chrome => PlayerName.Chrome,
|
||||||
|
PlayerID.Edge => PlayerName.Edge,
|
||||||
|
PlayerID.BetterLyrics => PlayerName.BetterLyrics,
|
||||||
|
PlayerID.BetterLyricsDebug => PlayerName.BetterLyricsDebug,
|
||||||
|
_ => provider,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return value?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using BetterLyrics.WinUI3.Constants;
|
||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class MediaSourceProviderToLogoUriConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
PlayerID.Spotify => PathHelper.SpotifyLogoPath,
|
||||||
|
PlayerID.AppleMusic => PathHelper.AppleMusicLogoPath,
|
||||||
|
PlayerID.iTunes => PathHelper.iTunesLogoPath,
|
||||||
|
PlayerID.KugouMusic => PathHelper.KugouMusicLogoPath,
|
||||||
|
PlayerID.NetEaseCloudMusic => PathHelper.NetEaseCloudMusicLogoPath,
|
||||||
|
PlayerID.QQMusic => PathHelper.QQMusicLogoPath,
|
||||||
|
PlayerID.LXMusic => PathHelper.LXMusicLogoPath,
|
||||||
|
PlayerID.MediaPlayerWindows11 => PathHelper.MediaPlayerWindows11LogoPath,
|
||||||
|
PlayerID.AIMP => PathHelper.AIMPLogoPath,
|
||||||
|
PlayerID.Foobar2000 => PathHelper.Foobar2000LogoPath,
|
||||||
|
PlayerID.MusicBee => PathHelper.MusicBeeLogoPath,
|
||||||
|
PlayerID.PotPlayer => PathHelper.PotPlayerLogoPath,
|
||||||
|
PlayerID.Chrome => PathHelper.ChromeLogoPath,
|
||||||
|
PlayerID.Edge => PathHelper.EdgeLogoPath,
|
||||||
|
PlayerID.BetterLyrics => PathHelper.LogoPath,
|
||||||
|
PlayerID.BetterLyricsDebug => PathHelper.LogoPath,
|
||||||
|
_ => PathHelper.UnknownPlayerLogoPath,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return PathHelper.UnknownPlayerLogoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class SecondsToFormattedTimeConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is double seconds)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(seconds).ToString(@"mm\:ss");
|
||||||
|
}
|
||||||
|
else if (value is int secondsInt)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(secondsInt).ToString(@"mm\:ss");
|
||||||
|
}
|
||||||
|
return value?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class TranslationSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is TranslationSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
TranslationSearchProvider.LrcLib => "LrcLib",
|
||||||
|
TranslationSearchProvider.QQ => "QQ 音乐",
|
||||||
|
TranslationSearchProvider.Netease => "网易云音乐",
|
||||||
|
TranslationSearchProvider.Kugou => "酷狗音乐",
|
||||||
|
TranslationSearchProvider.AmllTtmlDb => "amll-ttml-db",
|
||||||
|
TranslationSearchProvider.LocalLrcFile => App.ResourceLoader!.GetString("LyricsSearchProviderLocalLrcFile"),
|
||||||
|
TranslationSearchProvider.LocalMusicFile => App.ResourceLoader!.GetString("LyricsSearchProviderLocalMusicFile"),
|
||||||
|
TranslationSearchProvider.LocalEslrcFile => App.ResourceLoader!.GetString("LyricsSearchProviderEslrcFile"),
|
||||||
|
TranslationSearchProvider.LocalTtmlFile => App.ResourceLoader!.GetString("LyricsSearchProviderTtmlFile"),
|
||||||
|
TranslationSearchProvider.LibreTranslate => "LibreTranslate",
|
||||||
|
_ => "N/A",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 AlbumArtSearchProvider
|
||||||
|
{
|
||||||
|
Local,
|
||||||
|
SMTC,
|
||||||
|
iTunes,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum AutoStartWindowType
|
||||||
|
{
|
||||||
|
StandardMode,
|
||||||
|
DockMode,
|
||||||
|
DesktopMode,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum BackdropType
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Mica = 1,
|
||||||
|
MicaAlt = 2,
|
||||||
|
DesktopAcrylic = 3,
|
||||||
|
Transparent = 4,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,12 +4,12 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Models
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
{
|
{
|
||||||
public enum LyricsAlignmentType
|
public enum CommonSongProperty
|
||||||
{
|
{
|
||||||
Left,
|
Title,
|
||||||
Center,
|
Album,
|
||||||
Right,
|
Artist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum DockPlacement
|
||||||
|
{
|
||||||
|
Top,
|
||||||
|
Bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DockPlacementExtensions
|
||||||
|
{
|
||||||
|
public static WindowPixelSampleMode ToWindowPixelSampleMode(this DockPlacement placement)
|
||||||
|
{
|
||||||
|
return placement switch
|
||||||
|
{
|
||||||
|
DockPlacement.Top => WindowPixelSampleMode.BelowWindow,
|
||||||
|
DockPlacement.Bottom => WindowPixelSampleMode.AboveWindow,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(placement), placement, null)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Enums/EasingType.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum EasingType
|
||||||
|
{
|
||||||
|
Linear,
|
||||||
|
SmoothStep,
|
||||||
|
EaseInOutSine,
|
||||||
|
EaseInOutQuad,
|
||||||
|
EaseInOutCubic,
|
||||||
|
EaseInOutQuart,
|
||||||
|
EaseInOutQuint,
|
||||||
|
EaseInOutExpo,
|
||||||
|
EaseInOutCirc,
|
||||||
|
EaseInOutBack,
|
||||||
|
EaseInOutElastic,
|
||||||
|
EaseInOutBounce,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
using System;
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Models
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
{
|
{
|
||||||
public enum Language
|
public enum Language
|
||||||
{
|
{
|
||||||
@@ -12,5 +14,7 @@ namespace BetterLyrics.WinUI3.Models
|
|||||||
English,
|
English,
|
||||||
SimplifiedChinese,
|
SimplifiedChinese,
|
||||||
TraditionalChinese,
|
TraditionalChinese,
|
||||||
|
Japanese,
|
||||||
|
Korean,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,11 +4,11 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Models
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
{
|
{
|
||||||
public enum TitleBarType
|
public enum LineMaskType
|
||||||
{
|
{
|
||||||
Compact,
|
Glow,
|
||||||
Extended,
|
Highlight,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LineRenderingType
|
||||||
|
{
|
||||||
|
CurrentChar,
|
||||||
|
LineStartToCurrentChar,
|
||||||
|
CurrentLine
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LocalSearchTargetProps
|
||||||
|
{
|
||||||
|
LyricsOnly,
|
||||||
|
LyricsAndAlbumArt,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LyricsDisplayType
|
||||||
|
{
|
||||||
|
AlbumArtOnly,
|
||||||
|
LyricsOnly,
|
||||||
|
SplitView,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LyricsFontColorType
|
||||||
|
{
|
||||||
|
AdaptiveColored,
|
||||||
|
AdaptiveGrayed,
|
||||||
|
Custom,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Microsoft.UI.Text;
|
||||||
|
using Windows.UI.Text;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LyricsFontWeight
|
||||||
|
{
|
||||||
|
Thin,
|
||||||
|
ExtraLight,
|
||||||
|
Light,
|
||||||
|
SemiLight,
|
||||||
|
Normal,
|
||||||
|
Medium,
|
||||||
|
SemiBold,
|
||||||
|
Bold,
|
||||||
|
ExtraBold,
|
||||||
|
Black,
|
||||||
|
ExtraBlack,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class LyricsFontWeightExtensions
|
||||||
|
{
|
||||||
|
public static FontWeight ToFontWeight(this LyricsFontWeight weight)
|
||||||
|
{
|
||||||
|
return weight switch
|
||||||
|
{
|
||||||
|
LyricsFontWeight.Thin => FontWeights.Thin,
|
||||||
|
LyricsFontWeight.ExtraLight => FontWeights.ExtraLight,
|
||||||
|
LyricsFontWeight.Light => FontWeights.Light,
|
||||||
|
LyricsFontWeight.SemiLight => FontWeights.SemiLight,
|
||||||
|
LyricsFontWeight.Normal => FontWeights.Normal,
|
||||||
|
LyricsFontWeight.Medium => FontWeights.Medium,
|
||||||
|
LyricsFontWeight.SemiBold => FontWeights.SemiBold,
|
||||||
|
LyricsFontWeight.Bold => FontWeights.Bold,
|
||||||
|
LyricsFontWeight.ExtraBold => FontWeights.ExtraBold,
|
||||||
|
LyricsFontWeight.Black => FontWeights.Black,
|
||||||
|
LyricsFontWeight.ExtraBlack => FontWeights.ExtraBlack,
|
||||||
|
LyricsFontWeight _ => throw new ArgumentOutOfRangeException(nameof(weight), weight, null),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LyricsFormat
|
||||||
|
{
|
||||||
|
Lrc,
|
||||||
|
Eslrc,
|
||||||
|
Ttml,
|
||||||
|
Qrc,
|
||||||
|
Krc,
|
||||||
|
NotSpecified,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class LyricsFormatExtensions
|
||||||
|
{
|
||||||
|
public static LyricsFormat? DetectFormat(this string content)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(content))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// TTML: 检查 <tt ... xmlns="http://www.w3.org/ns/ttml"
|
||||||
|
if (System.Text.RegularExpressions.Regex.IsMatch(
|
||||||
|
content,
|
||||||
|
@"<tt\b[^>]*\bxmlns\s*=\s*[""']http://www\.w3\.org/ns/ttml[""']",
|
||||||
|
System.Text.RegularExpressions.RegexOptions.IgnoreCase))
|
||||||
|
{
|
||||||
|
return LyricsFormat.Ttml;
|
||||||
|
}
|
||||||
|
// KRC: 检测主内容格式 [start,duration]<offset,duration,0>字...
|
||||||
|
else if (System.Text.RegularExpressions.Regex.IsMatch(
|
||||||
|
content,
|
||||||
|
@"^\[\d+,\d+\](<\d+,\d+,0>.+)+",
|
||||||
|
System.Text.RegularExpressions.RegexOptions.Multiline))
|
||||||
|
{
|
||||||
|
return LyricsFormat.Krc;
|
||||||
|
}
|
||||||
|
// QRC: 检测主内容格式 [start,duration]字(offset,duration)
|
||||||
|
else if (System.Text.RegularExpressions.Regex.IsMatch(
|
||||||
|
content,
|
||||||
|
@"^\[\d+,\d+\].*?\(\d+,\d+\)",
|
||||||
|
System.Text.RegularExpressions.RegexOptions.Multiline))
|
||||||
|
{
|
||||||
|
return LyricsFormat.Qrc;
|
||||||
|
}
|
||||||
|
// 标准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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ToFileExtension(this LyricsFormat format)
|
||||||
|
{
|
||||||
|
return format switch
|
||||||
|
{
|
||||||
|
LyricsFormat.Lrc => ".lrc",
|
||||||
|
LyricsFormat.Qrc => ".qrc",
|
||||||
|
LyricsFormat.Krc => ".krc",
|
||||||
|
LyricsFormat.Eslrc => ".eslrc",
|
||||||
|
LyricsFormat.Ttml => ".ttml",
|
||||||
|
_ => ".*",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 LyricsLayoutOrientation
|
||||||
|
{
|
||||||
|
Horizontal,
|
||||||
|
Vertical,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum LyricsSearchProvider
|
||||||
|
{
|
||||||
|
QQ,
|
||||||
|
Kugou,
|
||||||
|
Netease,
|
||||||
|
LrcLib,
|
||||||
|
AmllTtmlDb,
|
||||||
|
LocalMusicFile,
|
||||||
|
LocalLrcFile,
|
||||||
|
LocalEslrcFile,
|
||||||
|
LocalTtmlFile,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class LyricsSearchProviderExtensions
|
||||||
|
{
|
||||||
|
public static string GetCacheDirectory(this LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
LyricsSearchProvider.LrcLib => PathHelper.LrcLibLyricsCacheDirectory,
|
||||||
|
LyricsSearchProvider.QQ => PathHelper.QQLyricsCacheDirectory,
|
||||||
|
LyricsSearchProvider.Netease => PathHelper.NeteaseLyricsCacheDirectory,
|
||||||
|
LyricsSearchProvider.Kugou => PathHelper.KugouLyricsCacheDirectory,
|
||||||
|
LyricsSearchProvider.AmllTtmlDb => PathHelper.AmllTtmlDbLyricsCacheDirectory,
|
||||||
|
_ => throw new System.ArgumentOutOfRangeException(nameof(provider)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LyricsFormat GetLyricsFormat(this LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
LyricsSearchProvider.LrcLib => LyricsFormat.Lrc,
|
||||||
|
LyricsSearchProvider.QQ => LyricsFormat.Qrc,
|
||||||
|
LyricsSearchProvider.Kugou => LyricsFormat.Krc,
|
||||||
|
LyricsSearchProvider.Netease => LyricsFormat.Lrc,
|
||||||
|
LyricsSearchProvider.AmllTtmlDb => LyricsFormat.Ttml,
|
||||||
|
LyricsSearchProvider.LocalLrcFile => LyricsFormat.Lrc,
|
||||||
|
LyricsSearchProvider.LocalEslrcFile => LyricsFormat.Eslrc,
|
||||||
|
LyricsSearchProvider.LocalTtmlFile => LyricsFormat.Ttml,
|
||||||
|
_ => LyricsFormat.NotSpecified,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsLocal(this LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider
|
||||||
|
is LyricsSearchProvider.LocalMusicFile
|
||||||
|
or LyricsSearchProvider.LocalLrcFile
|
||||||
|
or LyricsSearchProvider.LocalEslrcFile
|
||||||
|
or LyricsSearchProvider.LocalTtmlFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsRemote(this LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return !provider.IsLocal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TranslationSearchProvider? ToTranslationSearchProvider(this LyricsSearchProvider? provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
LyricsSearchProvider.LrcLib => TranslationSearchProvider.LrcLib,
|
||||||
|
LyricsSearchProvider.QQ => TranslationSearchProvider.QQ,
|
||||||
|
LyricsSearchProvider.Kugou => TranslationSearchProvider.Kugou,
|
||||||
|
LyricsSearchProvider.Netease => TranslationSearchProvider.Netease,
|
||||||
|
LyricsSearchProvider.AmllTtmlDb => TranslationSearchProvider.AmllTtmlDb,
|
||||||
|
LyricsSearchProvider.LocalMusicFile => TranslationSearchProvider.LocalMusicFile,
|
||||||
|
LyricsSearchProvider.LocalLrcFile => TranslationSearchProvider.LocalLrcFile,
|
||||||
|
LyricsSearchProvider.LocalEslrcFile => TranslationSearchProvider.LocalEslrcFile,
|
||||||
|
LyricsSearchProvider.LocalTtmlFile => TranslationSearchProvider.LocalTtmlFile,
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 PlaybackOrder
|
||||||
|
{
|
||||||
|
RepeatAll,
|
||||||
|
RepeatOne,
|
||||||
|
Shuffle,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,11 +4,11 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Models
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
{
|
{
|
||||||
public enum LyricsFontColorType
|
public enum SettingsStoreType
|
||||||
{
|
{
|
||||||
Default,
|
Container,
|
||||||
Dominant,
|
JSON
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using Microsoft.Graphics.Canvas.Text;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum TextAlignmentType
|
||||||
|
{
|
||||||
|
Left,
|
||||||
|
Center,
|
||||||
|
Right,
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class LyricsAlignmentTypeExtensions
|
||||||
|
{
|
||||||
|
public static CanvasHorizontalAlignment ToCanvasHorizontalAlignment(this TextAlignmentType alignmentType)
|
||||||
|
{
|
||||||
|
return alignmentType switch
|
||||||
|
{
|
||||||
|
TextAlignmentType.Left => CanvasHorizontalAlignment.Left,
|
||||||
|
TextAlignmentType.Center => CanvasHorizontalAlignment.Center,
|
||||||
|
TextAlignmentType.Right => CanvasHorizontalAlignment.Right,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(alignmentType), alignmentType, null),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum TranslationSearchProvider
|
||||||
|
{
|
||||||
|
QQ,
|
||||||
|
Kugou,
|
||||||
|
Netease,
|
||||||
|
LrcLib,
|
||||||
|
AmllTtmlDb,
|
||||||
|
LocalMusicFile,
|
||||||
|
LocalLrcFile,
|
||||||
|
LocalEslrcFile,
|
||||||
|
LocalTtmlFile,
|
||||||
|
LibreTranslate,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum WindowPixelSampleMode
|
||||||
|
{
|
||||||
|
BelowWindow,
|
||||||
|
AboveWindow,
|
||||||
|
WindowArea,
|
||||||
|
WindowEdge,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.Graphics.Imaging;
|
||||||
|
using Windows.UI;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Events
|
||||||
|
{
|
||||||
|
public class AlbumArtChangedEventArgs(byte[]? bytes, SoftwareBitmap? albumArtSwBitmap, Color? albumArtLightAccentColor, Color? albumArtDarkAccentColor) : EventArgs
|
||||||
|
{
|
||||||
|
public byte[]? Bytes { get; set; } = bytes;
|
||||||
|
public SoftwareBitmap? AlbumArtSwBitmap { get; set; } = albumArtSwBitmap;
|
||||||
|
public Color? AlbumArtLightAccentColor { get; set; } = albumArtLightAccentColor;
|
||||||
|
public Color? AlbumArtDarkAccentColor { get; set; } = albumArtDarkAccentColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Events
|
||||||
|
{
|
||||||
|
public class IsPlayingChangedEventArgs(bool isPlaying) : EventArgs
|
||||||
|
{
|
||||||
|
public bool IsPlaying { get; set; } = isPlaying;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Events
|
||||||
|
{
|
||||||
|
public class LastFMIsAuthenticatedChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public bool IsAuthenticated { get; set; }
|
||||||
|
public LastFMIsAuthenticatedChangedEventArgs(bool isAuthenticated)
|
||||||
|
{
|
||||||
|
IsAuthenticated = isAuthenticated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Hqub.Lastfm.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Events
|
||||||
|
{
|
||||||
|
public class LastFMUserChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public User? User { get; set; }
|
||||||
|
public LastFMUserChangedEventArgs(User? user)
|
||||||
|
{
|
||||||
|
User = user;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
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(string folder, string filePath, WatcherChangeTypes changeType) : EventArgs
|
||||||
|
{
|
||||||
|
public WatcherChangeTypes ChangeType { get; } = changeType;
|
||||||
|
public string FilePath { get; } = filePath;
|
||||||
|
public string Folder { get; } = folder;
|
||||||
|
}
|
||||||
|
}
|
||||||