First POC with working playback
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.JellyLMS.Models;
|
||||
|
||||
namespace Jellyfin.Plugin.JellyLMS.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for LMS JSON-RPC API communication.
|
||||
/// </summary>
|
||||
public interface ILmsApiClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests the connection to the LMS server.
|
||||
/// </summary>
|
||||
/// <returns>Server status with connection result.</returns>
|
||||
Task<LmsServerStatus> TestConnectionAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Gets all players connected to LMS.
|
||||
/// </summary>
|
||||
/// <returns>List of LMS players.</returns>
|
||||
Task<List<LmsPlayer>> GetPlayersAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the status of a specific player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>The player status.</returns>
|
||||
Task<PlayerStatusResult?> GetPlayerStatusAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Plays a URL on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <param name="url">The audio URL to play.</param>
|
||||
/// <param name="title">Optional title for display.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> PlayUrlAsync(string playerMac, string url, string? title = null);
|
||||
|
||||
/// <summary>
|
||||
/// Pauses playback on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> PauseAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Resumes playback on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> PlayAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Stops playback on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> StopAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the volume on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <param name="volume">Volume level (0-100).</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> SetVolumeAsync(string playerMac, int volume);
|
||||
|
||||
/// <summary>
|
||||
/// Seeks to a position on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <param name="positionSeconds">Position in seconds.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> SeekAsync(string playerMac, double positionSeconds);
|
||||
|
||||
/// <summary>
|
||||
/// Powers on the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> PowerOnAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Powers off the specified player.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> PowerOffAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Syncs a slave player to a master player.
|
||||
/// </summary>
|
||||
/// <param name="masterMac">The master player's MAC address.</param>
|
||||
/// <param name="slaveMac">The slave player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> SyncPlayerAsync(string masterMac, string slaveMac);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a player from its sync group.
|
||||
/// </summary>
|
||||
/// <param name="playerMac">The player's MAC address.</param>
|
||||
/// <returns>True if successful.</returns>
|
||||
Task<bool> UnsyncPlayerAsync(string playerMac);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all current sync groups.
|
||||
/// </summary>
|
||||
/// <returns>List of sync groups.</returns>
|
||||
Task<List<SyncGroup>> GetSyncGroupsAsync();
|
||||
}
|
||||
Reference in New Issue
Block a user