示例#1
0
        public override void Render(float timePassed)
        {
            base.Render(timePassed);
            //RenderDlg(timePassed);

            if (null == coverArtTexture)
            {
                return;
            }

            if (null != imgCoverArt)
            {
                float x = (float)imgCoverArt.XPosition;
                float y = (float)imgCoverArt.YPosition;
                int   width;
                int   height;
                GUIGraphicsContext.Correct(ref x, ref y);

                int maxWidth  = imgCoverArt.Width;
                int maxHeight = imgCoverArt.Height;
                GUIGraphicsContext.GetOutputRect(coverArtTextureWidth, coverArtTextureHeight, maxWidth, maxHeight, out width,
                                                 out height);

                GUIFontManager.Present();
                Util.Picture.RenderImage(coverArtTexture, (int)x, (int)y, width, height, coverArtTextureWidth,
                                         coverArtTextureHeight, 0, 0, true);
            }
        }
示例#2
0
        private void SetVisualizationWindow()
        {
            if (!ControlsInitialized || !_showVisualization || !_usingBassEngine)
            {
                return;
            }

            VisualizationWindow vizWindow = BassMusicPlayer.Player.VisualizationWindow;

            if (vizWindow != null)
            {
                vizWindow.Visible = false;

                int width  = ImgCoverArt.RenderWidth;
                int height = ImgCoverArt.RenderHeight;

                Size  vizSize = new Size(width, height);
                float vizX    = (float)ImgCoverArt.Location.X;
                float vizY    = (float)ImgCoverArt.Location.Y;
                GUIGraphicsContext.Correct(ref vizX, ref vizY);
                Point vizLoc = new Point((int)vizX, (int)vizY);
                vizWindow.Size     = vizSize;
                vizWindow.Location = vizLoc;
                vizWindow.Visible  = true;

                GUIGraphicsContext.VideoWindow = new Rectangle(vizLoc, vizSize);
            }
        }
示例#3
0
        // savevmr9bitmap

        public void GetVideoWindows(out Rectangle rSource, out Rectangle rDest)
        {
            Geometry m_geometry = new Geometry();
            // get the window where the video/tv should be shown
            float x  = GUIGraphicsContext.VideoWindow.X;
            float y  = GUIGraphicsContext.VideoWindow.Y;
            float nw = GUIGraphicsContext.VideoWindow.Width;
            float nh = GUIGraphicsContext.VideoWindow.Height;

            GUIGraphicsContext.Correct(ref x, ref y);

            //sanity checks
            if (nw > GUIGraphicsContext.OverScanWidth)
            {
                nw = GUIGraphicsContext.OverScanWidth;
            }
            if (nh > GUIGraphicsContext.OverScanHeight)
            {
                nh = GUIGraphicsContext.OverScanHeight;
            }

            //are we supposed to show video in fullscreen or in a preview window?
            if (GUIGraphicsContext.IsFullScreenVideo || !GUIGraphicsContext.ShowBackground)
            {
                //yes fullscreen, then use the entire screen
                x  = GUIGraphicsContext.OverScanLeft;
                y  = GUIGraphicsContext.OverScanTop;
                nw = GUIGraphicsContext.OverScanWidth;
                nh = GUIGraphicsContext.OverScanHeight;
            }

            //calculate the video window according to the current aspect ratio settings
            float fVideoWidth  = (float)VideoWidth;
            float fVideoHeight = (float)VideoHeight;

            m_geometry.ImageWidth   = (int)fVideoWidth;
            m_geometry.ImageHeight  = (int)fVideoHeight;
            m_geometry.ScreenWidth  = (int)nw;
            m_geometry.ScreenHeight = (int)nh;
            m_geometry.ARType       = GUIGraphicsContext.ARType;
            m_geometry.PixelRatio   = GUIGraphicsContext.PixelRatio;
            m_geometry.GetWindow(VideoAspectRatioX, VideoAspectRatioY, out rSource, out rDest);
            rDest.X   += (int)x;
            rDest.Y   += (int)y;
            m_geometry = null;
        }
示例#4
0
        public override void OnInit()
        {
            base.OnInit();

            float x = base.XPosition;
            float y = base.YPosition;

            GUIGraphicsContext.Correct(ref x, ref y);

            _videoWindows[0].X      = (int)x;
            _videoWindows[0].Y      = (int)y;
            _videoWindows[0].Width  = base.Width;
            _videoWindows[0].Height = base.Height;

            if (_setVideoWindow)
            {
                GUIGraphicsContext.VideoWindow = _videoWindows[0];
            }
        }
示例#5
0
        public override void Render(float timePassed)
        {
            base.Render(timePassed);
            if (null == m_pTexture)
            {
                return;
            }
            float x = imgPicture.XPosition;
            float y = imgPicture.YPosition;
            int   width;
            int   height;

            GUIGraphicsContext.Correct(ref x, ref y);

            GUIFontManager.Present();
            GUIGraphicsContext.GetOutputRect(m_iTextureWidth, m_iTextureHeight, imgPicture.Width, imgPicture.Height, out width,
                                             out height);
            Util.Picture.RenderImage(m_pTexture, (int)x, (int)y, width, height, m_iTextureWidth, m_iTextureHeight, 0, 0,
                                     true);
        }
        public override void OnInit()
        {
            base.OnInit();

            float x = base.XPosition;
            float y = base.YPosition;

            GUIGraphicsContext.Correct(ref x, ref y);

            _videoWindows[0].X      = (int)x;
            _videoWindows[0].Y      = (int)y;
            _videoWindows[0].Width  = base.Width;
            _videoWindows[0].Height = base.Height;

            if (_setVideoWindow)
            {
                //Log.Error("GUIVideoControl OnInit() {0}", _videoWindows[0]);
                GUIGraphicsContext.VideoWindow  = _videoWindows[0];
                GUIGraphicsContext.VideoControl = true;
            }
        }
示例#7
0
        public override void Render(float timePassed)
        {
            if (GUIGraphicsContext.EditMode == false)
            {
                if (!IsVisible)
                {
                    if (_setVideoWindow)
                    {
                        // Here is to hide video window madVR when skin didn't handle video overlay (the value need to be different from Process() player like VMR7)
                        GUIGraphicsContext.VideoWindow = new Rectangle(0, 0, 0, 0);
                    }
                    base.Render(timePassed);
                    return;
                }
            }

            if (!GUIGraphicsContext.Calibrating)
            {
                float x = base.XPosition;
                float y = base.YPosition;
                GUIGraphicsContext.Correct(ref x, ref y);

                _videoWindows[0].X      = (int)x;
                _videoWindows[0].Y      = (int)y;
                _videoWindows[0].Width  = base.Width;
                _videoWindows[0].Height = base.Height;

                if (_setVideoWindow)
                {
                    GUIGraphicsContext.VideoWindow = _videoWindows[0];
                }

                if (GUIGraphicsContext.ShowBackground)
                {
                    if (Focus)
                    {
                        x = base.XPosition;
                        y = base.YPosition;
                        int xoff = 5;
                        int yoff = 5;
                        int w    = 10;
                        int h    = 10;
                        GUIGraphicsContext.ScalePosToScreenResolution(ref xoff, ref yoff);
                        GUIGraphicsContext.ScalePosToScreenResolution(ref w, ref h);
                        _imageFocusRectangle.SetPosition((int)x - xoff, (int)y - yoff);
                        _imageFocusRectangle.Width  = base.Width + w;
                        _imageFocusRectangle.Height = base.Height + h;
                        _imageFocusRectangle.Render(timePassed);
                    }

                    if (GUIGraphicsContext.graphics != null)
                    {
                        GUIGraphicsContext.graphics.FillRectangle(Brushes.Black, _videoWindows[0].X, _videoWindows[0].Y, base.Width,
                                                                  base.Height);
                    }
                    else
                    {
                        //image.SetPosition(_videoWindows[0].X,_videoWindows[0].Y);
                        //image.Width=_videoWindows[0].Width;
                        //image.Height=_videoWindows[0].Height;
                        if (GUIGraphicsContext.VideoWindow.Width < 1)
                        {
                            thumbImage.Render(timePassed);
                        }
                        else
                        {
                            blackImage.Render(timePassed); // causes flickering in fullscreen
                        }
                    }
                }
                else
                {
                    if (GUIGraphicsContext.graphics != null)
                    {
                        GUIGraphicsContext.graphics.FillRectangle(Brushes.Black, _videoWindows[0].X, _videoWindows[0].Y, base.Width,
                                                                  base.Height);
                    }
                }
            }
            base.Render(timePassed);
        }