C# Class Last.fm_Scrubbler_WPF.ViewModels.ITunesScrobbleViewModel

ViewModel for the Views.ITunesScrobbleView.
Inheritance: ScrobbleViewModelBase, IDisposable
显示文件 Open project: coczero/Last.fm-Scrubbler-WPF Class Usage Examples

Public Methods

Method Description
ConnectToITunes ( ) : void

Connects/reconnects to iTunes.

DisconnectFromITunes ( ) : void

Disposes the current connection to the iTunes com.

Dispose ( ) : void

Cleans up.

ITunesScrobbleViewModel ( ) : IF.Lastfm.Core.Objects

Constructor.

Preview ( ) : void

Does nothing here.

Scrobble ( ) : System.Threading.Tasks.Task

Scrobbles the current song.

Private Methods

Method Description
FetchAlbumArtwork ( ) : System.Threading.Tasks.Task

Gets the album artwork of the current track.

GetCurrentTrackInfo ( ) : void

Gets the info of the currently playing track.

_app_AboutToQuitEvent ( ) : void

Disconnect when iTunes is about to close.

_app_OnPlayerPlayEvent ( object iTrack ) : void

Starts the _countTimer

_app_OnPlayerStopEvent ( object iTrack ) : void

Stops the _countTimer

_countTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Counts up and scrobbles if the track has been played longer than 50%.

_refreshTimer_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Checks if the current playing song is still the same. If not, prepare for new track.

Method Details

ConnectToITunes() public method

Connects/reconnects to iTunes.
public ConnectToITunes ( ) : void
return void

DisconnectFromITunes() public method

Disposes the current connection to the iTunes com.
public DisconnectFromITunes ( ) : void
return void

Dispose() public method

Cleans up.
public Dispose ( ) : void
return void

ITunesScrobbleViewModel() public method

Constructor.
public ITunesScrobbleViewModel ( ) : IF.Lastfm.Core.Objects
return IF.Lastfm.Core.Objects

Preview() public method

Does nothing here.
public Preview ( ) : void
return void

Scrobble() public method

Scrobbles the current song.
public Scrobble ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task