C# Класс SpotiFire.SessionExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
GetAwaiter ( this album ) : TaskAwaiter
GetAwaiter ( this artist ) : TaskAwaiter
GetAwaiter ( this playlist ) : TaskAwaiter
GetAwaiter ( this track ) : TaskAwaiter
Play ( this session, Track track ) : System.Threading.Tasks.Task

A Session extension method that plays a single track and notifies it's completion.

This single extension-method takes care of unloading (in case there are any other tracks playing), loading, and starting playback of a single track. Then, when the track is complete, it signals the task. This enables for easy programming of behaviour such as playing through an entire playlist, or simply playing random songs non-stop. Queueing is also easily implemented with this method. However, this method is not meant to be used in combinations with the ability to change what track you are currently listening to. If your application (one way or another) allows the user (or some AI) to select a new song, whilst there is one playing, you SHOULD not use this method, as it can have un-wanted sideeffects (in the magnitude of your application crashing and dying horribly).

The inner workings of this method is implemented using the Session.EndOfTrack event. Every time you call this method an event-handler is attatched to the Session.EndOfTrack event. This means that if you call this method again (before the song is finished), it will attatch a second event-handler, and then a third, and so forth. This can probably be resolved (one way or another), but for now, this functionality is not supported.

Save ( this image, string location ) : void
Search ( this session, string query, int trackOffset, int trackCount, int albumOffset, int albumCount, int artistOffset, int artistCount, int playlistOffset, int playlistCount, SearchType type ) : Search
SearchAlbums ( this session, string query, int albumOffset, int albumCount ) : Search
SearchArtists ( this session, string query, int artistOffset, int artistCount ) : Search
SearchPlaylist ( this session, string query, int playlistOffset, int playlistCount ) : Search
SearchTracks ( this session, string query, int trackOffset, int trackCount ) : Search

Приватные методы

Метод Описание
Load ( this loadable ) : Task
OnTimerTick ( object state ) : void
SessionExtensions ( ) : System

Описание методов

GetAwaiter() публичный статический Метод

public static GetAwaiter ( this album ) : TaskAwaiter
album this
Результат TaskAwaiter

GetAwaiter() публичный статический Метод

public static GetAwaiter ( this artist ) : TaskAwaiter
artist this
Результат TaskAwaiter

GetAwaiter() публичный статический Метод

public static GetAwaiter ( this playlist ) : TaskAwaiter
playlist this
Результат TaskAwaiter

GetAwaiter() публичный статический Метод

public static GetAwaiter ( this track ) : TaskAwaiter
track this
Результат TaskAwaiter

Play() публичный статический Метод

A Session extension method that plays a single track and notifies it's completion.

This single extension-method takes care of unloading (in case there are any other tracks playing), loading, and starting playback of a single track. Then, when the track is complete, it signals the task. This enables for easy programming of behaviour such as playing through an entire playlist, or simply playing random songs non-stop. Queueing is also easily implemented with this method. However, this method is not meant to be used in combinations with the ability to change what track you are currently listening to. If your application (one way or another) allows the user (or some AI) to select a new song, whilst there is one playing, you SHOULD not use this method, as it can have un-wanted sideeffects (in the magnitude of your application crashing and dying horribly).

The inner workings of this method is implemented using the Session.EndOfTrack event. Every time you call this method an event-handler is attatched to the Session.EndOfTrack event. This means that if you call this method again (before the song is finished), it will attatch a second event-handler, and then a third, and so forth. This can probably be resolved (one way or another), but for now, this functionality is not supported.

public static Play ( this session, Track track ) : System.Threading.Tasks.Task
session this The session to act on.
track Track The track.
Результат System.Threading.Tasks.Task

Save() публичный статический Метод

public static Save ( this image, string location ) : void
image this
location string
Результат void

Search() публичный статический Метод

public static Search ( this session, string query, int trackOffset, int trackCount, int albumOffset, int albumCount, int artistOffset, int artistCount, int playlistOffset, int playlistCount, SearchType type ) : Search
session this
query string
trackOffset int
trackCount int
albumOffset int
albumCount int
artistOffset int
artistCount int
playlistOffset int
playlistCount int
type SearchType
Результат Search

SearchAlbums() публичный статический Метод

public static SearchAlbums ( this session, string query, int albumOffset, int albumCount ) : Search
session this
query string
albumOffset int
albumCount int
Результат Search

SearchArtists() публичный статический Метод

public static SearchArtists ( this session, string query, int artistOffset, int artistCount ) : Search
session this
query string
artistOffset int
artistCount int
Результат Search

SearchPlaylist() публичный статический Метод

public static SearchPlaylist ( this session, string query, int playlistOffset, int playlistCount ) : Search
session this
query string
playlistOffset int
playlistCount int
Результат Search

SearchTracks() публичный статический Метод

public static SearchTracks ( this session, string query, int trackOffset, int trackCount ) : Search
session this
query string
trackOffset int
trackCount int
Результат Search