C# Class LibMPlayerCommon.MPlayer

Mostra file Open project: majorsilence/MPlayerControl Class Usage Examples

Private Properties

Property Type Description
HandleMediaPlayerErrorDataReceived void
HandleMediaPlayerOutputDataReceived void
InitializeMplayer void
LoadCurrentPlayingFileLength void
MPlayer System
MplayerBackend string
PrepareFilePath string
_currentPostionTimer_Elapsed void

Public Methods

Method Description
CurrentPlayingFileLength ( ) : int

Retrieves the number of seconds of the current playing video.

GetArtist ( ) : string
GetAudioBitrate ( ) : string
GetAudioCodec ( ) : string
GetAudioSamples ( ) : string
GetComment ( ) : string
GetCurrentPosition ( ) : int

Get the current postion in the file being played.

It is highly recommended to use the CurrentPostion event instead.

GetGenre ( ) : string
GetPercentPos ( ) : string

get percent positiob

GetTitle ( ) : string
GetTrack ( ) : string
GetVideoBitrate ( ) : string
GetVideoResolution ( ) : string
GetYear ( ) : string
GetfileName ( ) : string
InsertSubtitles ( string filepath ) : void
LoadFile ( string filePath ) : void

Starts a new video/audio file immediatly. Requires that Play has been called.

MPlayer ( int wid, MplayerBackends backend ) : System
MPlayer ( int wid, MplayerBackends backend, string mplayerPath ) : System
MPlayer ( int wid, MplayerBackends backend, string mplayerPath, bool loadMplayer ) : System

Create a new instance of mplayer class.

MovePosition ( int timePosition ) : void

Move to a new position in the video.

Mute ( ) : void

Toggle Mute.

Pause ( ) : void

Pause the current video. If paused it will unpause.

Play ( string filePath ) : void

Load and start playing a video.

Quit ( ) : void

Close MPlayer instance.

RemoveSubtitle ( ) : void
Seek ( int value, Seek type ) : void

Seek a new postion. Seek to some place in the movie. Seek.Relative is a relative seek of +/- value seconds (default). Seek.Percentage is a seek to value % in the movie. Seek.Absolute is a seek to an absolute position of value seconds.

SetPercent ( int v ) : void

set percent position of mplayer

SetSize ( int width, int height ) : void
Stop ( ) : void

Stop the current video.

SubDelay ( int v ) : void
SubPos ( int v ) : void
SubScale ( int v ) : void
SwitchAudioTrack ( int track ) : void
SwitchRatio ( string ratio ) : void

Change aspect ratio at runtime. [value] is the new aspect ratio expressed as a float (e.g. 1.77778 for 16/9), or special value -1 to reset to original aspect ratio (ditto if [value] is missing), or special value 0 to disable automatic movie aspect ratio compensation. There might be problems with some video filters.

SwitchSubtitle ( int sub ) : void
ToggleFullScreen ( ) : void

Toggle Fullscreen.

VisibilitySubtitle ( int v ) : void
Volume ( int volume ) : void

Accepts a volume value of 0 - 100.

getalbum ( ) : string

Private Methods

Method Description
HandleMediaPlayerErrorDataReceived ( object sender, System e ) : void

All mplayer error output is read through this function.

HandleMediaPlayerOutputDataReceived ( object sender, System e ) : void

All mplayer standard output is read through this function.

InitializeMplayer ( ) : void
LoadCurrentPlayingFileLength ( ) : void
MPlayer ( ) : System
MplayerBackend ( ) : string
PrepareFilePath ( string filePath ) : string

Prepare filepaths to be used witht the loadfile command.

For some reason it strips the DirectorySeperatorChar so we double it up here.

_currentPostionTimer_Elapsed ( object sender, ElapsedEventArgs e ) : void

Method Details

CurrentPlayingFileLength() public method

Retrieves the number of seconds of the current playing video.
public CurrentPlayingFileLength ( ) : int
return int

GetArtist() public method

public GetArtist ( ) : string
return string

GetAudioBitrate() public method

public GetAudioBitrate ( ) : string
return string

GetAudioCodec() public method

public GetAudioCodec ( ) : string
return string

GetAudioSamples() public method

public GetAudioSamples ( ) : string
return string

GetComment() public method

public GetComment ( ) : string
return string

GetCurrentPosition() public method

Get the current postion in the file being played.
It is highly recommended to use the CurrentPostion event instead.
public GetCurrentPosition ( ) : int
return int

GetGenre() public method

public GetGenre ( ) : string
return string

GetPercentPos() public method

get percent positiob
public GetPercentPos ( ) : string
return string

GetTitle() public method

public GetTitle ( ) : string
return string

GetTrack() public method

public GetTrack ( ) : string
return string

GetVideoBitrate() public method

public GetVideoBitrate ( ) : string
return string

GetVideoResolution() public method

public GetVideoResolution ( ) : string
return string

GetYear() public method

public GetYear ( ) : string
return string

GetfileName() public method

public GetfileName ( ) : string
return string

InsertSubtitles() public method

public InsertSubtitles ( string filepath ) : void
filepath string
return void

LoadFile() public method

Starts a new video/audio file immediatly. Requires that Play has been called.
public LoadFile ( string filePath ) : void
filePath string string
return void

MPlayer() public method

public MPlayer ( int wid, MplayerBackends backend ) : System
wid int
backend MplayerBackends
return System

MPlayer() public method

public MPlayer ( int wid, MplayerBackends backend, string mplayerPath ) : System
wid int
backend MplayerBackends
mplayerPath string
return System

MPlayer() public method

Create a new instance of mplayer class.
public MPlayer ( int wid, MplayerBackends backend, string mplayerPath, bool loadMplayer ) : System
wid int Window ID that mplayer should attach itself
backend MplayerBackends The video output backend that mplayer will use.
mplayerPath string The full filepath to mplayer.exe. If mplayerPath is left empty it will search for mplayer.exe in /// "current directory\backend\mplayer.exe" on windows and mplayer in the path on linux.
loadMplayer bool If true mplayer will immediately be loaded and you should not attempt to /// play any files until MplayerRunning is true.
return System

MovePosition() public method

Move to a new position in the video.
public MovePosition ( int timePosition ) : void
timePosition int Seconds. The position to seek move to.
return void

Mute() public method

Toggle Mute.
public Mute ( ) : void
return void

Pause() public method

Pause the current video. If paused it will unpause.
public Pause ( ) : void
return void

Play() public method

Load and start playing a video.
public Play ( string filePath ) : void
filePath string
return void

Quit() public method

Close MPlayer instance.
public Quit ( ) : void
return void

RemoveSubtitle() public method

public RemoveSubtitle ( ) : void
return void

Seek() public method

Seek a new postion. Seek to some place in the movie. Seek.Relative is a relative seek of +/- value seconds (default). Seek.Percentage is a seek to value % in the movie. Seek.Absolute is a seek to an absolute position of value seconds.
public Seek ( int value, Seek type ) : void
value int
type Seek
return void

SetPercent() public method

set percent position of mplayer
public SetPercent ( int v ) : void
v int
return void

SetSize() public method

public SetSize ( int width, int height ) : void
width int
height int
return void

Stop() public method

Stop the current video.
public Stop ( ) : void
return void

SubDelay() public method

public SubDelay ( int v ) : void
v int
return void

SubPos() public method

public SubPos ( int v ) : void
v int
return void

SubScale() public method

public SubScale ( int v ) : void
v int
return void

SwitchAudioTrack() public method

public SwitchAudioTrack ( int track ) : void
track int
return void

SwitchRatio() public method

Change aspect ratio at runtime. [value] is the new aspect ratio expressed as a float (e.g. 1.77778 for 16/9), or special value -1 to reset to original aspect ratio (ditto if [value] is missing), or special value 0 to disable automatic movie aspect ratio compensation. There might be problems with some video filters.
public SwitchRatio ( string ratio ) : void
ratio string
return void

SwitchSubtitle() public method

public SwitchSubtitle ( int sub ) : void
sub int
return void

ToggleFullScreen() public method

Toggle Fullscreen.
public ToggleFullScreen ( ) : void
return void

VisibilitySubtitle() public method

public VisibilitySubtitle ( int v ) : void
v int
return void

Volume() public method

Accepts a volume value of 0 - 100.
public Volume ( int volume ) : void
volume int
return void

getalbum() public method

public getalbum ( ) : string
return string