Method | Description | |
---|---|---|
AudioPlayerModel ( |
Constructor that initializes all commands and the reference to the Peer.
|
|
CheckWaitingBuffering ( long newPosition ) : bool |
This method check if the new position is beyond the limit of buffered data; in this case the playback is paused and the player will wait for missing data.
|
|
Dispose ( ) : void |
Disposes the player calling the close method
|
|
SetResourceHandler ( object sender, |
Callback used when the streaming is requested using the seach list. This method calls the setResource method.
|
|
playback_stopped ( object sender, |
Unused callback
|
Method | Description | |
---|---|---|
NotifyPropertyChanged ( String info ) : void |
Method called when a property has been changed. This method rises the event PropertyChange.
|
|
close ( object args = null ) : void |
This method closes all streams and the disposes the player.
|
|
convertSizeToChunk ( long size ) : int |
Convert a size in byte to a number of chunk.
|
|
pause ( object args = null ) : void |
This method handle the pause operation. If the player is currently playing the methods calls NAudio player
|
|
play ( object args = null ) : void |
Method used to start (or restart) the execution of the track. This resets peer stream and wave stream then initializes the NAudio player and calls its
|
|
resetWaveStream ( ) : void |
Resets playback related streams and channel.
|
|
restartStream ( ) : void |
This method resets all structure of the player related to the playback operation but does not modify the peer state (this way the peer keep downloading the file).
|
|
resumePlay ( object sender, |
This callback handles playback resuming.
|
|
setResource ( |
Sets the current handling resource. If the player is handling the same resource then the methods call restartStream otherwise it calls setupLocalStream
|
|
setupLocalStream ( |
Sets all configuration to enable the playback and the downloading of the track from the network. After setting all configuration, the player will wait for the buffer to be full enough to start playing.
|
|
stop ( object args = null ) : void |
This method handles the stop operation. If the player is not stopped, the NAudio player will be stopped and some structure will be cleaned
|
|
timeFromPosition ( long p ) : double |
Converts a position in the buffer to a time instant withing the range of the song lenght
|
|
wc_Sample ( object sender, NAudio.Wave.SampleEventArgs e ) : void |
This callback is called everytime a sample is player. This method handles current time and current position updates, the stop of the playing at the end of the track and the buffering state.
|
public AudioPlayerModel ( |
||
p | ||
return | System |
public CheckWaitingBuffering ( long newPosition ) : bool | ||
newPosition | long | Position that we want to check |
return | bool |
public SetResourceHandler ( object sender, |
||
sender | object | |
args | ||
return | void |
public playback_stopped ( object sender, |
||
sender | object | |
args | ||
return | void |