Interface IDeviceBase
A device that controls playback of an audio player.
Inherited Members
Namespace: StrixMusic.Sdk.BaseModels
Assembly: StrixMusic.Sdk.dll
Syntax
public interface IDeviceBase : IAudioPlayerBase
Properties
| Improve this Doc View SourceId
A unique identifier for the player.
Declaration
string Id { get; }
Property Value
Type | Description |
---|---|
string |
IsActive
If true, the device is currently active and playing audio.
Declaration
bool IsActive { get; }
Property Value
Type | Description |
---|---|
bool |
IsChangePlaybackSpeedAvailable
If true, ChangePlaybackSpeedAsync(double, CancellationToken) is supported.
Declaration
bool IsChangePlaybackSpeedAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsChangeVolumeAsyncAvailable
If true, ChangeVolumeAsync(double, CancellationToken) is supported.
Declaration
bool IsChangeVolumeAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsNextAsyncAvailable
If true, NextAsync(CancellationToken) is supported.
Declaration
bool IsNextAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsPauseAsyncAvailable
If true, PauseAsync(CancellationToken) is supported.
Declaration
bool IsPauseAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsPreviousAsyncAvailable
If true, PreviousAsync(CancellationToken) is supported.
Declaration
bool IsPreviousAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsResumeAsyncAvailable
If true, ResumeAsync(CancellationToken) is supported.
Declaration
bool IsResumeAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsSeekAsyncAvailable
If true, SeekAsync(TimeSpan, CancellationToken) is supported.
Declaration
bool IsSeekAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsToggleRepeatAsyncAvailable
If true, ToggleRepeatAsync(CancellationToken) is supported.
Declaration
bool IsToggleRepeatAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
IsToggleShuffleAsyncAvailable
If true, ToggleShuffleAsync(CancellationToken) is supported.
Declaration
bool IsToggleShuffleAsyncAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
Name
The displayed name of this device.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
PlaybackContext
The context of the currently playing track.
Declaration
IPlayableBase? PlaybackContext { get; }
Property Value
Type | Description |
---|---|
IPlayableBase |
RepeatState
Declaration
RepeatState RepeatState { get; }
Property Value
Type | Description |
---|---|
RepeatState |
ShuffleState
True if the player is using a shuffled track list.
Declaration
bool ShuffleState { get; }
Property Value
Type | Description |
---|---|
bool |
Type
Describes the type of device used for playback.
Declaration
DeviceType Type { get; }
Property Value
Type | Description |
---|---|
DeviceType |
Remarks
If the device type is anything but Remote, playback is expected to be handled outside of a core (by a playback handler in the SDK, for example).
Methods
| Improve this Doc View SourceNextAsync(CancellationToken)
Advances to the next track. If there is no next track, playback is paused.
Declaration
Task NextAsync(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. |
PreviousAsync(CancellationToken)
Goes to the previous track.
Declaration
Task PreviousAsync(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. |
SwitchToAsync(CancellationToken)
Switches to this device.
Declaration
Task SwitchToAsync(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. |
ToggleRepeatAsync(CancellationToken)
Asks the device to toggle to the next repeat state.
Declaration
Task ToggleRepeatAsync(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. |
ToggleShuffleAsync(CancellationToken)
Toggles shuffle on or off.
Declaration
Task ToggleShuffleAsync(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. |
Events
| Improve this Doc View SourceIsActiveChanged
Fires when IsActive changes.
Declaration
event EventHandler<bool>? IsActiveChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |
PlaybackContextChanged
Fires when PlaybackContext changes.
Declaration
event EventHandler<IPlayableBase?>? PlaybackContextChanged
Event Type
Type | Description |
---|---|
EventHandler<IPlayableBase> |
RepeatStateChanged
Fires when RepeatState changes.
Declaration
event EventHandler<RepeatState>? RepeatStateChanged
Event Type
Type | Description |
---|---|
EventHandler<RepeatState> |
ShuffleStateChanged
Fires when ShuffleState changes.
Declaration
event EventHandler<bool>? ShuffleStateChanged
Event Type
Type | Description |
---|---|
EventHandler<bool> |