Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
16b28db
added artist field to Song class
jamiw1 Oct 2, 2025
53848c5
uses album artist, then song artist as fallback
jamiw1 Oct 2, 2025
a7641b0
favorite button in now playing
jamiw1 Oct 2, 2025
079783b
favorite button functionality
jamiw1 Oct 2, 2025
78bd740
forgot to undo some changes
jamiw1 Oct 2, 2025
5aea444
artist name correctly displayed on queue
jamiw1 Oct 2, 2025
06b509e
added lyrics in Song object
jamiw1 Oct 3, 2025
8918edf
selector bar for now playing
jamiw1 Oct 3, 2025
b777cdb
page switching for queue/lyrics
jamiw1 Oct 3, 2025
c281e17
lyrics implemented
jamiw1 Oct 3, 2025
791ec27
major typo correction
jamiw1 Oct 3, 2025
8faa59f
basic info displaying
jamiw1 Oct 3, 2025
b92b1ff
display/control works, need to do playback bar
jamiw1 Oct 3, 2025
2374857
dunno why but if i don't update the timeline (despite it not being vi…
jamiw1 Oct 3, 2025
9350d3e
fixed spamming rescan
jamiw1 Oct 3, 2025
f6d97f7
empty lyrics on itunes tracks now display correctly
jamiw1 Oct 3, 2025
ba27f3d
add lyrics button
jamiw1 Oct 3, 2025
66e6c94
lyrics apply to file function
jamiw1 Oct 3, 2025
06d4db1
adding songs to file via clipboard works
jamiw1 Oct 3, 2025
fbdf601
session option
jamiw1 Oct 3, 2025
a8a4adb
online lyric grabbing is beautiful
jamiw1 Oct 3, 2025
be3de8d
error handling for lyrics
jamiw1 Oct 3, 2025
40eb7fc
changed error message display slighly
jamiw1 Oct 3, 2025
0ac9287
.lrc file support
jamiw1 Oct 3, 2025
6ab808b
mark as instrumental + null checks
jamiw1 Oct 4, 2025
471d0d7
modify file warning
jamiw1 Oct 4, 2025
80061c5
made file modification warning clearer
jamiw1 Oct 4, 2025
c87aac9
button for editing
jamiw1 Oct 4, 2025
5087bef
button functionality
jamiw1 Oct 4, 2025
0e120b9
version bump
jamiw1 Oct 4, 2025
1131cca
center lyrics in confirm
jamiw1 Oct 4, 2025
06a5980
clearer wording
jamiw1 Oct 4, 2025
a911e1c
error message on save, also removed unreliable retry thing
jamiw1 Oct 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
using Windows.Media.Playback;
using Windows.Storage;
using System.Threading.Tasks;
using System.Net.Http;

namespace Musium
{
public partial class App : Application
{
public static Window MainWindow { get; private set; }

public static HttpClient LyricHttpClient { get; private set; }
public App()
{
InitializeComponent();
Expand All @@ -37,6 +38,9 @@ protected override async void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventA
MainWindow = new MainWindow();
MainWindow.Activate();

LyricHttpClient = new HttpClient();
LyricHttpClient.BaseAddress = new Uri("https://lrclib.net/api/");

var Audio = AudioService.Instance;
await Task.Run(async () =>
{
Expand Down
2 changes: 1 addition & 1 deletion Controls/QueueListItemControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</Grid>
<StackPanel>
<TextBlock Text="{x:Bind Song.Title, Mode=OneWay, TargetNullValue='No Song'}" FontWeight="Medium"/>
<TextBlock Text="{x:Bind Song.Album.Artist.Name, Mode=OneWay, TargetNullValue='No Artist'}" FontSize="12" FontWeight="Light"/>
<TextBlock Text="{x:Bind Song.ArtistName, Mode=OneWay, TargetNullValue='No Artist'}" FontSize="12" FontWeight="Light"/>
</StackPanel>
</StackPanel>
<Grid Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" BorderThickness="0" Margin="0,0">
Expand Down
31 changes: 31 additions & 0 deletions Converters/LyricsPassConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using System;
using System.Diagnostics;

namespace Musium.Converters
{
public class LyricsPassConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is string s)
{
if (s.Equals("[INSTRUMENTAL]"))
{
return "This song does not contain any lyrics.";
}
return s;
}

return null;
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return value is Visibility visibility && visibility == Visibility.Visible;
}
}
}


35 changes: 35 additions & 0 deletions Converters/StringFilledToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using System;
using System.Diagnostics;

namespace Musium.Converters
{
public class StringFilledToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is string s)
{
bool isFilled = !string.IsNullOrEmpty(s) || !string.IsNullOrWhiteSpace(s);

if (parameter is string param && param.Equals("Inverse", StringComparison.OrdinalIgnoreCase))
{
isFilled = !isFilled;
}

return isFilled ? Visibility.Visible : Visibility.Collapsed;
}

if (parameter is string par && par.Equals("Inverse", StringComparison.OrdinalIgnoreCase)) return Visibility.Visible;
return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return value is Visibility visibility && visibility == Visibility.Visible;
}
}
}


42 changes: 42 additions & 0 deletions Models/Song.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Windows.Devices.Radios;
using Windows.Media.Core;

Expand Down Expand Up @@ -35,6 +36,17 @@ public Album Album
}
}

private string _artistName;
public string ArtistName
{
get => _artistName;
set
{
_artistName = value;
OnPropertyChanged();
}
}

private string _filePath;
public string FilePath
{
Expand All @@ -57,6 +69,36 @@ public string? Genre
}
}

private string? _lyrics;
public string? Lyrics
{
get => _lyrics;
set
{
_lyrics = value;
OnPropertyChanged();
}
}
public IOException? AttemptApplyLyricsToFile(string lyrics)
{
try
{
using (var file = TagLib.File.Create(FilePath))
{
file.Tag.Lyrics = lyrics;
file.Save();
Lyrics = lyrics;
}

Debug.WriteLine("lyrics saved successfully.");
return null;
}
catch (IOException ex)
{
return ex;
}
}

private int? _trackNumber;
public int? TrackNumber
{
Expand Down
25 changes: 25 additions & 0 deletions Musium.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
<None Remove="Controls\TitlebarControls.xaml" />
<None Remove="Controls\TrackItemControl.xaml" />
<None Remove="Pages\InnerAlbum.xaml" />
<None Remove="Pages\Lyrics.xaml" />
<None Remove="Pages\NowPlaying.xaml" />
<None Remove="Pages\Queue.xaml" />
<None Remove="Popups\AddLyricsPopup.xaml" />
<None Remove="Popups\ClearLyricsPopup.xaml" />
<None Remove="Popups\ConfirmLyricsPopup.xaml" />
<None Remove="Popups\LyricErrorPopup.xaml" />
<None Remove="Styles\GridContentStyles.xaml" />
</ItemGroup>

Expand All @@ -48,6 +54,7 @@
<ProjectCapability Include="Msix" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4948" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.250907003" />
Expand All @@ -62,6 +69,24 @@
<None Update="Assets\Placeholder.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Page Update="Popups\LyricErrorPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Popups\ClearLyricsPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Popups\ConfirmLyricsPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Popups\AddLyricsPopup.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Pages\Lyrics.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Pages\Queue.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Pages\Favorites.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
2 changes: 1 addition & 1 deletion Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity
Name="b838ab11-140c-408f-b4bf-a855a42f7e2a"
Publisher="CN=jamied"
Version="0.3.0.0" />
Version="0.4.0.0" />

<mp:PhoneIdentity PhoneProductId="b838ab11-140c-408f-b4bf-a855a42f7e2a" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down
85 changes: 85 additions & 0 deletions Pages/Lyrics.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<Page
x:Class="Musium.Pages.Lyrics"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Musium.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="using:Musium.Converters"
mc:Ignorable="d">
<Page.Resources>
<converters:StringFilledToVisibilityConverter x:Key="StringFilledToVisibilityConverter"/>
<converters:LyricsPassConverter x:Key="LyricsPassConverter"/>
</Page.Resources>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0">
<ScrollView HorizontalScrollMode="Disabled" Padding="32,0">
<StackPanel Margin="16">
<StackPanel
HorizontalAlignment="Center"
Spacing="12"
Visibility="{x:Bind Audio.CurrentSongPlaying.Lyrics, Mode=OneWay, ConverterParameter='Inverse', Converter={StaticResource StringFilledToVisibilityConverter}}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
Text="Lyrics are unavailable for this track."
TextAlignment="Center"
TextWrapping="WrapWholeWords"
FontSize="18"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="8">
<Button HorizontalAlignment="Center" Padding="8" Click="AddLyricsButton_Click">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="8">
<SymbolIcon Symbol="Add" VerticalAlignment="Center"/>
<TextBlock Text="Add lyrics" FontSize="16"/>
</StackPanel>
</Button>
<Button HorizontalAlignment="Center" Padding="8" Click="MarkInstrumentalButton_Click">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="8">
<FontIcon Glyph="&#xEC54;" />
<TextBlock Text="Mark as instrumental" FontSize="16"/>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
Text="{x:Bind Audio.CurrentSongPlaying.Lyrics, Mode=OneWay, Converter={StaticResource LyricsPassConverter}, TargetNullValue='This should not be visible.'}"
TextAlignment="Center"
TextWrapping="WrapWholeWords"
FontSize="18"
Visibility="{x:Bind Audio.CurrentSongPlaying.Lyrics, Mode=OneWay, Converter={StaticResource StringFilledToVisibilityConverter}}"/>

</StackPanel>
</ScrollView>
<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="16">
<Button
Width="32"
Height="32"
Padding="0"
Visibility="{x:Bind Audio.CurrentSongPlaying.Lyrics, Mode=OneWay, Converter={StaticResource StringFilledToVisibilityConverter}}">
<SymbolIcon Symbol="More"/>
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem Text="Edit lyrics" Tag="edit" Click="MenuFlyoutItem_Click">
<MenuFlyoutItem.Icon>
<SymbolIcon Symbol="Edit"/>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutSeparator/>
<MenuFlyoutItem Text="Clear lyrics" Tag="clear" Click="MenuFlyoutItem_Click">
<MenuFlyoutItem.Icon>
<SymbolIcon Symbol="Delete"/>
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Mark as instrumental" Tag="instrumental" Click="MenuFlyoutItem_Click">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xEC54;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyout>
</Button.Flyout>
</Button>
</Grid>
</Grid>
</Page>
Loading
Loading