Skip to content

Commit f155586

Browse files
[Chores] 更新项目结构
1 parent 1c9dcd7 commit f155586

File tree

8 files changed

+31
-16
lines changed

8 files changed

+31
-16
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
2+
3+
namespace HyPlayer.PlayCore.Abstraction.Models.Notifications
4+
{
5+
public abstract class MasterTicketChangedNotification
6+
{
7+
public abstract AudioTicketBase MasterTicket { get; init; }
8+
}
9+
}

HyPlayer.PlayCore.Abstraction/Models/Notifications/PlaybackPositionChangedNotification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
1+
namespace HyPlayer.PlayCore.Abstraction.Models.Notifications
22
{
33
public abstract class PlaybackPositionChangedNotification
44
{

HyPlayer.PlayCore.Demo.AudioGraph.WinUI3/NotificationSubscribers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Task HandleNotificationAsync(MasterTicketChangedNotification notification
4848
}
4949
_dispatcherQueue?.TryEnqueue(() =>
5050
{
51-
AudioGraphTicket = notification.MasterTicket;
51+
AudioGraphTicket = notification.MasterTicket as AudioGraphTicket;
5252
});
5353
return Task.CompletedTask;
5454
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
2+
using HyPlayer.PlayCore.Abstraction.Models.Notifications;
3+
4+
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
5+
{
6+
public class AudioGraphMasterTicketChangedNotification : MasterTicketChangedNotification
7+
{
8+
public override AudioTicketBase MasterTicket { get; init; }
9+
public AudioGraphMasterTicketChangedNotification(AudioGraphTicket ticket)
10+
{
11+
MasterTicket = ticket;
12+
}
13+
}
14+
}

HyPlayer.PlayCore.Implementation.AudioGraph/Abstractions/Notifications/AudioGraphPlaybackPositionChangedNotification.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
1+
using HyPlayer.PlayCore.Abstraction.Models.Notifications;
2+
3+
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
24
{
35
public class AudioGraphPlaybackPositionChangedNotification : PlaybackPositionChangedNotification
46
{

HyPlayer.PlayCore.Implementation.AudioGraph/Abstractions/Notifications/AudioTicketReachesEndNotification.cs renamed to HyPlayer.PlayCore.Implementation.AudioGraph/Abstractions/Notifications/AudioGraphTicketReachesEndNotification.cs

File renamed without changes.

HyPlayer.PlayCore.Implementation.AudioGraph/Abstractions/Notifications/MasterTicketChangedNotification.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

HyPlayer.PlayCore.Implementation.AudioGraph/AudioGraphService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;
44
using HyPlayer.PlayCore.Abstraction.Models;
55
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
6+
using HyPlayer.PlayCore.Abstraction.Models.Notifications;
67
using HyPlayer.PlayCore.Abstraction.Models.Resources;
78
using HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions;
89
using HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications;
@@ -333,8 +334,8 @@ public Task SetMasterTicketAsync(AudioGraphTicket graphTicket)
333334
{
334335
ThrowExceptionIfDisposed();
335336
MasterTicket = graphTicket;
336-
var notification = new MasterTicketChangedNotification(graphTicket);
337-
_notificationHub.PublishNotificationAsync(notification);
337+
var notification = new AudioGraphMasterTicketChangedNotification(graphTicket);
338+
_notificationHub.PublishNotificationAsync(notification as MasterTicketChangedNotification);
338339
return Task.CompletedTask;
339340
}
340341

0 commit comments

Comments
 (0)