2021-05-06 15:39:20 -07:00
|
|
|
#nullable disable
|
|
|
|
|
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-11-28 08:03:02 -07:00
|
|
|
using MediaBrowser.Controller.SyncPlay.Requests;
|
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-09-24 14:04:21 -07:00
|
|
|
/// <param name="request">The request.</param>
|
2020-05-04 10:46:02 -07:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2020-11-28 08:03:02 -07:00
|
|
|
void NewGroup(SessionInfo session, NewGroupRequest request, 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-15 09:03:58 -07:00
|
|
|
/// <param name="request">The request.</param>
|
2020-05-04 10:46:02 -07:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2020-11-28 08:03:02 -07:00
|
|
|
void JoinGroup(SessionInfo session, 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-11-28 08:03:02 -07:00
|
|
|
/// <param name="request">The request.</param>
|
2020-05-04 10:46:02 -07:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2020-11-28 08:03:02 -07:00
|
|
|
void LeaveGroup(SessionInfo session, LeaveGroupRequest request, 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-11-28 08:03:02 -07:00
|
|
|
/// <param name="request">The request.</param>
|
2020-09-24 14:04:21 -07:00
|
|
|
/// <returns>The list of available groups.</returns>
|
2020-11-28 08:03:02 -07:00
|
|
|
List<GroupInfoDto> ListGroups(SessionInfo session, ListGroupsRequest request);
|
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>
|
2020-11-13 07:13:32 -07:00
|
|
|
void HandleRequest(SessionInfo session, IGroupPlaybackRequest request, CancellationToken cancellationToken);
|
2020-12-07 02:33:15 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks whether a user has an active session using SyncPlay.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user identifier to check.</param>
|
|
|
|
/// <returns><c>true</c> if the user is using SyncPlay; <c>false</c> otherwise.</returns>
|
|
|
|
bool IsUserActive(Guid userId);
|
2020-04-01 08:52:42 -07:00
|
|
|
}
|
|
|
|
}
|