mirror of
https://github.com/Royce551/FRESHMusicPlayer.git
synced 2025-01-22 19:02:19 -05:00
did something interesting
This commit is contained in:
parent
2762278bc6
commit
3b3babaa80
5 changed files with 91 additions and 1 deletions
|
@ -126,6 +126,9 @@
|
|||
<Compile Include="Pages\Library\SearchPage.xaml.cs">
|
||||
<DependentUpon>SearchPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\Lyrics\LyricsPage.xaml.cs">
|
||||
<DependentUpon>LyricsPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\QueueManagement\QueueEntry.xaml.cs">
|
||||
<DependentUpon>QueueEntry.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -212,6 +215,10 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Lyrics\LyricsPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\NotificationPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
<MenuItem Header="{x:Static resx:Resources.TAGEDITOR_ARTIST}" Click="TrackContextArtist_Click"/>
|
||||
<MenuItem Header="{x:Static resx:Resources.TRACKINFO_ALBUM}" Click="TrackContextAlbum_Click"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Lyrics" Click="TrackContextLyrics_Click"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="{x:Static resx:Resources.CONTROLS_MINIPLAYER}" IsCheckable="True" Click="TrackContextMiniplayer_Click"/>
|
||||
<MenuItem Header="{x:Static resx:Resources.CONTROLS_PAUSE_AFTTER_CURRENT_TRACK}" Click="TrackContext_PauseAuto_Click"/>
|
||||
|
|
|
@ -40,7 +40,8 @@ namespace FRESHMusicPlayer
|
|||
QueueManagement,
|
||||
Search,
|
||||
Notifications,
|
||||
TrackInfo
|
||||
TrackInfo,
|
||||
Lyrics
|
||||
}
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
|
@ -257,6 +258,9 @@ namespace FRESHMusicPlayer
|
|||
case SelectedAuxiliaryPane.TrackInfo:
|
||||
uri = "/Pages/TrackInfoPage.xaml";
|
||||
break;
|
||||
case SelectedAuxiliaryPane.Lyrics:
|
||||
uri = "/Pages/Lyrics/LyricsPage.xaml";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -691,6 +695,8 @@ namespace FRESHMusicPlayer
|
|||
private void TrackContextArtist_Click(object sender, RoutedEventArgs e) => ChangeTabs(SelectedMenu.Artists, CurrentTrack.Artist);
|
||||
|
||||
private void TrackContextAlbum_Click(object sender, RoutedEventArgs e) => ChangeTabs(SelectedMenu.Albums, CurrentTrack.Album);
|
||||
|
||||
private void TrackContextLyrics_Click(object sender, RoutedEventArgs e) => ShowAuxilliaryPane(SelectedAuxiliaryPane.Lyrics, openleft: true);
|
||||
}
|
||||
public class TabChangedEventArgs : EventArgs
|
||||
{
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<Page x:Class="FRESHMusicPlayer.Pages.Lyrics.LyricsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resx = "clr-namespace:FRESHMusicPlayer.Properties"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FRESHMusicPlayer.Pages.Lyrics"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="372" d:DesignWidth="235"
|
||||
Title="LyricsPage" Unloaded="Page_Unloaded">
|
||||
|
||||
<Grid Background="{StaticResource SecondaryColor}">
|
||||
|
||||
<ScrollViewer PanningMode="Both" Panel.ZIndex="1" VerticalAlignment="Center" Foreground="{x:Null}">
|
||||
<TextBlock x:Name="LyricsBox" Foreground="{StaticResource PrimaryTextColor}" Text="Testing 1 2 3" TextAlignment="Center" TextWrapping="Wrap"/>
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
<Image x:Name="CoverArtBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RenderOptions.BitmapScalingMode="LowQuality" Panel.ZIndex="0" Stretch="UniformToFill" Margin="0" >
|
||||
<Image.Effect>
|
||||
<BlurEffect Radius="30" KernelType="Gaussian"/>
|
||||
</Image.Effect>
|
||||
</Image>
|
||||
<Rectangle x:Name="CoverArtOverlay" Fill="{StaticResource ForegroundColor}" Opacity="0.55"/>
|
||||
</Grid>
|
||||
</Page>
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace FRESHMusicPlayer.Pages.Lyrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for LyricsPage.xaml
|
||||
/// </summary>
|
||||
public partial class LyricsPage : Page
|
||||
{
|
||||
public LyricsPage()
|
||||
{
|
||||
MainWindow.Player.SongChanged += Player_SongChanged;
|
||||
InitializeComponent();
|
||||
PopulateFields();
|
||||
}
|
||||
|
||||
public void PopulateFields()
|
||||
{
|
||||
var track = MainWindow.CurrentTrack;
|
||||
if (track is null) return;
|
||||
if (track.EmbeddedPictures.Count == 0)
|
||||
{
|
||||
CoverArtBox.Source = null;
|
||||
CoverArtOverlay.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
CoverArtBox.Source = BitmapFrame.Create(new MemoryStream(track.EmbeddedPictures[0].PictureData), BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
|
||||
CoverArtOverlay.Visibility = Visibility.Visible;
|
||||
}
|
||||
LyricsBox.Text = track.Lyrics.UnsynchronizedLyrics;
|
||||
}
|
||||
private void Player_SongChanged(object sender, EventArgs e) => PopulateFields();
|
||||
private void Page_Unloaded(object sender, RoutedEventArgs e) => MainWindow.Player.SongChanged -= Player_SongChanged;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue