Esempio n. 1
0
 /// <summary>
 /// Disposes the osd controller
 /// </summary>
 public void Dispose()
 {
     _fullscreenWindow.CompleteDispose();
     _dialogWindow.Dispose();
     _videoOSDWindow.Dispose();
     _osdForm.Dispose();
     GUIGraphicsContext.form.SizeChanged -= parent_SizeChanged;
     ImageCache.Dispose();
     singleton = null;
 }
Esempio n. 2
0
        public override void Process()
        {
            if (media == null) return;

            if (media.State == States.Ended || media.State == States.Stopped) 
                playState = PlayState.Ended;
            if (Initializing && media.State == States.Playing) playState = PlayState.Playing;

            if (!bufferingDone && !Initializing)
            {
                GUIWaitCursor.Hide(); // hide the wait cursor
                bufferingDone = true;

                if (Ended)
                {
                    PlaybackEnded();
                }
                else
                {
                    if (GoFullscreen) GUIWindowManager.ActivateWindow(GUIOnlineVideoFullscreen.WINDOW_FULLSCREEN_ONLINEVIDEO);
                    GUIMessage msgPb = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null);
                    msgPb.Label = CurrentFile;
                    GUIWindowManager.SendThreadMessage(msgPb);
                    SetVideoWindow();
                    osd = OSDController.Instance;
                }
            }

            if (osd != null) osd.UpdateGUI();
        }
Esempio n. 3
0
 /// <summary>
 /// Creates the instance of the external OSD controller. Seperated for creation in a different thread.
 /// </summary>
 private void OsdGetInstance()
 {
     _osd = OSDController.Instance;
 }
Esempio n. 4
0
 /// <summary>
 /// Disposes the osd controller
 /// </summary>
 public void Dispose()
 {
     _fullscreenWindow.CompleteDispose();
       _dialogWindow.Dispose();
       _videoOSDWindow.Dispose();
       _osdForm.Dispose();
       GUIGraphicsContext.form.SizeChanged -= parent_SizeChanged;
       ImageCache.Dispose();
       singleton = null;
 }
        public override void Process()
        {
            if (wmpCtrl != null)
            {
                if (Initializing)
                {
                    if (!bufferCompleted && wmpCtrl.playState.Equals(WMPPlayState.wmppsPlaying)) bufferCompleted = true;

                    if (wmpCtrl.playState.Equals(WMPPlayState.wmppsReady))
                    {
                        GUIWaitCursor.Hide(); // hide the wait cursor
                        Log.Instance.Info("WMPVideoPlayer: error encountered while trying to play {0}", currentFile);
                        bufferCompleted = true;
                        PlaybackEnded();
                    }
                    else if (bufferCompleted)
                    {
                        AdaptRefreshRate();
                        GUIWaitCursor.Hide(); // hide the wait cursor
                        wmpCtrl.Visible = true;
                        playState = PlayState.Playing;
                        if (GoFullscreen) GUIWindowManager.ActivateWindow(GUIOnlineVideoFullscreen.WINDOW_FULLSCREEN_ONLINEVIDEO);
                        GUIMessage msgPb = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null);
                        msgPb.Label = CurrentFile;
                        GUIWindowManager.SendThreadMessage(msgPb);
                        SetVideoWindow();
                        osd = OSDController.Instance;
                    }
                }
                else if (Playing && osd != null) osd.UpdateGUI();
            }
        }
        public override void Dispose()
        {
            GUIWindowManager.OnNewAction -= GUIWindowManager_OnNewAction;

            if (!bufferCompleted) GUIWaitCursor.Hide();

            try { if (osd != null) { osd.Dispose(); osd = null; } }
            catch (Exception ex) { Log.Instance.Warn(ex.ToString()); }

            try { if (wmpCtrl != null) { wmpCtrl.Dispose(); wmpCtrl = null; } }
            catch (Exception ex) { Log.Instance.Warn(ex.ToString()); }

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }