C# Class Tunez.StreamingPlayer

Wrapper around OutputQueue and AudioFileStream to allow streaming of various filetypes
Inheritance: IStreamingPlayer, IDisposable
Mostra file Open project: alanmcgovern/tunez

Public Properties

Property Type Description
outputQueue OutputAudioQueue

Private Properties

Property Type Description
AudioPacketDecoded void
AudioPropertyFound void
BeginPlayingAsync Task
CheckStatus void
EmitFinishedEvent void
EnqueueBuffer void
GetOrCreateAudioBuffer AudioBuffer
HandleBufferCompleted void
NeedsBuffer Task
ReportProgressAsync Task
Reset void
TryPause void
TryResume void
WaitForFinished Task
WaitForOutputReady Task

Public Methods

Method Description
Dispose ( ) : void
PlayAsync ( Stream stream, IProgress monitor, CancellationToken token ) : Task

Begins playing the audio stroed in the supplied stream

StreamingPlayer ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Cleaning up all the native Resource

Private Methods

Method Description
AudioPacketDecoded ( object sender, PacketReceivedEventArgs args ) : void

Saving the decoded Packets to our active Buffer, if the Buffer is full queue it into the OutputQueue and wait until another buffer gets freed up

AudioPropertyFound ( object sender, PropertyFoundEventArgs args ) : void

When a AudioProperty in the fed packets is found this callback is called

BeginPlayingAsync ( Stream stream, IProgress monitor, CancellationTokenSource cts ) : Task
CheckStatus ( AudioFileStreamStatus status ) : void
EmitFinishedEvent ( AudioQueueProperty property ) : void
EnqueueBuffer ( ) : void

Enqueue the active buffer to the OutputQueue

GetOrCreateAudioBuffer ( ) : AudioBuffer
HandleBufferCompleted ( object sender, BufferCompletedEventArgs e ) : void

Is called when a buffer is completly read and can be queued for re-use

NeedsBuffer ( CancellationToken token ) : Task
ReportProgressAsync ( IProgress monitor, CancellationToken token ) : Task
Reset ( ) : void
TryPause ( ) : void
TryResume ( ) : void
WaitForFinished ( CancellationToken token ) : Task
WaitForOutputReady ( CancellationToken token ) : Task

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Cleaning up all the native Resource
protected Dispose ( bool disposing ) : void
disposing bool
return void

PlayAsync() public method

Begins playing the audio stroed in the supplied stream
public PlayAsync ( Stream stream, IProgress monitor, CancellationToken token ) : Task
stream Stream Stream.
monitor IProgress
token System.Threading.CancellationToken Token.
return Task

StreamingPlayer() public method

public StreamingPlayer ( ) : System
return System

Property Details

outputQueue public_oe property

public OutputAudioQueue outputQueue
return OutputAudioQueue