Class AlbumCollectionPluginBase
An implementation of IAlbumCollection which delegates all member access to the Inner implementation, unless the member is overridden in a derived class which changes the behavior.
Implements
Inherited Members
Namespace: StrixMusic.Sdk.Plugins.Model
Assembly: StrixMusic.Sdk.dll
Syntax
public class AlbumCollectionPluginBase : IModelPlugin, IAlbumCollection, IAlbumCollectionBase, IPlayableCollectionBase, IAlbumCollectionItem, IAlbumCollectionItemBase, IPlayableCollectionItem, ICollectionItemBase, IMerged<ICoreAlbumCollectionItem>, IEquatable<ICoreAlbumCollectionItem>, IPlayable, IPlayableBase, IDownloadable, IImageCollection, IImageCollectionBase, IMerged<ICoreImageCollection>, IEquatable<ICoreImageCollection>, IUrlCollection, IUrlCollectionBase, ICollectionBase, IMerged<ICoreUrlCollection>, IEquatable<ICoreUrlCollection>, IAppModel, IMerged<ICoreAlbumCollection>, IEquatable<ICoreAlbumCollection>, IMerged, IDelegatable<IAlbumCollection>
Constructors
| Improve this Doc View SourceAlbumCollectionPluginBase(ModelPluginMetadata, IAlbumCollection)
Creates a new instance of AlbumCollectionPluginBase.
Declaration
protected AlbumCollectionPluginBase(ModelPluginMetadata registration, IAlbumCollection inner)
Parameters
Type | Name | Description |
---|---|---|
ModelPluginMetadata | registration | Metadata about the plugin which was provided during registration. |
IAlbumCollection | inner | The implementation which all member access is delegated to, unless the member is overridden in a derived class which changes the behavior. |
Properties
| Improve this Doc View SourceAddedAt
The date this item was added to a collection. If unknown, value is null.
Declaration
public virtual DateTime? AddedAt { get; }
Property Value
Type | Description |
---|---|
DateTime? |
Remarks
This property has no counterpart "changed" events or supporting properties. Since the item must be added to a collection for the data to change, a new instance with updated data would be used.
Description
Provides comments about the item. This may contain markdown content.
Declaration
public virtual string? Description { get; }
Property Value
Type | Description |
---|---|
string |
DownloadInfo
Information about downloading this item.
Declaration
public virtual DownloadInfo DownloadInfo { get; }
Property Value
Type | Description |
---|---|
DownloadInfo |
Duration
How long the playable item takes to complete playback.
Declaration
public virtual TimeSpan Duration { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Remarks
If not applicable, use Zero.
Id
The ID of the playable item.
Declaration
public virtual string Id { get; }
Property Value
Type | Description |
---|---|
string |
Inner
Declaration
public IAlbumCollection Inner { get; set; }
Property Value
Type | Description |
---|---|
IAlbumCollection |
InnerDownloadable
A wrapped implementation which member access can be delegated to. Defaults to Inner.
Declaration
public IDownloadable InnerDownloadable { get; set; }
Property Value
Type | Description |
---|---|
IDownloadable |
InnerImageCollection
A wrapped implementation which member access can be delegated to. Defaults to Inner.
Declaration
public IImageCollection InnerImageCollection { get; set; }
Property Value
Type | Description |
---|---|
IImageCollection |
InnerPlayable
A wrapped implementation which member access can be delegated to. Defaults to Inner.
Declaration
public IPlayable InnerPlayable { get; set; }
Property Value
Type | Description |
---|---|
IPlayable |
InnerUrlCollection
A wrapped implementation which member access can be delegated to. Defaults to Inner.
Declaration
public IUrlCollection InnerUrlCollection { get; set; }
Property Value
Type | Description |
---|---|
IUrlCollection |
IsChangeDescriptionAsyncAvailable
If true, ChangeDescriptionAsync(string?, CancellationToken) can be used.
Declaration
public virtual bool IsChangeDescriptionAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsChangeDurationAsyncAvailable
If true, ChangeDurationAsync(TimeSpan, CancellationToken) can be used.
Declaration
public virtual bool IsChangeDurationAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsChangeNameAsyncAvailable
If true, ChangeNameAsync(string, CancellationToken) can be used.
Declaration
public virtual bool IsChangeNameAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsPauseAlbumCollectionAsyncAvailable
If true, PauseAlbumCollectionAsync(CancellationToken) can be used.
Declaration
public virtual bool IsPauseAlbumCollectionAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsPlayAlbumCollectionAsyncAvailable
If true, PlayAlbumCollectionAsync(CancellationToken) can be used.
Declaration
public virtual bool IsPlayAlbumCollectionAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
LastPlayed
The last time the item was played. If never played or unknown, value is null.
Declaration
public virtual DateTime? LastPlayed { get; }
Property Value
Type | Description |
---|---|
DateTime? |
Metadata
Metadata about the plugin which was provided during registration.
Declaration
public ModelPluginMetadata Metadata { get; }
Property Value
Type | Description |
---|---|
ModelPluginMetadata |
Name
Name of the playable item.
Declaration
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
string |
PlaybackState
Current playback state.
Declaration
public virtual PlaybackState PlaybackState { get; }
Property Value
Type | Description |
---|---|
PlaybackState |
TotalAlbumItemsCount
The total number of available Albums.
Declaration
public virtual int TotalAlbumItemsCount { get; }
Property Value
Type | Description |
---|---|
int |
TotalImageCount
The total number of images in the collection.
Declaration
public virtual int TotalImageCount { get; }
Property Value
Type | Description |
---|---|
int |
TotalUrlCount
The total number of urls in this collection.
Declaration
public virtual int TotalUrlCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAddAlbumItemAsync(IAlbumCollectionItem, int, CancellationToken)
Adds an IAlbum or IAlbumCollection to this album collection.
Declaration
public virtual Task AddAlbumItemAsync(IAlbumCollectionItem albumItem, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IAlbumCollectionItem | albumItem | The album to add. |
int | index | the position to insert the album 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. |
AddImageAsync(IImage, int, CancellationToken)
Adds a new image to the collection.
Declaration
public virtual Task AddImageAsync(IImage image, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IImage | image | The image to add. |
int | index | the position to insert the image 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. |
AddUrlAsync(IUrl, int, CancellationToken)
Adds a new url to the collection.
Declaration
public virtual Task AddUrlAsync(IUrl url, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUrl | url | The url to insert. |
int | index | the position to insert the url 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. |
ChangeDescriptionAsync(string?, CancellationToken)
Changes the Description for this item.
Declaration
public virtual Task ChangeDescriptionAsync(string? description, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | description | The new description for this playable item. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
ChangeDurationAsync(TimeSpan, CancellationToken)
Changes the Duration for this item.
Declaration
public virtual Task ChangeDurationAsync(TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | duration | The new duration for this playable item. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
ChangeNameAsync(string, CancellationToken)
Changes the Name of this playable item.
Declaration
public virtual Task ChangeNameAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The new name to use. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Equals(ICoreAlbumCollection?)
Declaration
public virtual bool Equals(ICoreAlbumCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreAlbumCollection | other |
Returns
Type | Description |
---|---|
bool |
Equals(ICoreAlbumCollectionItem?)
Declaration
public virtual bool Equals(ICoreAlbumCollectionItem? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreAlbumCollectionItem | other |
Returns
Type | Description |
---|---|
bool |
Equals(ICoreImageCollection?)
Declaration
public virtual bool Equals(ICoreImageCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreImageCollection | other |
Returns
Type | Description |
---|---|
bool |
Equals(ICoreUrlCollection?)
Declaration
public virtual bool Equals(ICoreUrlCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreUrlCollection | other |
Returns
Type | Description |
---|---|
bool |
GetAlbumItemsAsync(int, int, CancellationToken)
Gets a requested number of IAlbumCollectionItemBases starting at the given offset in the backend.
Declaration
public virtual IAsyncEnumerable<IAlbumCollectionItem> GetAlbumItemsAsync(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<IAlbumCollectionItem> | The requested range of items. |
GetImagesAsync(int, int, CancellationToken)
Gets a requested number of IImageBases starting at the given offset.
Declaration
public virtual IAsyncEnumerable<IImage> GetImagesAsync(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<IImage> | The requested range of items. |
GetUrlsAsync(int, int, CancellationToken)
Gets a requested number of IUrlBases starting at the given offset.
Declaration
public virtual IAsyncEnumerable<IUrl> GetUrlsAsync(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<IUrl> | The requested range of items. |
IsAddAlbumItemAvailableAsync(int, CancellationToken)
Checks if the backend supports adding an IAlbumCollectionItemBase at a specific index.
Declaration
public virtual Task<bool> IsAddAlbumItemAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, a new IAlbumCollectionItemBase can be added. |
IsAddImageAvailableAsync(int, CancellationToken)
Checks if adding a IImageBase to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsAddImageAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, a new IImageBase can be added. |
IsAddUrlAvailableAsync(int, CancellationToken)
Checks if adding a url to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsAddUrlAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, a new item can be added to the collection. |
IsRemoveAlbumItemAvailableAsync(int, CancellationToken)
Checks if the backend supports removing an IAlbumCollectionItemBase at a specific index.
Declaration
public virtual Task<bool> IsRemoveAlbumItemAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, the IAlbumCollectionItemBase can be removed. |
IsRemoveImageAvailableAsync(int, CancellationToken)
Checks if removing a IImageBase to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsRemoveImageAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, the IImageBase can be removed. |
IsRemoveUrlAvailableAsync(int, CancellationToken)
Checks if removing a url to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsRemoveUrlAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, the item can be removed from the collection.. |
PauseAlbumCollectionAsync(CancellationToken)
Attempts to pause the album collection.
Declaration
public virtual Task PauseAlbumCollectionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
PlayAlbumCollectionAsync(IAlbumCollectionItem, CancellationToken)
Attempts to play a specific item in the album collection. Restarts playback if already playing.
Declaration
public virtual Task PlayAlbumCollectionAsync(IAlbumCollectionItem albumItem, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IAlbumCollectionItem | albumItem | An item from the collection where playback begins. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
PlayAlbumCollectionAsync(CancellationToken)
Attempts to play the album collection, or resumes playback if already playing.
Declaration
public virtual Task PlayAlbumCollectionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RemoveAlbumItemAsync(int, CancellationToken)
Removes the album from the collection on the backend.
Declaration
public virtual Task RemoveAlbumItemAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the album to remove. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RemoveImageAsync(int, CancellationToken)
Removes the image from the collection on the backend.
Declaration
public virtual Task RemoveImageAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the image to remove. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RemoveUrlAsync(int, CancellationToken)
Removes a url from the collection.
Declaration
public virtual Task RemoveUrlAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | the position remove the url from. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
StartDownloadOperationAsync(DownloadOperation, CancellationToken)
Begins a download operation for this playable item.
Declaration
public virtual Task StartDownloadOperationAsync(DownloadOperation operation, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DownloadOperation | operation | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task that represents the asynchronous operation. |
Events
| Improve this Doc View SourceAlbumItemsChanged
Fires when the items in the backend are changed by something external.
Declaration
public virtual event CollectionChangedEventHandler<IAlbumCollectionItem>? AlbumItemsChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IAlbumCollectionItem> |
AlbumItemsCountChanged
Fires when the merged TotalAlbumItemsCount changes.
Declaration
public virtual event EventHandler<int>? AlbumItemsCountChanged
Event Type
Type | Description |
---|---|
EventHandler<int> |
DescriptionChanged
Raised when Description changes.
Declaration
public virtual event EventHandler<string?>? DescriptionChanged
Event Type
Type | Description |
---|---|
EventHandler<string> |
DownloadInfoChanged
Raised when DownloadInfo is updated.
Declaration
public virtual event EventHandler<DownloadInfo>? DownloadInfoChanged
Event Type
Type | Description |
---|---|
EventHandler<DownloadInfo> |
DurationChanged
Raised when Duration changes;
Declaration
public virtual event EventHandler<TimeSpan>? DurationChanged
Event Type
Type | Description |
---|---|
EventHandler<TimeSpan> |
ImagesChanged
Fires when the items are changed.
Declaration
public virtual event CollectionChangedEventHandler<IImage>? ImagesChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IImage> |
ImagesCountChanged
Fires when the merged number of images in the collection changes.
Declaration
public virtual event EventHandler<int>? ImagesCountChanged
Event Type
Type | Description |
---|---|
EventHandler<int> |
IsChangeDescriptionAsyncAvailableChanged
Raised when IsChangeDescriptionAsyncAvailable changes.
Declaration
public virtual event EventHandler<bool>? IsChangeDescriptionAsyncAvailableChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
IsChangeDurationAsyncAvailableChanged
Raised when IsChangeDurationAsyncAvailable changes.
Declaration
public virtual event EventHandler<bool>? IsChangeDurationAsyncAvailableChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
IsChangeNameAsyncAvailableChanged
Raised when IsChangeNameAsyncAvailable changes.
Declaration
public virtual event EventHandler<bool>? IsChangeNameAsyncAvailableChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
IsPauseAlbumCollectionAsyncAvailableChanged
Raised when IsPauseAlbumCollectionAsyncAvailable changes.
Declaration
public virtual event EventHandler<bool>? IsPauseAlbumCollectionAsyncAvailableChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
IsPlayAlbumCollectionAsyncAvailableChanged
Raised when IsPlayAlbumCollectionAsyncAvailable changes.
Declaration
public virtual event EventHandler<bool>? IsPlayAlbumCollectionAsyncAvailableChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
LastPlayedChanged
Raised when LastPlayed changes.
Declaration
public virtual event EventHandler<DateTime?>? LastPlayedChanged
Event Type
Type | Description |
---|---|
EventHandler<DateTime?> |
NameChanged
Raised when Name changes.
Declaration
public virtual event EventHandler<string>? NameChanged
Event Type
Type | Description |
---|---|
EventHandler<string> |
PlaybackStateChanged
Raised when PlaybackState changes.
Declaration
public virtual event EventHandler<PlaybackState>? PlaybackStateChanged
Event Type
Type | Description |
---|---|
EventHandler<PlaybackState> |
SourcesChanged
Raised when any of the sources have changed.
Declaration
public event EventHandler? SourcesChanged
Event Type
Type | Description |
---|---|
EventHandler |
UrlsChanged
Fires when the urls are changed.
Declaration
public virtual event CollectionChangedEventHandler<IUrl>? UrlsChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IUrl> |
UrlsCountChanged
Fires when the merged number of urls in the collection changes.
Declaration
public virtual event EventHandler<int>? UrlsCountChanged
Event Type
Type | Description |
---|---|
EventHandler<int> |