// 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.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using OwlCore.Events;
using StrixMusic.Sdk.BaseModels;
namespace StrixMusic.Sdk.CoreModels
{
///
/// A collection of s and the properties and methods for using and manipulating them.
///
/// This interface should be implemented by a core.
public interface ICorePlayableCollectionGroupChildren : IPlayableCollectionGroupChildrenBase, ICoreMember
{
///
/// Attempts to play a specific item in the playable collection group. Restarts playback if already playing.
///
/// A representing the asynchronous operation.
Task PlayPlayableCollectionGroupAsync(ICorePlayableCollectionGroup collectionGroup, CancellationToken cancellationToken = default);
///
/// Gets a requested number of s starting at the given offset in the backend.
///
/// The max number of items to return.
/// Get items starting at this index.
/// A cancellation token that may be used to cancel the ongoing task.
/// that returns the items as they're retrieved.
IAsyncEnumerable GetChildrenAsync(int limit, int offset, CancellationToken cancellationToken = default);
///
/// Adds a new child to the collection on the backend.
///
/// The child to create.
/// the position to insert the child at.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task AddChildAsync(ICorePlayableCollectionGroup child, int index, CancellationToken cancellationToken = default);
///
/// Fires when the items in the backend are changed by something external.
///
event CollectionChangedEventHandler? ChildItemsChanged;
}
}