Interface ITrackCollection
A collection of ITracks and the properties and methods for using and manipulating them.
Inherited Members
Namespace: StrixMusic.Sdk.AppModels
Assembly: StrixMusic.Sdk.dll
Syntax
public interface ITrackCollection : ITrackCollectionBase, IPlayableCollectionBase, IPlayableCollectionItem, ICollectionItemBase, IPlayable, IPlayableBase, IDownloadable, IImageCollection, IImageCollectionBase, IMerged<ICoreImageCollection>, IEquatable<ICoreImageCollection>, IUrlCollection, IUrlCollectionBase, ICollectionBase, IMerged<ICoreUrlCollection>, IEquatable<ICoreUrlCollection>, IAppModel, IMerged<ICoreTrackCollection>, IEquatable<ICoreTrackCollection>, IMerged
Remarks
Instances of this class may contain data merged from one or more sources.
Methods
| Improve this Doc View SourceAddTrackAsync(ITrack, int, CancellationToken)
Adds an ITrack to this track collection.
Declaration
Task AddTrackAsync(ITrack track, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ITrack | track | The track to add. |
int | index | the position to insert the track at. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
GetTracksAsync(int, int, CancellationToken)
Gets a requested number of ITracks starting at the given offset.
Declaration
IAsyncEnumerable<ITrack> GetTracksAsync(int limit, int offset, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | limit | The max number of items to return. |
int | offset | Get items starting at this index. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<ITrack> | The requested range of items. |
PlayTrackCollectionAsync(ITrack, CancellationToken)
Attempts to play a specific item in the track collection. Restarts playback if already playing.
Declaration
Task PlayTrackCollectionAsync(ITrack track, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ITrack | track | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Events
| Improve this Doc View SourceTracksChanged
Fires when the items in the backend are changed by something external.
Declaration
event CollectionChangedEventHandler<ITrack>? TracksChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<ITrack> |