Class WindowsPlayer
- Namespace
- Alis.Core.Audio.Players
- Assembly
- Alis.dll
The windows player class
internal class WindowsPlayer : IPlayer
Inheritance
Implements
Inherited Members
Fields
_fileName
The file name
private string _fileName
Field Value
_playStopwatch
The play stopwatch
private Stopwatch _playStopwatch
Field Value
_playbackTimer
The playback timer
private Timer _playbackTimer
Field Value
Properties
Paused
Gets or sets the value of the paused
public bool Paused { get; private set; }
Property Value
Playing
Gets or sets the value of the playing
public bool Playing { get; private set; }
Property Value
Methods
ExecuteMsiCommand(string)
Executes the msi command using the specified command string
private Task ExecuteMsiCommand(string commandString)
Parameters
commandString
string-
The command string
Returns
Exceptions
HandlePlaybackFinished(object, ElapsedEventArgs)
Handles the playback finished using the specified sender
private void HandlePlaybackFinished(object sender, ElapsedEventArgs e)
Parameters
sender
object-
The sender
e
ElapsedEventArgs-
The
Pause()
Pauses this instance
public Task Pause()
Returns
Play(string)
Plays the file name
public Task Play(string fileName)
Parameters
fileName
string-
The file name
Returns
Resume()
Resumes this instance
public Task Resume()
Returns
SetVolume(byte)
Sets the volume using the specified percent
public Task SetVolume(byte percent)
Parameters
percent
byte-
The percent
Returns
Stop()
Stops this instance
public Task Stop()
Returns
mciGetErrorString(int, StringBuilder, int)
Mcis the get error string using the specified error code
private static extern int mciGetErrorString(int errorCode, StringBuilder errorText, int errorTextSize)
Parameters
errorCode
int-
The error code
errorText
StringBuilder-
The error text
errorTextSize
int-
The error text size
Returns
- int
-
The int
mciSendString(string, StringBuilder, int, IntPtr)
Mcis the send string using the specified command
private static extern int mciSendString(string command, StringBuilder stringReturn, int returnLength, IntPtr hwndCallback)
Parameters
command
string-
The command
stringReturn
StringBuilder-
The string return
returnLength
int-
The return length
hwndCallback
IntPtr-
The hwnd callback
Returns
- int
-
The int
waveOutSetVolume(IntPtr, uint)
Waves the out set volume using the specified hwo
public static extern int waveOutSetVolume(IntPtr hwo, uint dwVolume)
Parameters
Returns
- int
-
The int
PlaybackFinished
playback
public event EventHandler PlaybackFinished