mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Rewrite syncplay using a state design pattern
This commit is contained in:
25
MediaBrowser.Model/SyncPlay/GroupState.cs
Normal file
25
MediaBrowser.Model/SyncPlay/GroupState.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum GroupState.
|
||||
/// </summary>
|
||||
public enum GroupState
|
||||
{
|
||||
/// <summary>
|
||||
/// The group is in idle state. No media is playing.
|
||||
/// </summary>
|
||||
Idle,
|
||||
/// <summary>
|
||||
/// The group is in wating state. Playback is paused. Will start playing when users are ready.
|
||||
/// </summary>
|
||||
Waiting,
|
||||
/// <summary>
|
||||
/// The group is in paused state. Playback is paused. Will resume on play command.
|
||||
/// </summary>
|
||||
Paused,
|
||||
/// <summary>
|
||||
/// The group is in playing state. Playback is advancing.
|
||||
/// </summary>
|
||||
Playing
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PlaybackRequest.
|
||||
/// </summary>
|
||||
public class PlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the request type.
|
||||
/// </summary>
|
||||
/// <value>The request type.</value>
|
||||
public PlaybackRequestType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the request has been made by the client.
|
||||
/// </summary>
|
||||
/// <value>The date of the request.</value>
|
||||
public DateTime? When { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ping time.
|
||||
/// </summary>
|
||||
/// <value>The ping time.</value>
|
||||
public long? Ping { get; set; }
|
||||
}
|
||||
}
|
||||
28
MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs
Normal file
28
MediaBrowser.Model/SyncPlay/SyncPlayBroadcastType.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to filter the sessions of a group.
|
||||
/// </summary>
|
||||
public enum SyncPlayBroadcastType
|
||||
{
|
||||
/// <summary>
|
||||
/// All sessions will receive the message.
|
||||
/// </summary>
|
||||
AllGroup = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Only the specified session will receive the message.
|
||||
/// </summary>
|
||||
CurrentSession = 1,
|
||||
|
||||
/// <summary>
|
||||
/// All sessions, except the current one, will receive the message.
|
||||
/// </summary>
|
||||
AllExceptCurrentSession = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Only sessions that are not buffering will receive the message.
|
||||
/// </summary>
|
||||
AllReady = 3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user