public void ClickOnChromas(int x, int y) { Tonalty tonalty = GetCurrentTonalty(); if (ChromaMode != TimelineChromaMode.None) { int id = GetChromaID(y); if (ChromaMode != TimelineChromaMode.FrameScale || tonalty.IsOnNaturalScale(id)) { Program.MidiManager.PlaySingleNote(id); } } }
public void DrawTonaltyAt(Tonalty tonalty, int graphicPosition, int restrictedLength) { TL.G.DrawString(tonalty.ToString(), tonaltyFont, tonaltyBrush, new Rectangle(graphicPosition, 0, restrictedLength, ChromaTextHeight)); if (tonalty == null) { return; } for (int j = 0; j < 12; ++j) { if (ChromaMode != TimelineChromaMode.FrameScale || tonalty.IsOnNaturalScale(j)) { TL.G.DrawString(tonalty.NoteNameUnderTonalty(j), noteFont, noteBackBrush, new Rectangle(graphicPosition + fontShadowDX, chromaTextStart + (11 - j) * ChromaHeight + fontShadowDY, restrictedLength, ChromaTextHeight)); TL.G.DrawString(tonalty.NoteNameUnderTonalty(j), noteFont, noteFrontBrush, new Rectangle(graphicPosition, chromaTextStart + (11 - j) * ChromaHeight, restrictedLength, ChromaTextHeight)); } } }
public void DrawChroma() { if (Info.chroma == null) { return; } int lpos = TL.Time2Pos(0); if (lpos < 0) { lpos = 0; } Tonalty tonalty = GetCurrentTonalty(); if (ChromaMode != TimelineChromaMode.None) { if (Prepared) { int pos1 = TL.Time2Pos(0); int pos2 = TL.Time2Pos(Info.MP3Length); for (int j = 0; j < 12; ++j) { if (ChromaMode != TimelineChromaMode.FrameScale || tonalty.IsOnNaturalScale(j)) { if (ChromaMode == TimelineChromaMode.Global) { int percent = (int)((Info.GlobalChroma[j] / Info.MaxGlobalChroma) * 255); TL.G.FillRectangle(new SolidBrush(Color.FromArgb(percent, percent, percent)), new Rectangle(0, ChromaStart + (11 - j) * ChromaHeight, TL.TargetRightPos, ChromaHeight)); } else { TL.G.DrawImage(chromaBitmaps[j], new Rectangle(pos1, ChromaStart + (11 - j) * ChromaHeight, pos2 - pos1, ChromaHeight)); } } } } /*foreach (Chroma.ChromaFrame frame in Info.chroma.Frames) * { * double time = frame.Time; * int pos = TL.Time2Pos(time); * int len = (int)(Info.chroma.FrameLength * TL.TimeScale + 1); * if (pos + len >= 0 && pos <= TL.TargetRightPos) * { * for (int j = 0; j < 12; ++j) * { * int percent = (int)((frame.D[j] / Info.chroma.GlobalMax) * 255); * TL.G.FillRectangle(new SolidBrush(Color.FromArgb(percent, percent, percent)), new Rectangle(pos, ChromaStart + (11 - j) * ChromaHeight, len, ChromaHeight)); * } * } * }*/ } if (TL.IsMouseInControl && TL.CurrentMouseMode == Timeline.MouseMode.Chroma && ChromaMode != TimelineChromaMode.None) { int id = GetChromaID(TL.MousePosY); if (ChromaMode != TimelineChromaMode.FrameScale || tonalty.IsOnNaturalScale(id)) { int pos1 = Math.Max(0, TL.Time2Pos(0)); int pos2 = Math.Max(TL.TargetRightPos - 1, TL.Time2Pos(Info.MP3Length)); TL.G.DrawRectangle(chromaSelectPen, new Rectangle(pos1, ChromaStart + (11 - id) * ChromaHeight, pos2 - pos1, ChromaHeight)); } } }