ITunerHostManager.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. using MediaBrowser.Model.Dto;
  5. using MediaBrowser.Model.LiveTv;
  6. namespace MediaBrowser.Controller.LiveTv;
  7. /// <summary>
  8. /// Service responsible for managing the <see cref="ITunerHost"/>s.
  9. /// </summary>
  10. public interface ITunerHostManager
  11. {
  12. /// <summary>
  13. /// Gets the available <see cref="ITunerHost"/>s.
  14. /// </summary>
  15. IReadOnlyList<ITunerHost> TunerHosts { get; }
  16. /// <summary>
  17. /// Gets the <see cref="NameIdPair"/>s for the available <see cref="ITunerHost"/>s.
  18. /// </summary>
  19. /// <returns>The <see cref="NameIdPair"/>s.</returns>
  20. IEnumerable<NameIdPair> GetTunerHostTypes();
  21. /// <summary>
  22. /// Saves the tuner host.
  23. /// </summary>
  24. /// <param name="info">Turner host to save.</param>
  25. /// <param name="dataSourceChanged">Option to specify that data source has changed.</param>
  26. /// <returns>Tuner host information wrapped in a task.</returns>
  27. Task<TunerHostInfo> SaveTunerHost(TunerHostInfo info, bool dataSourceChanged = true);
  28. /// <summary>
  29. /// Discovers the available tuners.
  30. /// </summary>
  31. /// <param name="newDevicesOnly">A value indicating whether to only return new devices.</param>
  32. /// <returns>The <see cref="TunerHostInfo"/>s.</returns>
  33. IAsyncEnumerable<TunerHostInfo> DiscoverTuners(bool newDevicesOnly);
  34. /// <summary>
  35. /// Scans for tuner devices that have changed URLs.
  36. /// </summary>
  37. /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
  38. /// <returns>A task that represents the scanning operation.</returns>
  39. Task ScanForTunerDeviceChanges(CancellationToken cancellationToken);
  40. }