/// <summary> /// Open a WMP Resource /// </summary> /// <param name="filename"></param> /// <returns></returns> public WindowsMediaPlayerResource Open(string filename) { WindowsMediaPlayerResource res = new WindowsMediaPlayerResource(); res.fileName = filename; return res; }
/// <summary> /// Play a media file /// </summary> /// <param name="res">WMP resource</param> public void Play(WindowsMediaPlayerResource res) { current = res; return; }
/// <summary> /// Capture player state changes /// </summary> void player_PlayStateChange(int newState) { if (prevState == 8 && newState == 9 && current != null) { // Tell the resource current.FireComplete(); // Tell the player wrapper if (OnComplete != null) { OnComplete(this, new EventArgs()); } current = null; } prevState = newState; }
public SoundMusic(WindowsMediaPlayerResource res) { this.res = res; }