jellyfin/MediaBrowser.Controller/SyncPlay/ISyncPlayManager.cs

70 lines
2.8 KiB
C#
Raw Normal View History

2020-04-01 08:52:42 -07:00
using System;
using System.Collections.Generic;
2020-05-04 10:46:02 -07:00
using System.Threading;
2020-04-01 08:52:42 -07:00
using MediaBrowser.Controller.Session;
2020-05-06 14:42:53 -07:00
using MediaBrowser.Model.SyncPlay;
2020-04-01 08:52:42 -07:00
2020-05-06 14:42:53 -07:00
namespace MediaBrowser.Controller.SyncPlay
2020-04-01 08:52:42 -07:00
{
/// <summary>
2020-05-06 14:42:53 -07:00
/// Interface ISyncPlayManager.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-05-06 14:42:53 -07:00
public interface ISyncPlayManager
2020-04-01 08:52:42 -07:00
{
/// <summary>
/// Creates a new group.
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session that's creating the group.</param>
2020-05-04 10:46:02 -07:00
/// <param name="cancellationToken">The cancellation token.</param>
void NewGroup(SessionInfo session, CancellationToken cancellationToken);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Adds the session to a group.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-04-01 08:52:42 -07:00
/// <param name="groupId">The group id.</param>
/// <param name="request">The request.</param>
2020-05-04 10:46:02 -07:00
/// <param name="cancellationToken">The cancellation token.</param>
void JoinGroup(SessionInfo session, string groupId, JoinGroupRequest request, CancellationToken cancellationToken);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Removes the session from a group.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-05-04 10:46:02 -07:00
/// <param name="cancellationToken">The cancellation token.</param>
void LeaveGroup(SessionInfo session, CancellationToken cancellationToken);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Gets list of available groups for a session.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-05-04 10:46:02 -07:00
/// <param name="filterItemId">The item id to filter by.</param>
2020-04-01 08:52:42 -07:00
/// <value>The list of available groups.</value>
2020-05-04 10:46:02 -07:00
List<GroupInfoView> ListGroups(SessionInfo session, Guid filterItemId);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Handle a request by a session in a group.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-04-01 08:52:42 -07:00
/// <param name="request">The request.</param>
2020-05-04 10:46:02 -07:00
/// <param name="cancellationToken">The cancellation token.</param>
void HandleRequest(SessionInfo session, PlaybackRequest request, CancellationToken cancellationToken);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Maps a session to a group.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-04-01 08:52:42 -07:00
/// <param name="group">The group.</param>
/// <exception cref="InvalidOperationException"></exception>
2020-05-06 14:42:53 -07:00
void AddSessionToGroup(SessionInfo session, ISyncPlayController group);
2020-04-01 08:52:42 -07:00
/// <summary>
2020-04-04 08:56:21 -07:00
/// Unmaps a session from a group.
2020-04-01 08:52:42 -07:00
/// </summary>
2020-04-04 08:56:21 -07:00
/// <param name="session">The session.</param>
2020-04-01 08:52:42 -07:00
/// <param name="group">The group.</param>
/// <exception cref="InvalidOperationException"></exception>
2020-05-06 14:42:53 -07:00
void RemoveSessionFromGroup(SessionInfo session, ISyncPlayController group);
2020-04-01 08:52:42 -07:00
}
}