コード例 #1
0
ファイル: WmpMonitor.cs プロジェクト: zzattack/g19applets
 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;
     }
 }
コード例 #2
0
ファイル: MonitorThread.cs プロジェクト: e-Deniska/iPlaylist
 public override void Stop()
 {
     try
     {
         lock (lckThread)
         {
             quit = true;
         }
         checkPosThread.Join();
         wmp = null;
         player = null;
         state = MonitorState.NotStarted;
     }
     catch (COMException)
     {
         // application is busy... nothing we can do... just wait, when it will become available again
     }
     catch (Exception e)
     {
         Log.Write(e);
         errorMessage = "Error stopping monitor: " + e.Message;
         state = MonitorState.Error;
     }
 }
コード例 #3
0
ファイル: WmpMonitor.cs プロジェクト: zzattack/g19applets
 public void Stop()
 {
     try {
         quit = true;
         wmp = null;
         player = null;
         state = MonitorState.NotStarted;
     }
     catch (COMException) {
         // application is busy... nothing we can do... just wait, when it will become available again
     }
     catch (Exception e) {
         errorMessage = "Error stopping monitor: " + e.Message;
         state = MonitorState.Error;
     }
 }
コード例 #4
0
ファイル: MonitorThread.cs プロジェクト: e-Deniska/iPlaylist
 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;
     }
 }