Added application setting objects.

This commit is contained in:
2025-03-22 15:28:46 -04:00
parent 107a20b713
commit d988961513
10 changed files with 63 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ public class AudioBitmapImageCache(IAudioImageExtractor audioImageExtractor) : M
protected override MemoryCacheOptions Options => new() protected override MemoryCacheOptions Options => new()
{ {
SizeLimit = 40, SizeLimit = 200_000_000,
CompactionPercentage = 0.2, CompactionPercentage = 0.2,
}; };
@@ -87,6 +87,6 @@ public class AudioBitmapImageCache(IAudioImageExtractor audioImageExtractor) : M
protected override long GetEntrySize(BitmapImage entry) protected override long GetEntrySize(BitmapImage entry)
{ {
return entry.PixelWidth * entry.PixelHeight; return entry.DecodePixelWidth * entry.DecodePixelHeight;
} }
} }

View File

@@ -1,6 +1,5 @@
using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Data;
using System; using System;
using System.Collections.Generic;
namespace Harmonia.WinUI.Converters; namespace Harmonia.WinUI.Converters;

View File

@@ -38,12 +38,16 @@
<ProjectCapability Include="Msix" /> <ProjectCapability Include="Msix" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" /> <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" /> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Harmonia.Core\Harmonia.Core.csproj" /> <ProjectReference Include="..\Harmonia.Core\Harmonia.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Views\" />
</ItemGroup>
<!-- <!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution

View File

@@ -0,0 +1,10 @@
namespace Harmonia.WinUI.Session;
public partial class ApplicationSession
{
public WindowSession Window { get; set; } = new();
public NavigationSession Navigation { get; set; } = new();
public AudioLibrarySession Library { get; set; } = new();
public AudioPlayerSession Player { get; set; } = new();
public PlaylistSession Playlist { get; set; } = new();
}

View File

@@ -0,0 +1,8 @@
namespace Harmonia.WinUI.Session;
public partial class AudioLibrarySession
{
public string? FlexViewType { get; set; }
public string? LibraryViewType { get; set; }
public string? Breadcrumbs { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace Harmonia.WinUI.Session;
public partial class AudioPlayerSession
{
public string? PlaylistUID { get; set; }
public string? PlaylistSongUID { get; set; }
public double Position { get; set; } = 0.0;
public string? PlaybackState { get; set; }
public double Volume { get; set; } = 1.0;
public bool IsMuted { get; set; }
public string? RepeatState { get; set; }
public bool IsRandom { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Harmonia.WinUI.Session;
public partial class NavigationSession
{
public string? CurrentPage { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Harmonia.WinUI.Session;
public partial class PlaylistSession
{
public string? OpenPlaylistUID { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Harmonia.WinUI.Session;
public partial class WindowSession
{
public bool IsMaximized { get; set; }
}

View File

@@ -0,0 +1,8 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace Harmonia.WinUI.ViewModels;
public partial class ViewModelBase : ObservableObject
{
}