Skip to content

Commit

Permalink
[chore] 整理项目
Browse files Browse the repository at this point in the history
  • Loading branch information
kengwang committed Feb 15, 2024
1 parent 37cd036 commit 21fdd37
Show file tree
Hide file tree
Showing 71 changed files with 857 additions and 377 deletions.
18 changes: 12 additions & 6 deletions HyPlayer.App.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Global
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x64.ActiveCfg = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x64.Build.0 = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x64.Deploy.0 = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x86.ActiveCfg = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x86.Build.0 = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Debug|x86.Deploy.0 = Debug|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|ARM.ActiveCfg = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|ARM.Build.0 = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|ARM.Deploy.0 = Release|x64
Expand All @@ -49,6 +52,9 @@ Global
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x64.ActiveCfg = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x64.Build.0 = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x64.Deploy.0 = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x86.ActiveCfg = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x86.Build.0 = Release|x64
{BF29D788-1F10-4325-9E48-A580EF8063AD}.Release|x86.Deploy.0 = Release|x64
{07470380-3B29-4B67-A63D-F12BFE9286F1}.Debug|ARM.ActiveCfg = Debug|ARM
{07470380-3B29-4B67-A63D-F12BFE9286F1}.Debug|ARM.Build.0 = Debug|ARM
{07470380-3B29-4B67-A63D-F12BFE9286F1}.Debug|ARM.Deploy.0 = Debug|ARM
Expand Down Expand Up @@ -141,14 +147,14 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {945313F6-7D3E-4659-92CA-8FCD1373E542}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AEDD7FA1-A865-45C6-8A7A-9AEF03031A77} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
{64A86F19-1868-49CE-B1B2-D71A9911130C} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
{BF29D788-1F10-4325-9E48-A580EF8063AD} = {35251F00-7CAB-427C-890B-D82297F82696}
{10FA9F1A-082C-47BB-AAF9-8847A69CE4B9} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
{AEDD7FA1-A865-45C6-8A7A-9AEF03031A77} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
{F3E70E9F-BBBC-42CC-9378-C1AB53721D0B} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
{BF29D788-1F10-4325-9E48-A580EF8063AD} = {35251F00-7CAB-427C-890B-D82297F82696}
{64A86F19-1868-49CE-B1B2-D71A9911130C} = {927339DD-BB50-4F1F-8D59-EC1742822C28}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {945313F6-7D3E-4659-92CA-8FCD1373E542}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


<ItemGroup>
<PackageReference Include="Depository.Abstraction" Version="1.2.3" />
<PackageReference Include="Depository.Abstraction" Version="2.1.0" />


</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ public class NeteaseAlbum : AlbumBase, IHasCover, IHasTranslation, IHasDescripti
public List<NeteaseArtist>? Artists { get; set; }


public async Task<ImageResourceBase?> GetCoverAsync(CancellationToken ctk = new())
public Task<ImageResourceBase?> GetCoverAsync(ImageResourceQualityTag? qualityTag = null,CancellationToken ctk = new())
{
return new NeteaseImageResource
{
Url = PictureUrl,
HasContent = true
};
return Task.FromResult<ImageResourceBase?>(new NeteaseImageResource
{
Url = PictureUrl,
HasContent = true,
QualityTag = qualityTag
});
}

public string? Translation { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
using HyPlayer.PlayCore.Abstraction.Models.Resources;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models.Resources;

namespace HyPlayer.NeteaseProvider.Models;

public class NeteaseImageResource : ImageResourceBase
public class NeteaseImageResource : ImageResourceBase, IResourceResultOf<string>
{
public override async Task<object?> GetResourceAsync(ResourceQualityTag? qualityTag = null, Type? awaitingType = null,CancellationToken ctk = new())
public Task<string?> GetResourceAsync(CancellationToken cancellationToken = default)
{
if (awaitingType == typeof(string))
if (QualityTag is ImageResourceQualityTag irqt)
return Task.FromResult($"{Url}?param={irqt.PixelX}y{irqt.PixelY}");
else
{
return Url;
return Task.FromResult($"{Url}");
}

return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HyPlayer.PlayCore.Abstraction.Models.Resources;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models.Resources;

namespace HyPlayer.NeteaseProvider.Models;

Expand All @@ -11,10 +12,4 @@ public class NeteaseMusicResource : MusicResourceBase
public long? Time { get; set; }
public string? MusicType { get; set; }
public string? Level { get; set; }


public override Task<object?> GetResourceAsync(ResourceQualityTag? qualityTag = null, Type? awaitingType = null,CancellationToken ctk = new())
{
return Task.FromResult<object?>(Url);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ public class NeteasePlaylist : LinerContainerBase, IProgressiveLoadingContainer,

public int MaxProgressiveCount => 200;

public Task<ImageResourceBase?> GetCoverAsync(CancellationToken ctk = new())
public Task<ImageResourceBase?> GetCoverAsync(ImageResourceQualityTag? qualityTag = null,CancellationToken ctk = new())
{
return Task.FromResult<ImageResourceBase?>(
new NeteaseImageResource
{
Url = CoverUrl,
QualityTag = qualityTag
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace HyPlayer.NeteaseProvider.Models;

public class NeteaseRawLyricInfo : RawLyricInfo
public class NeteaseRawLyricInfo : RawLyricInfo, IResourceResultOf<string>
{
public required string LyricText { get; set; }

Expand All @@ -24,8 +24,8 @@ public class LyricAuthorInfo : ProvidableItemBase

}

public override Task<object?> GetResourceAsync(ResourceQualityTag? qualityTag = null, Type? awaitingType = null,CancellationToken ctk = new())
public Task<string?> GetResourceAsync(CancellationToken cancellationToken = default)
{
return Task.FromResult<object?>(LyricText);
return Task.FromResult(LyricText)!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class NeteaseSong : SingleSongBase, IHasTranslation, IHasCover
}

public string? Translation { get; set; }
public Task<ImageResourceBase?> GetCoverAsync(CancellationToken ctk = new())
public Task<ImageResourceBase?> GetCoverAsync(ImageResourceQualityTag? qualityTag = null, CancellationToken ctk = new())
{
return Task.FromResult<ImageResourceBase?>(new NeteaseImageResource() { Url = CoverUrl });
return Task.FromResult<ImageResourceBase?>(new NeteaseImageResource() { Url = CoverUrl, QualityTag = qualityTag});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public class NeteaseUser : PersonBase, IHasCover, IHasDescription
);
}

public Task<ImageResourceBase?> GetCoverAsync(CancellationToken ctk = new())
public Task<ImageResourceBase?> GetCoverAsync(ImageResourceQualityTag? qualityTag = null, CancellationToken ctk = new())
{
return Task.FromResult<ImageResourceBase?>(new NeteaseImageResource()
{
Url = AvatarUrl
Url = AvatarUrl,
QualityTag = qualityTag
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
using HyPlayer.PlayCore.Abstraction.Models.Resources;

namespace HyPlayer.PlayCore.Abstraction;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices
{
public interface IAudioServiceSettings
{

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;
/// </summary>
public interface IAudioTicketSeekableService : IAudioService
{
public Task SeekAudioTicket(AudioTicketBase audioTicket, long position, CancellationToken ctk = new());
public Task SeekAudioTicketAsync(AudioTicketBase audioTicket, double position, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;

public interface IAudioTicketVolumeChangeable : IAudioService
{
public Task ChangeVolume(AudioTicketBase ticket, double volume, CancellationToken ctk = new());
public Task ChangeVolumeAsync(AudioTicketBase ticket, double volume, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public interface IOutgoingVolumeChangeable : IAudioService
{
public Task ChangeOutgoingVolume(double volume, CancellationToken ctk = new());
public Task ChangeOutgoingVolumeAsync(double volume, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ public interface IOutputDeviceChangeableService : IAudioService
/// 获取可输出设备列表
/// </summary>
/// <returns></returns>
public Task<List<OutputDeviceBase>> GetOutputDevices( CancellationToken ctk = new());
public Task<List<OutputDeviceBase>> GetOutputDevicesAsync(CancellationToken ctk = new());

/// <summary>
/// 设置输出设备
/// </summary>
/// <param name="device">设备信息</param>
/// <returns></returns>
public Task SetOutputDevices(OutputDeviceBase device, CancellationToken ctk = new());
public Task SetOutputDevicesAsync(OutputDeviceBase device, CancellationToken ctk = new());
}

public abstract class OutputDeviceBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;

public interface IPauseAudioTicketService : IAudioService
{
public Task PauseAudioTicket(AudioTicketBase ticket, CancellationToken ctk = new());
public Task PauseAudioTicketAsync(AudioTicketBase ticket, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;

public interface IPlayAudioTicketService : IAudioService
{
public Task PlayAudioTicket(AudioTicketBase ticket, CancellationToken ctk = new());
public Task PlayAudioTicketAsync(AudioTicketBase ticket, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public interface IPlaybackRateChangeableService
/// <param name="ticket">音频票</param>
/// <param name="playbackSpeed">目标速度(x1.0)</param>
/// <returns></returns>
public Task ChangePlaybackSpeed(AudioTicketBase ticket, double playbackSpeed, CancellationToken ctk = new());
public Task ChangePlaybackSpeedAsync(AudioTicketBase ticket, double playbackSpeed, CancellationToken ctk = new());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;

public interface IStopAudioTicketService : IAudioService
{
public Task StopTicket(AudioTicketBase ticket, CancellationToken ctk = new());
public Task StopTicketAsync(AudioTicketBase ticket, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models.Lyric;
using HyPlayer.PlayCore.Abstraction.Models.Lyric;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.Lyric;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayCore;
public interface IPlayCorePlayPositionModification : IPlayCore
{
public Task MovePointerToAsync(SingleSongBase song, CancellationToken ctk = new());
public Task MoveNextAsync( CancellationToken ctk = new());
public Task MovePreviousAsync( CancellationToken ctk = new());
public Task MoveNextAsync(CancellationToken ctk = new());
public Task MovePreviousAsync(CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models.SingleItems;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayCore;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.ObjectModel;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayCore;
namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayCore;

public interface IPlayCoreService : IPlayCore
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayListContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayListController;

public interface IIndexedPlayListController : IPlaylistController
{
public Task<int> GetCurrentIndexAsync( CancellationToken ctk = new());
public Task<int> GetCurrentIndexAsync(CancellationToken ctk = new());
public Task<SingleSongBase?> GetSongAtAsync(int index, CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models.SingleItems;
using HyPlayer.PlayCore.Abstraction.Models.SingleItems;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayListController;

public interface IPlayListGettablePlaylistController : IPlaylistController
{
public Task<List<SingleSongBase>> GetOrderedPlayListAsync( CancellationToken ctk = new());
public Task<List<SingleSongBase>> GetOrderedPlayListAsync(CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models.SingleItems;
using HyPlayer.PlayCore.Abstraction.Models.SingleItems;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.PlayListController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.ProvidableItem;

public interface IHasCover : IProvidableItem
{
public Task<ImageResourceBase?> GetCoverAsync( CancellationToken ctk = new());
public Task<ImageResourceBase?> GetCoverAsync(CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models.Containers;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.ProvidableItem;

public interface IHasCreators : IProvidableItem
{
public List<string>? CreatorList { get; init; }
public Task<List<PersonBase>?> GetCreatorsAsync( CancellationToken ctk = new());
public Task<List<PersonBase>?> GetCreatorsAsync(CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.ProvidableItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.Provider;

public interface ICommentProvidable : IProvider
{
public Task<ContainerBase?> GetCommentContainerAsync( CancellationToken ctk = new());
public Task<ContainerBase?> GetCommentContainerAsync(CancellationToken ctk = new());
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.ObjectModel;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.Provider;

public interface IProvableItemLikable : IProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.ObjectModel;
using HyPlayer.PlayCore.Abstraction.Models;

namespace HyPlayer.PlayCore.Abstraction.Interfaces.Provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace HyPlayer.PlayCore.Abstraction.Interfaces.Provider;

public interface ISearchableProvider : IProvider
{
public Task<ContainerBase?> SearchProvidableItemsAsync(string keyword,string typeId, CancellationToken ctk = new());
public Task<ContainerBase?> SearchProvidableItemsAsync(string keyword, string typeId, CancellationToken ctk = new());
}
Loading

0 comments on commit 21fdd37

Please sign in to comment.