C# Class cadencii.media.MediaPlayer

Sound player using mciSendSring command operation
Inheritance: IDisposable
Exibir arquivo Open project: cadencii/cadencii

Public Methods

Method Description
Close ( ) : bool

Closes sound file

Dispose ( ) : void
GetLength ( ) : int

Gets the sound length in millisecond

GetPosition ( ) : int

Gets the current playing position in millisecond

Load ( string filename ) : bool

Opens sound file

Pause ( ) : bool

Pauses sound

Play ( ) : bool

Plays sound from time 0 second

PlayFrom ( double time ) : bool

Plays sound from specified second

ReLoad ( ) : void

Opens sound file which was closed with "UnLoad" method

Seek ( double pos_second ) : bool

Seeks to specified position

Stop ( ) : bool

Stops sound

UnLoad ( ) : void

Closes sound file temporary

Private Methods

Method Description
GetVolume ( ) : int

Gets the volume (0 <= volume <= 1000)

SetSpeed ( float speed ) : void

Sets the speed

SetVolume ( int value ) : void

Sets the volume (0 >= volume >= 1000)

mciSendString ( string s1, StringBuilder s2, int i1, int i2 ) : int
w_mciSendString ( string command ) : bool
w_mciSendString ( string command, string &result ) : bool

mciSendString wrapper with exception handling

Method Details

Close() public method

Closes sound file
public Close ( ) : bool
return bool

Dispose() public method

public Dispose ( ) : void
return void

GetLength() public method

Gets the sound length in millisecond
public GetLength ( ) : int
return int

GetPosition() public method

Gets the current playing position in millisecond
public GetPosition ( ) : int
return int

Load() public method

Opens sound file
public Load ( string filename ) : bool
filename string Path of sound file to open
return bool

Pause() public method

Pauses sound
public Pause ( ) : bool
return bool

Play() public method

Plays sound from time 0 second
public Play ( ) : bool
return bool

PlayFrom() public method

Plays sound from specified second
public PlayFrom ( double time ) : bool
time double Sound position start to play
return bool

ReLoad() public method

Opens sound file which was closed with "UnLoad" method
public ReLoad ( ) : void
return void

Seek() public method

Seeks to specified position
public Seek ( double pos_second ) : bool
pos_second double position to seek in second
return bool

Stop() public method

Stops sound
public Stop ( ) : bool
return bool

UnLoad() public method

Closes sound file temporary
public UnLoad ( ) : void
return void