Ejemplo n.º 1
0
        private void RenderOscilloscope(RenderGraphics g)
        {
            if (!oscilloscopeVisible)
            {
                return;
            }

            var oscilloscopeSizeX = timecodeSizeX;
            var oscilloscopeSizeY = Height - timecodePosY * 2;

            g.FillRectangle(oscilloscopePosX, timecodePosY, oscilloscopePosX + oscilloscopeSizeX, Height - timecodePosY, theme.BlackBrush);

            var oscilloscopeGeometry = App.GetOscilloscopeGeometry(out lastOscilloscopeHadNonZeroSample);

            if (oscilloscopeGeometry != null && lastOscilloscopeHadNonZeroSample)
            {
                float scaleX = oscilloscopeSizeX;
                float scaleY = oscilloscopeSizeY / 2;

                RenderGeometry geo = g.CreateGeometry(oscilloscopeGeometry, false);
                g.PushTransform(oscilloscopePosX, timecodePosY + oscilloscopeSizeY / 2, scaleX, scaleY);
                g.AntiAliasing = true;
                g.DrawGeometry(geo, theme.LightGreyFillBrush2);
                g.AntiAliasing = false;
                g.PopTransform();
                geo.Dispose();
            }
            else
            {
                g.PushTranslation(oscilloscopePosX, timecodePosY + oscilloscopeSizeY / 2);
                g.AntiAliasing = true;
                g.DrawLine(0, 0, oscilloscopeSizeX, 0, theme.LightGreyFillBrush2);
                g.AntiAliasing = false;
                g.PopTransform();
            }

            g.DrawRectangle(oscilloscopePosX, timecodePosY, oscilloscopePosX + oscilloscopeSizeX, Height - timecodePosY, theme.LightGreyFillBrush2);
        }