// 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.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.Input;
using OwlCore.Provisos;
using StrixMusic.Sdk.AppModels;
using StrixMusic.Sdk.BaseModels;
namespace StrixMusic.Sdk.ViewModels
{
///
/// An interfaced ViewModel for .
/// This is needed so because multiple view models implement ,
/// and the UI needs to create controls that handle only the ViewModels properties for an .
///
public interface IPlaylistCollectionViewModel : ISdkViewModel, IPlaylistCollection, IUrlCollectionViewModel, IAsyncInit
{
///
/// Keeps the default track collection while sorting.
///
public ObservableCollection UnsortedPlaylists { get; }
///
/// The playlists in this collection
///
public ObservableCollection Playlists { get; }
///
/// The current sorting of the playlists.
///
public PlaylistSortingType CurrentPlaylistSortingType { get; }
///
/// The current sorting of the playlists.
///
public SortDirection CurrentPlaylistSortingDirection { get; }
///
/// Populates the next set of playlists into the collection.
///
/// The number of items to load.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
public Task PopulateMorePlaylistsAsync(int limit, CancellationToken cancellationToken = default);
///
/// Loads the entire collection of s and ensures all sources are merged.
///
/// A representing the asynchronous operation.
public Task InitPlaylistCollectionAsync(CancellationToken cancellationToken = default);
///
/// Initializes the list of the .
///
public IAsyncRelayCommand InitPlaylistCollectionAsyncCommand { get; }
///
public IAsyncRelayCommand PopulateMorePlaylistsCommand { get; }
///
/// Sorts the playlist collection by .
///
/// The by which to sort.
/// The direction by which to sort.
public void SortPlaylistCollection(PlaylistSortingType playlistSorting, SortDirection sortDirection);
///
public IAsyncRelayCommand PlayPlaylistCollectionAsyncCommand { get; }
///
/// Plays a single playlist from this playlist collection.
///
public IAsyncRelayCommand PlayPlaylistAsyncCommand { get; }
///
///
///
public IAsyncRelayCommand PausePlaylistCollectionAsyncCommand { get; }
///
/// Sorts the collection with a new type.
///
public IRelayCommand ChangePlaylistCollectionSortingTypeCommand { get; }
///
/// Sorts the collection with a new direction.
///
public IRelayCommand ChangePlaylistCollectionSortingDirectionCommand { get; }
}
}