namespace Lumi.Companion.SongOverlay.Providers;

internal interface IMediaProvider : IAsyncDisposable
{
    string Id { get; }
    string DisplayName { get; }
    event EventHandler<ProviderStateChangedEventArgs>? StateChanged;
    event EventHandler<string>? AvailabilityChanged;
    Task StartAsync(CancellationToken cancellationToken);
    Task StopAsync(CancellationToken cancellationToken);
    Task<MediaSnapshot?> GetSnapshotAsync(CancellationToken cancellationToken);
}

internal sealed class ProviderStateChangedEventArgs : EventArgs
{
    public ProviderStateChangedEventArgs(string reason, MediaSnapshot? snapshot)
    {
        Reason = reason;
        Snapshot = snapshot;
    }

    public string Reason { get; }
    public MediaSnapshot? Snapshot { get; }
}
