jellyfin/MediaBrowser.Controller/SyncPlay/ISyncPlayController.cs

68 lines
2.3 KiB
C#
Raw Normal View History

2020-04-01 17:52:42 +02:00
using System;
2020-05-04 19:46:02 +02:00
using System.Threading;
2020-04-01 17:52:42 +02:00
using MediaBrowser.Controller.Session;
2020-05-06 23:42:53 +02:00
using MediaBrowser.Model.SyncPlay;
2020-04-01 17:52:42 +02:00
2020-05-06 23:42:53 +02:00
namespace MediaBrowser.Controller.SyncPlay
2020-04-01 17:52:42 +02:00
{
/// <summary>
2020-05-06 23:42:53 +02:00
/// Interface ISyncPlayController.
2020-04-01 17:52:42 +02:00
/// </summary>
2020-05-06 23:42:53 +02:00
public interface ISyncPlayController
2020-04-01 17:52:42 +02:00
{
/// <summary>
/// Gets the group id.
/// </summary>
/// <value>The group id.</value>
Guid GetGroupId();
/// <summary>
/// Gets the playing item id.
/// </summary>
/// <value>The playing item id.</value>
Guid GetPlayingItemId();
/// <summary>
/// Checks if the group is empty.
/// </summary>
/// <value>If the group is empty.</value>
bool IsGroupEmpty();
/// <summary>
2020-04-04 17:56:21 +02:00
/// Initializes the group with the session's info.
2020-04-01 17:52:42 +02:00
/// </summary>
2020-04-04 17:56:21 +02:00
/// <param name="session">The session.</param>
2020-05-04 19:46:02 +02:00
/// <param name="cancellationToken">The cancellation token.</param>
void CreateGroup(SessionInfo session, CancellationToken cancellationToken);
2020-04-01 17:52:42 +02:00
/// <summary>
2020-04-04 17:56:21 +02:00
/// Adds the session to the group.
2020-04-01 17:52:42 +02:00
/// </summary>
2020-04-04 17:56:21 +02:00
/// <param name="session">The session.</param>
/// <param name="request">The request.</param>
2020-05-04 19:46:02 +02:00
/// <param name="cancellationToken">The cancellation token.</param>
void SessionJoin(SessionInfo session, JoinGroupRequest request, CancellationToken cancellationToken);
2020-04-01 17:52:42 +02:00
/// <summary>
2020-04-04 17:56:21 +02:00
/// Removes the session from the group.
2020-04-01 17:52:42 +02:00
/// </summary>
2020-04-04 17:56:21 +02:00
/// <param name="session">The session.</param>
2020-05-04 19:46:02 +02:00
/// <param name="cancellationToken">The cancellation token.</param>
void SessionLeave(SessionInfo session, CancellationToken cancellationToken);
2020-04-01 17:52:42 +02:00
/// <summary>
2020-04-04 17:56:21 +02:00
/// Handles the requested action by the session.
2020-04-01 17:52:42 +02:00
/// </summary>
2020-04-04 17:56:21 +02:00
/// <param name="session">The session.</param>
2020-04-01 17:52:42 +02:00
/// <param name="request">The requested action.</param>
2020-05-04 19:46:02 +02:00
/// <param name="cancellationToken">The cancellation token.</param>
void HandleRequest(SessionInfo session, PlaybackRequest request, CancellationToken cancellationToken);
2020-04-01 17:52:42 +02:00
/// <summary>
/// Gets the info about the group for the clients.
/// </summary>
/// <value>The group info for the clients.</value>
GroupInfoView GetInfo();
}
}