// 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.Globalization;
using System.Threading;
using System.Threading.Tasks;
using StrixMusic.Sdk.AppModels;
namespace StrixMusic.Sdk.BaseModels
{
///
/// Represents an audio stream with metadata that belongs to an .
///
public interface ITrackBase : IPlayableCollectionItem, IArtistCollectionBase, IGenreCollectionBase, IAsyncDisposable
{
///
TrackType Type { get; }
///
/// Position in the album.
///
///
/// If an album has several discs, the track number is the number on the specified disc.
///
int? TrackNumber { get; }
///
/// The disc number (usually 1 unless the album consists of more than one disc).
///
int? DiscNumber { get; }
///
/// The language for this track.
///
/// If track has no spoken words (instrumental), value is . If unknown, value is .
CultureInfo? Language { get; }
///
/// If this track contains explicit language.
///
bool IsExplicit { get; }
///
/// If true, changing albums is supported.
///
bool IsChangeAlbumAsyncAvailable { get; }
///
/// If true, is supported.
///
bool IsChangeTrackNumberAsyncAvailable { get; }
///
/// If true, is supported.
///
bool IsChangeLanguageAsyncAvailable { get; }
///
/// If true, changing lyrics is supported.
///
bool IsChangeLyricsAsyncAvailable { get; }
///
/// If true, is supported.
///
bool IsChangeIsExplicitAsyncAvailable { get; }
///
/// Changes the on this track.
///
/// The new track number.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task ChangeTrackNumberAsync(int? trackNumber, CancellationToken cancellationToken = default);
///
/// Changes the for this track.
///
/// The new language for this track.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task ChangeLanguageAsync(CultureInfo language, CancellationToken cancellationToken = default);
///
/// Changes the for this track.
///
/// The new value.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task ChangeIsExplicitAsync(bool isExplicit, CancellationToken cancellationToken = default);
///
/// Fires when the metadata changes.
///
event EventHandler? TrackNumberChanged;
///
/// Fires when the metadata changes.
///
event EventHandler? LanguageChanged;
///
/// Fires when the metadata changes.
///
event EventHandler? IsExplicitChanged;
}
}