-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
463 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using LyricParser.Abstraction; | ||
using Microsoft.UI.Xaml; | ||
using NonsPlayer.Core.Models; | ||
|
||
namespace NonsPlayer.Components.Models; | ||
|
||
public class LyricModel | ||
{ | ||
public static LyricModel PureSong = new() | ||
{ LyricLine = new LrcLyricsLine("纯音乐 请欣赏", string.Empty, TimeSpan.Zero) }; | ||
|
||
public static LyricModel NoLyric = new() | ||
{ LyricLine = new LrcLyricsLine("无歌词 请欣赏", string.Empty, TimeSpan.Zero) }; | ||
|
||
public static LyricModel LoadingLyric = new() | ||
{ LyricLine = new LrcLyricsLine("加载歌词中...", string.Empty, TimeSpan.Zero) }; | ||
|
||
public ILyricLine LyricLine; | ||
public string Translation; | ||
|
||
public bool HaveTranslation => !string.IsNullOrEmpty(Translation); | ||
public Type LyricType => LyricLine.GetType(); | ||
public Visibility TransVisibility; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using LyricParser.Abstraction; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using NonsPlayer.Core.Helpers; | ||
using NonsPlayer.Core.Nons.Player; | ||
using NonsPlayer.Core.Services; | ||
using NonsPlayer.Helpers; | ||
using NonsPlayer.Services; | ||
using NonsPlayer.ViewModels; | ||
|
||
namespace NonsPlayer.Components.ViewModels; | ||
|
||
public partial class LyricItemViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] private Visibility transVisibility = Visibility.Visible; | ||
[ObservableProperty] private ILyricLine? pureLyric; | ||
[ObservableProperty] private string? transLyric; | ||
public LyricItemViewModel() | ||
{ | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<UserControl | ||
x:Class="NonsPlayer.Components.Views.LyricItem" | ||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<TextBlock Grid.Row="0" Name="TextBlockPureLyric" | ||
Text="{x:Bind ViewModel.PureLyric.CurrentLyric,Mode=OneWay}" | ||
HorizontalAlignment="Left" VerticalAlignment="Top" TextAlignment="Center" | ||
FontFamily="HarmonyOS Sans SC" FontWeight="Bold" FontSize="20" /> | ||
|
||
<TextBlock Grid.Row="1" Name="TextBlockTranLyric" Text="{x:Bind ViewModel.TransLyric, Mode=OneWay}" | ||
Visibility="{x:Bind ViewModel.TransVisibility, Mode=OneWay}" | ||
HorizontalAlignment="Left" VerticalAlignment="Bottom" TextAlignment="Center" | ||
FontFamily="HarmonyOS Sans SC" FontWeight="Bold" FontSize="18" /> | ||
|
||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Diagnostics; | ||
using System.Windows.Forms; | ||
using CommunityToolkit.Mvvm.Input; | ||
using LyricParser.Abstraction; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Input; | ||
using NonsPlayer.Components.ViewModels; | ||
using NonsPlayer.Core.Nons.Player; | ||
using NonsPlayer.Core.Services; | ||
using NonsPlayer.Helpers; | ||
using NonsPlayer.Services; | ||
using NonsPlayer.ViewModels; | ||
using UserControl = Microsoft.UI.Xaml.Controls.UserControl; | ||
|
||
namespace NonsPlayer.Components.Views; | ||
|
||
public sealed partial class LyricItem : UserControl | ||
{ | ||
public LyricItem() | ||
{ | ||
ViewModel = App.GetService<LyricItemViewModel>(); | ||
InitializeComponent(); | ||
} | ||
|
||
public LyricItemViewModel ViewModel { get; } | ||
|
||
public ILyricLine? PureLyric | ||
{ | ||
set => ViewModel.PureLyric = value; | ||
} | ||
|
||
public string? TransLyric | ||
{ | ||
set => ViewModel.TransLyric = value; | ||
} | ||
public Visibility TransVisibility | ||
{ | ||
set => ViewModel.TransVisibility = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.