C# 클래스 SpotiFire.SessionExtensions

파일 보기 프로젝트 열기: Alxandr/SpotiFire

공개 메소드들

메소드 설명
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