Skip to content

Commit

Permalink
[Chores] 更新项目结构
Browse files Browse the repository at this point in the history
  • Loading branch information
Raspberry-Monster committed Jul 13, 2024
1 parent 1c9dcd7 commit f155586
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;

namespace HyPlayer.PlayCore.Abstraction.Models.Notifications
{
public abstract class MasterTicketChangedNotification
{
public abstract AudioTicketBase MasterTicket { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
namespace HyPlayer.PlayCore.Abstraction.Models.Notifications
{
public abstract class PlaybackPositionChangedNotification
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Task HandleNotificationAsync(MasterTicketChangedNotification notification
}
_dispatcherQueue?.TryEnqueue(() =>
{
AudioGraphTicket = notification.MasterTicket;
AudioGraphTicket = notification.MasterTicket as AudioGraphTicket;
});
return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
using HyPlayer.PlayCore.Abstraction.Models.Notifications;

namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
{
public class AudioGraphMasterTicketChangedNotification : MasterTicketChangedNotification
{
public override AudioTicketBase MasterTicket { get; init; }
public AudioGraphMasterTicketChangedNotification(AudioGraphTicket ticket)
{
MasterTicket = ticket;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
using HyPlayer.PlayCore.Abstraction.Models.Notifications;

namespace HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications
{
public class AudioGraphPlaybackPositionChangedNotification : PlaybackPositionChangedNotification
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using HyPlayer.PlayCore.Abstraction.Interfaces.AudioServices;
using HyPlayer.PlayCore.Abstraction.Models;
using HyPlayer.PlayCore.Abstraction.Models.AudioServiceComponents;
using HyPlayer.PlayCore.Abstraction.Models.Notifications;
using HyPlayer.PlayCore.Abstraction.Models.Resources;
using HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions;
using HyPlayer.PlayCore.Implementation.AudioGraphService.Abstractions.Notifications;
Expand Down Expand Up @@ -333,8 +334,8 @@ public Task SetMasterTicketAsync(AudioGraphTicket graphTicket)
{
ThrowExceptionIfDisposed();
MasterTicket = graphTicket;
var notification = new MasterTicketChangedNotification(graphTicket);
_notificationHub.PublishNotificationAsync(notification);
var notification = new AudioGraphMasterTicketChangedNotification(graphTicket);
_notificationHub.PublishNotificationAsync(notification as MasterTicketChangedNotification);
return Task.CompletedTask;
}

Expand Down

0 comments on commit f155586

Please sign in to comment.