Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions Screenbox.Core/Common/ServiceHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public static void PopulateCoreServices(ServiceCollection services)
services.AddTransient<AllVideosPageViewModel>();
services.AddTransient<MusicPageViewModel>();
services.AddTransient<SearchResultPageViewModel>();
services.AddTransient<LivelyWallpaperPlayerViewModel>();
services.AddTransient<LivelyWallpaperSelectorViewModel>();
services.AddTransient<HomePageViewModel>();
services.AddTransient<PlaylistViewModel>();
services.AddTransient<PlaylistsPageViewModel>();
Expand Down Expand Up @@ -71,7 +69,6 @@ public static void PopulateCoreServices(ServiceCollection services)
services.AddSingleton<ICastService, CastService>();
services.AddSingleton<ISettingsService, SettingsService>();
services.AddSingleton<ISystemMediaTransportControlsService, SystemMediaTransportControlsService>();
services.AddSingleton<ILivelyWallpaperService, LivelyWallpaperService>();
services.AddSingleton<IPlaybackControlService, PlaybackControlService>();
services.AddSingleton<IPlaylistService, PlaylistService>();
}
Expand Down
25 changes: 25 additions & 0 deletions Screenbox.Core/Messages/VisualizerChangedMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Screenbox.Core.Messages;

/// <summary>
/// Represents a message that is sent when the active visualizer changes.
/// </summary>
public sealed class VisualizerChangedMessage
{
/// <summary>
/// Gets the path of the selected visualizer.
/// </summary>
/// <value>
/// The path of the selected visualizer, or an empty string if the default
/// or none is selected.
/// </value>
public string Path { get; }

/// <summary>
/// Initializes a new instance of the <see cref="VisualizerChangedMessage"/> class.
/// </summary>
/// <param name="path">The path of the selected visualizer. Use an empty string to indicate the default or none.</param>
public VisualizerChangedMessage(string path)
{
Path = path;
}
}
15 changes: 1 addition & 14 deletions Screenbox.Core/Screenbox.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
<Compile Include="Contexts\CastContext.cs" />
<Compile Include="Contexts\LibraryContext.cs" />
<Compile Include="Contexts\PlaylistsContext.cs" />
<Compile Include="Enums\LivelyWallpaperType.cs" />
<Compile Include="Enums\MediaPlaybackType.cs" />
<Compile Include="Enums\ManipulationLock.cs" />
<Compile Include="Enums\NotificationLevel.cs" />
Expand All @@ -152,14 +151,12 @@
<Compile Include="Helpers\LanguageHelper.cs" />
<Compile Include="Controllers\LastPositionTracker.cs" />
<Compile Include="Helpers\ListGrouping.cs" />
<Compile Include="Helpers\LivelyWallpaperUtil.cs" />
<Compile Include="Helpers\MediaGroupingHelpers.cs" />
<Compile Include="Helpers\MessengerExtensions.cs" />
<Compile Include="Helpers\RendererWatcher.cs" />
<Compile Include="Helpers\StreamAbstraction.cs" />
<Compile Include="Helpers\SystemInformation.cs" />
<Compile Include="Helpers\VlcMediaExtensions.cs" />
<Compile Include="Helpers\WebView2Util.cs" />
<Compile Include="Messages\ChangeAspectRatioMessage.cs" />
<Compile Include="Messages\ChangePlaybackRateRequestMessage.cs" />
<Compile Include="Messages\ChangeTimeRequestMessage.cs" />
Expand Down Expand Up @@ -202,12 +199,9 @@
<Compile Include="Messages\TogglePlayPauseMessage.cs" />
<Compile Include="Messages\UpdateStatusMessage.cs" />
<Compile Include="Messages\UpdateVolumeStatusMessage.cs" />
<Compile Include="Messages\VisualizerChangedMessage.cs" />
<Compile Include="Models\IMediaProperties.cs" />
<Compile Include="Models\LanguageInfo.cs" />
<Compile Include="Models\LivelyInfoModel.cs" />
<Compile Include="Models\LivelyMusicModel.cs" />
<Compile Include="Models\LivelyPlaybackStateModel.cs" />
<Compile Include="Models\LivelyWallpaperModel.cs" />
<Compile Include="Models\MediaInfo.cs" />
<Compile Include="Models\MediaLastPosition.cs" />
<Compile Include="Models\MusicInfo.cs" />
Expand Down Expand Up @@ -243,7 +237,6 @@
<Compile Include="Services\ICastService.cs" />
<Compile Include="Services\IFilesService.cs" />
<Compile Include="Services\ILibraryService.cs" />
<Compile Include="Services\ILivelyWallpaperService.cs" />
<Compile Include="Factories\IMediaListFactory.cs" />
<Compile Include="Services\INavigationService.cs" />
<Compile Include="Services\IPlaybackControlService.cs" />
Expand All @@ -256,7 +249,6 @@
<Compile Include="Services\IWindowService.cs" />
<Compile Include="Controllers\LibraryController.cs" />
<Compile Include="Services\LibraryService.cs" />
<Compile Include="Services\LivelyWallpaperService.cs" />
<Compile Include="Services\LogService.cs" />
<Compile Include="Factories\MediaListFactory.cs" />
<Compile Include="Services\NavigationService.cs" />
Expand Down Expand Up @@ -284,8 +276,6 @@
<Compile Include="ViewModels\FolderListViewPageViewModel.cs" />
<Compile Include="ViewModels\FolderViewPageViewModel.cs" />
<Compile Include="ViewModels\HomePageViewModel.cs" />
<Compile Include="ViewModels\LivelyWallpaperPlayerViewModel.cs" />
<Compile Include="ViewModels\LivelyWallpaperSelectorViewModel.cs" />
<Compile Include="ViewModels\MainPageViewModel.cs" />
<Compile Include="ViewModels\MediaListViewModel.cs" />
<Compile Include="ViewModels\MediaViewModel.cs" />
Expand Down Expand Up @@ -335,9 +325,6 @@
<PackageReference Include="LibVLCSharp">
<Version>3.7.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.8.7</Version>
</PackageReference>
<PackageReference Include="protobuf-net">
<Version>3.2.30</Version>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions Screenbox.Core/ViewModels/PlayerPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public sealed partial class PlayerPageViewModel : ObservableRecipient,
IRecipient<ShowPlayPauseBadgeMessage>,
IRecipient<OverrideControlsHideDelayMessage>,
IRecipient<DragDropMessage>,
IRecipient<PropertyChangedMessage<LivelyWallpaperModel?>>,
IRecipient<VisualizerChangedMessage>,
IRecipient<PropertyChangedMessage<NavigationViewDisplayMode>>
{
private const VirtualKey VK_OEM_PLUS = (VirtualKey)0xBB;
Expand Down Expand Up @@ -121,10 +121,10 @@ public async void Receive(DragDropMessage message)
await OnDropAsync(message.Data);
}

public void Receive(PropertyChangedMessage<LivelyWallpaperModel?> message)
public void Receive(VisualizerChangedMessage message)
{
if (message.NewValue == null) return;
ShowVisualizer = AudioOnly && !string.IsNullOrEmpty(message.NewValue.Path);
if (message.Path is null) return;
ShowVisualizer = AudioOnly && !string.IsNullOrEmpty(message.Path);
}

public void Receive(TogglePlayerVisibilityMessage message)
Expand Down
17 changes: 8 additions & 9 deletions Screenbox.Core/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@
"NETStandard.Library": "2.0.3"
}
},
"Microsoft.UI.Xaml": {
"type": "Direct",
"requested": "[2.8.7, )",
"resolved": "2.8.7",
"contentHash": "GuYRY8KcB0K4IufFqxob40qUL6Gh+zi4RjHXVMENlJTRsXcVGl+QFNIyZVGbHDRgwIN8n0We9TBk0rUQP41Yig==",
"dependencies": {
"Microsoft.Web.WebView2": "1.0.2849.39"
}
},
"protobuf-net": {
"type": "Direct",
"requested": "[3.2.30, )",
Expand Down Expand Up @@ -171,6 +162,14 @@
"resolved": "2.1.0",
"contentHash": "GmkKfoyerqmsHMn7OZj0AKpcBabD+GaafqphvX2Mw406IwiJRy1pKcKqdCfKJfYmkRyJ6+e+RaUylgdJoDa1jQ=="
},
"Microsoft.UI.Xaml": {
"type": "Transitive",
"resolved": "2.8.7",
"contentHash": "GuYRY8KcB0K4IufFqxob40qUL6Gh+zi4RjHXVMENlJTRsXcVGl+QFNIyZVGbHDRgwIN8n0We9TBk0rUQP41Yig==",
"dependencies": {
"Microsoft.Web.WebView2": "1.0.2849.39"
}
},
"Microsoft.Web.WebView2": {
"type": "Transitive",
"resolved": "1.0.2903.40",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Screenbox.Core.Enums;
namespace Screenbox.Lively.Enums;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.IO.Compression;
using Screenbox.Core.Enums;
using Screenbox.Core.Models;
using Screenbox.Lively.Enums;
using Screenbox.Lively.Models;

namespace Screenbox.Core.Helpers;
namespace Screenbox.Lively.Helpers;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.Web.WebView2.Core;
using Windows.System;

namespace Screenbox.Core.Helpers;
namespace Screenbox.Lively.Helpers;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
29 changes: 29 additions & 0 deletions Screenbox.Lively/LivelyWallpaperServiceExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.Extensions.DependencyInjection;
using Screenbox.Lively.Services;
using Screenbox.Lively.ViewModels;

namespace Screenbox.Lively;

/// <summary>
/// Provides extension methods to register services and view models required by the
/// <b>Lively Wallpaper</b> feature into an <see cref="IServiceCollection"/>.
/// </summary>
public static class LivelyWallpaperServiceExtensions
{
/// <summary>
/// Registers Lively Wallpaper view models and services with the dependency injection container.
/// </summary>
/// <param name="services">The service collection to which the Lively services will be added.</param>
/// <returns>The <see cref="IServiceCollection"/> instance so that additional method calls can be chained.</returns>
public static IServiceCollection AddLivelyWallpaperServices(this IServiceCollection services)
{
// View models
services.AddTransient<LivelyWallpaperPlayerViewModel>();
services.AddTransient<LivelyWallpaperSelectorViewModel>();

// Services
services.AddSingleton<ILivelyWallpaperService, LivelyWallpaperService>();

return services;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Screenbox.Core.Enums;
using Screenbox.Lively.Enums;

namespace Screenbox.Core.Models;
namespace Screenbox.Lively.Models;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Screenbox.Core.Models;
namespace Screenbox.Lively.Models;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Screenbox.Core.Models;
namespace Screenbox.Lively.Models;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Screenbox.Core.Models;
namespace Screenbox.Lively.Models;

// Copyright (c) Dani John
// Licensed under the GNU General Public License v3.0.
Expand All @@ -16,9 +16,4 @@ public record LivelyWallpaperModel
public bool IsAudio { get; set; }
public bool IsPauseNotify { get; set; }
public Uri AuthorUrl { get; set; }

public override string ToString()
{
return Model.Author != null ? $"{Model.Title}; {Model.Author}" : $"{Model.Title}";
}
}
26 changes: 26 additions & 0 deletions Screenbox.Lively/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Screenbox.Lively")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Screenbox.Lively")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
33 changes: 33 additions & 0 deletions Screenbox.Lively/Properties/Screenbox.Lively.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains Runtime Directives, specifications about types your application accesses
through reflection and other dynamic code patterns. Runtime Directives are used to control the
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
library does not do any reflection, then you generally do not need to edit this file. However,
if your library reflects over types, especially types passed to it or derived from its types,
then you should write Runtime Directives.

The most common use of reflection in libraries is to discover information about types passed
to the library. Runtime Directives have three ways to express requirements on types passed to
your library.

1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
Use these directives to reflect over types passed as a parameter.

2. SubTypes
Use a SubTypes directive to reflect over types derived from another type.

3. AttributeImplies
Use an AttributeImplies directive to indicate that your library needs to reflect over
types or methods decorated with an attribute.

For more information on writing Runtime Directives for libraries, please visit
https://go.microsoft.com/fwlink/?LinkID=391919
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library Name="Screenbox.Lively">

<!-- add directives for your library here -->

</Library>
</Directives>
Loading
Loading