C# Class OpenSyno.Services.PlaybackService

Inheritance: IPlaybackService, IAudioRenderingService
显示文件 Open project: salfab/open-syno

Public Methods

Method Description
ClearTracksInQueue ( ) : void
GetCurrentTrack ( ) : GuidToTrackMapping
GetTracksCountInQueue ( ) : int
GetTracksInQueue ( ) : IEnumerable
GetVolume ( ) : double
InsertTracksToQueue ( IEnumerable tracks, int insertPosition, Guid>.Action callback ) : void
InvalidateCachedTokens ( ) : void

Invalidates the cached tokens.

Used to make sure we purge the fix for the uri containing non-ascii7 characters. The current architecture relies on the fact that we only change the token if the cached token is outdated. fixes use url-shortening services and have their token enclosed, so it is necessary not to update the cached token indepedently from the cached uri fixes !

Pause ( ) : void
PausePlayback ( ) : void
PlayTrackInQueue ( System.Guid trackToPlay ) : void

Clears the play queue.

Inserts the specified tracks to the play queue.

Plays the specified track. It must be present in the queue.

PlaybackService ( IAudioStationSession audioStationSession, IAudioTrackFactory audioTrackFactory, IVersionDependentResourcesProvider versionDependentResourceProvider ) : System

Initializes a new instance of the PlaybackService class.

RemoveTracksFromQueue ( IEnumerable tracksToRemove ) : void
Resume ( ) : void
ResumePlayback ( ) : void
SetVolume ( double volume ) : void
SkipNext ( ) : void
SkipPrevious ( ) : void
StreamTrack ( System.Guid guidOfTrackToPlay ) : void

Protected Methods

Method Description
OnTrackStarted ( TrackStartedEventArgs trackStartedEventArgs ) : void

Private Methods

Method Description
BackgroundPlayerPlayStateChanged ( object sender, EventArgs e ) : void
DetectAffectedTracksAndBuildFix ( List potentiallyUnsafeMappings, Guid>.Action callback ) : void

Detects the affected tracks and build a fix.

OnBufferingProgressUpdated ( BufferingProgressUpdatedEventArgs bufferingProgressUpdatedEventArgs ) : void
OnMediaPositionChanged ( object sender, MediaPositionChangedEventArgs e ) : void
OnTrackCurrentPositionChanged ( MediaPositionChangedEventArgs mediaPositionChangedEventArgs ) : void
OnTracksInQueueChanged ( PlayqueueChangedEventArgs eventArgs ) : void
SerializeAsciiUriFixes ( ) : void
SerializePlayqueue ( ) : void

Method Details

ClearTracksInQueue() public method

public ClearTracksInQueue ( ) : void
return void

GetCurrentTrack() public method

public GetCurrentTrack ( ) : GuidToTrackMapping
return OpenSyno.Contracts.Domain.GuidToTrackMapping

GetTracksCountInQueue() public method

public GetTracksCountInQueue ( ) : int
return int

GetTracksInQueue() public method

public GetTracksInQueue ( ) : IEnumerable
return IEnumerable

GetVolume() public method

public GetVolume ( ) : double
return double

InsertTracksToQueue() public method

public InsertTracksToQueue ( IEnumerable tracks, int insertPosition, Guid>.Action callback ) : void
tracks IEnumerable
insertPosition int
callback Guid>.Action
return void

InvalidateCachedTokens() public method

Invalidates the cached tokens.
Used to make sure we purge the fix for the uri containing non-ascii7 characters. The current architecture relies on the fact that we only change the token if the cached token is outdated. fixes use url-shortening services and have their token enclosed, so it is necessary not to update the cached token indepedently from the cached uri fixes !
public InvalidateCachedTokens ( ) : void
return void

OnTrackStarted() protected method

protected OnTrackStarted ( TrackStartedEventArgs trackStartedEventArgs ) : void
trackStartedEventArgs TrackStartedEventArgs
return void

Pause() public method

public Pause ( ) : void
return void

PausePlayback() public method

public PausePlayback ( ) : void
return void

PlayTrackInQueue() public method

Clears the play queue. Inserts the specified tracks to the play queue. Plays the specified track. It must be present in the queue.
public PlayTrackInQueue ( System.Guid trackToPlay ) : void
trackToPlay System.Guid The track to play.
return void

PlaybackService() public method

Initializes a new instance of the PlaybackService class.
public PlaybackService ( IAudioStationSession audioStationSession, IAudioTrackFactory audioTrackFactory, IVersionDependentResourcesProvider versionDependentResourceProvider ) : System
audioStationSession IAudioStationSession
audioTrackFactory IAudioTrackFactory
versionDependentResourceProvider IVersionDependentResourcesProvider
return System

RemoveTracksFromQueue() public method

public RemoveTracksFromQueue ( IEnumerable tracksToRemove ) : void
tracksToRemove IEnumerable
return void

Resume() public method

public Resume ( ) : void
return void

ResumePlayback() public method

public ResumePlayback ( ) : void
return void

SetVolume() public method

public SetVolume ( double volume ) : void
volume double
return void

SkipNext() public method

public SkipNext ( ) : void
return void

SkipPrevious() public method

public SkipPrevious ( ) : void
return void

StreamTrack() public method

public StreamTrack ( System.Guid guidOfTrackToPlay ) : void
guidOfTrackToPlay System.Guid
return void