jellyfin/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs

70 lines
2.9 KiB
C#
Raw Normal View History

2020-04-01 15:52:42 +00:00
using System;
using System.Collections.Generic;
2020-05-04 17:46:02 +00:00
using System.Threading;
2020-04-01 15:52:42 +00:00
using MediaBrowser.Controller.Session;
2020-05-06 21:42:53 +00:00
using MediaBrowser.Model.SyncPlay;
2020-04-01 15:52:42 +00:00
2020-05-06 21:42:53 +00:00
namespace MediaBrowser.Controller.SyncPlay
2020-04-01 15:52:42 +00:00
{
/// <summary>
2020-05-06 21:42:53 +00:00
/// Interface ISyncPlayManager.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-05-06 21:42:53 +00:00
public interface ISyncPlayManager
2020-04-01 15:52:42 +00:00
{
/// <summary>
/// Creates a new group.
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session that's creating the group.</param>
/// <param name="request">The request.</param>
2020-05-04 17:46:02 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
void NewGroup(SessionInfo session, NewGroupRequest request, CancellationToken cancellationToken);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Adds the session to a group.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
2020-10-21 14:42:57 +00:00
/// <param name="groupId">The group identifier.</param>
/// <param name="request">The request.</param>
2020-05-04 17:46:02 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2020-05-09 12:34:07 +00:00
void JoinGroup(SessionInfo session, Guid groupId, JoinGroupRequest request, CancellationToken cancellationToken);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Removes the session from a group.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
2020-05-04 17:46:02 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
void LeaveGroup(SessionInfo session, CancellationToken cancellationToken);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Gets list of available groups for a session.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
/// <returns>The list of available groups.</returns>
List<GroupInfoDto> ListGroups(SessionInfo session);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Handle a request by a session in a group.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
2020-04-01 15:52:42 +00:00
/// <param name="request">The request.</param>
2020-05-04 17:46:02 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
void HandleRequest(SessionInfo session, IGroupPlaybackRequest request, CancellationToken cancellationToken);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Maps a session to a group.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
2020-04-01 15:52:42 +00:00
/// <param name="group">The group.</param>
2020-10-21 13:46:50 +00:00
/// <exception cref="InvalidOperationException">Thrown when the user is in another group already.</exception>
void AddSessionToGroup(SessionInfo session, IGroupController group);
2020-04-01 15:52:42 +00:00
/// <summary>
2020-04-04 15:56:21 +00:00
/// Unmaps a session from a group.
2020-04-01 15:52:42 +00:00
/// </summary>
2020-04-04 15:56:21 +00:00
/// <param name="session">The session.</param>
2020-04-01 15:52:42 +00:00
/// <param name="group">The group.</param>
2020-10-21 13:46:50 +00:00
/// <exception cref="InvalidOperationException">Thrown when the user is not found in the specified group.</exception>
void RemoveSessionFromGroup(SessionInfo session, IGroupController group);
2020-04-01 15:52:42 +00:00
}
}