// Copyright (c) Arlo Godfrey. All Rights Reserved.
// Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms.
// See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information.
using System;
using System.Threading;
using System.Threading.Tasks;
namespace StrixMusic.Sdk.BaseModels
{
///
/// A collection of tracks and the properties and methods for using and manipulating them.
///
public interface ITrackCollectionBase : IPlayableCollectionBase, IAsyncDisposable
{
///
/// The total number of available Tracks.
///
int TotalTrackCount { get; }
///
/// If true, can be used.
///
bool IsPlayTrackCollectionAsyncAvailable { get; }
///
/// If true, can be used.
///
bool IsPauseTrackCollectionAsyncAvailable { get; }
///
/// Attempts to play the Track collection, or resumes playback if already playing.
///
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task PlayTrackCollectionAsync(CancellationToken cancellationToken = default);
///
/// Attempts to pause the Track collection.
///
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task PauseTrackCollectionAsync(CancellationToken cancellationToken = default);
///
/// Removes the track from the collection on the backend.
///
/// The index of the track to remove.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task RemoveTrackAsync(int index, CancellationToken cancellationToken = default);
///
/// Checks if the backend supports adding an at a specific index.
///
/// A representing the asynchronous operation. If value is true, a new can be added.
Task IsAddTrackAvailableAsync(int index, CancellationToken cancellationToken = default);
///
/// Checks if the backend supports removing an at a specific index.
///
/// A representing the asynchronous operation. If value is true, the can be removed.
Task IsRemoveTrackAvailableAsync(int index, CancellationToken cancellationToken = default);
///
/// Raised when changes.
///
event EventHandler? IsPlayTrackCollectionAsyncAvailableChanged;
///
/// Raised when changes.
///
event EventHandler? IsPauseTrackCollectionAsyncAvailableChanged;
///
/// Fires when the merged changes.
///
event EventHandler? TracksCountChanged;
}
}