// 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;
using StrixMusic.Sdk.AdapterModels;
using StrixMusic.Sdk.BaseModels;
using StrixMusic.Sdk.CoreModels;
namespace StrixMusic.Sdk.AppModels
{
///
/// Represents an audio stream with metadata that belongs to an .
///
/// Instances of this class may contain data merged from one or more sources.
public interface ITrack : ITrackBase, IArtistCollection, IGenreCollection, IPlayable, IAppModel, IMerged
{
///
/// An object that this track belongs to.
///
IAlbum? Album { get; }
///
/// The lyrics for this track.
///
ILyrics? Lyrics { get; }
///
/// An of items related to this item.
///
#warning TODO needs a changed event to facilitate merging in new sources with non-null values.
IPlayableCollectionGroup? RelatedItems { get; }
///
/// Changes the for this track.
///
/// The new lyrics data.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task ChangeLyricsAsync(ILyrics? lyrics, CancellationToken cancellationToken = default);
///
/// Fires when the metadata changes.
///
event EventHandler? AlbumChanged;
///
/// Fires when the metadata changes.
///
event EventHandler? LyricsChanged;
///
/// Changes the album for this track.
///
/// The new album.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task ChangeAlbumAsync(IAlbum? album, CancellationToken cancellationToken = default);
}
}