예제 #1
0
        public void Render(GraphicsWrapper g)
        {
            if (m_drag.Active && m_selectMode)
            {
                g.FillRectangle(tbrush, m_selectionRectangle);
                g.DrawRectangle(Pens.LightBlue, m_selectionRectangle);
            }

            var eventsRenderer = m_eventsRenderer;

            foreach (EventData o in m_selectedObjects)
            {
                Rectangle rec = eventsRenderer.GetEventRectangle(o, (int)o.TrackId * EventsRenderer.VirtualTrackheight);
                g.FillRectangle(tbrush, rec);
                g.DrawRectangle(selection_border, rec);
            }
        }
예제 #2
0
        public override void RenderNote(GraphicsWrapper g, EventData eventData, Rectangle eventRectangle, int centerX, int centerY)
        {
            int rectangleX      = centerX - (RECTANGLE_WIDTH / 2);
            int rectangleY      = centerY - (RECTANGLE_HEIGHT / 2);
            int rectangleWidth  = RECTANGLE_WIDTH + (eventData.Duration > 6 ? eventData.VirtualDuration : 0);
            int rectangleHeight = RECTANGLE_HEIGHT;

            g.FillRectangle(CustomBrushes.NoteBackground, rectangleX, rectangleY, rectangleWidth, rectangleHeight);
            g.DrawRectangle(Pens.Black, rectangleX, rectangleY, rectangleWidth, rectangleHeight);

            string text = String.Empty;

            switch (EventDisplayMode)
            {
            case EventDisplayMode.Attribute:
                byte attribute = eventData.Attribute;
                text = String.Format("Attr {0,3:000}", attribute);
                break;

            case EventDisplayMode.Instrument:
                var instrument = eventData.Instrument;
                int insNo      = instrument != null ? instrument.InsNum : 0;
                text = String.Format("Ins {0,3:000}", insNo);
                break;

            case EventDisplayMode.Duration:
                ushort duration = eventData.Duration;
                text = String.Format("Dur {0,3:000}", duration);
                break;

            case EventDisplayMode.Pan:
                byte pan = eventData.Pan;
                text = String.Format("Pan {0,3:000}", pan);
                break;

            case EventDisplayMode.Velocity:
                byte vel = eventData.Vel;
                text = String.Format("Vel {0,3:000}", vel);
                break;
            }


            g.DrawString(text, this.m_textFont, Brushes.Black, centerX + SHADOW_DISTANCE, centerY + SHADOW_DISTANCE, _stringFormat);
            g.DrawString(text, this.m_textFont, Brushes.White, centerX, centerY, _stringFormat);
        }
예제 #3
0
 /// <summary>
 /// Render the Progressbar in Graphics/viewablePixels
 /// </summary>
 /// <param name="g"></param>
 /// <param name="viewablePixels"></param>
 public void Render(GraphicsWrapper g, Rectangle viewablePixels)
 {
     g.FillRectangle(m_brush1, Position - (Width / 2), viewablePixels.Y, Width, viewablePixels.Height);
 }
예제 #4
0
 protected void FillRectangle(GraphicsWrapper g, Brush brush, int x, int y, int width, int height)
 {
     g.FillRectangle(brush, x, y, width, height);
 }
예제 #5
0
 protected void FillRectangle(GraphicsWrapper g, Brush brush, Rectangle rect)
 {
     g.FillRectangle(brush, rect);
 }