Exemplo n.º 1
0
 public WmpMonitor()
 {
     state = MonitorState.Starting;
     try {
         try {
             player = new RemotedWindowsMediaPlayer();
             player.CreateControl();
             wmp = player.GetOcx() as WindowsMediaPlayer;
             state = MonitorState.Started;
         }
         catch (Exception e) {
             errorMessage = "Error contacting player: " + e.Message;
             state = MonitorState.Error;
             return;
         }
     }
     catch (Exception e) {
         errorMessage = "Error starting monitor: " + e.Message;
         state = MonitorState.Error;
         //throw e;
     }
 }
Exemplo n.º 2
0
 public override void Start()
 {
     try
     {
         state = MonitorState.Starting;
         try
         {
             player = new RemotedWindowsMediaPlayer();
             player.CreateControl();
             wmp = player.GetOcx() as WindowsMediaPlayer;
         }
         catch (Exception e)
         {
             Log.Write(e);
             errorMessage = "Error contacting player: " + e.Message;
             state = MonitorState.Error;
             return;
         }
         checkPosThread.Start();
     }
     catch (Exception e)
     {
         Log.Write(e);
         errorMessage = "Error starting monitor: " + e.Message;
         state = MonitorState.Error;
         //throw e;
     }
 }