public Tuple<Point, Point, Point>[] DrawInterval(Interval interval, int notePositionX) { int upperNotePositionX = this.GetUpperNotePositionX(interval, notePositionX); Tuple<Point, Point, Point> note2 = DrawNote(interval.Tone2, upperNotePositionX); if (interval.GeneralInterval.numeral > 2 && SharpFlatSymbolOverlapping(interval)) { this.distanceOfFlatSharpSymbol = this.GetNoteFlatSharpSymbolWidth(interval.Tone2) + 5; } Tuple<Point, Point, Point> note1 = DrawNote(interval.Tone1, notePositionX); this.distanceOfFlatSharpSymbol = 0; return new Tuple<Point, Point, Point>[] { note1, note2 }; }
public Bitmap DrawInterval(Bitmap stave, Interval interval, int notePositionX) { int upperNotePositionX = this.GetUpperNotePositionX(interval, notePositionX); stave = DrawNote(stave, VyukaHN.Properties.Resources.nota, interval.Tone2, upperNotePositionX); if (interval.GeneralInterval.numeral > 2 && SharpFlatSymbolOverlapping(interval)) { this.distanceOfFlatSharpSymbol = this.GetNoteFlatSharpSymbolWidth(interval.Tone2) + 5; } stave = DrawNote(stave, VyukaHN.Properties.Resources.nota, interval.Tone1, notePositionX); this.distanceOfFlatSharpSymbol = 0; return stave; }
private void NextExercise() { this.HideSecondNote(); this.AddPointerToFirstNote(); IntervalGenerator intervalGenerator = new IntervalGenerator(); this.ActualInterval = intervalGenerator.GenerateIntervalWithTones(); this.QuestionInterval.InnerText = this.ActualInterval.GeneralInterval.ToString(); this.QuestionInterval.Attributes.Add("title", this.WholeIntervalAdjective(this.ActualInterval.GeneralInterval.adjective) + " " + this.WholeIntervalNumeral(this.ActualInterval.GeneralInterval.numeral)); this.Tone1Index.Value = ToneGraph.GetReferenceToneIndex(this.ActualInterval.Tone1).ToString(); StaveObjectsPosition sop = new StaveObjectsPosition(226, 30); Tuple<Point, Point, Point> notePosition = sop.DrawNote(this.ActualInterval.Tone1, 240); this.ChangePositionOfNote(notePosition, this.Note1, this.LedgerLine1, this.SharpFlatSymbol1, this.ActualInterval.Tone1); }
private bool SharpFlatSymbolOverlapping(Interval interval) { int lowerNoteSymbolLowestPositionY = this.GetLowestFlatSharpSymbolPositionY(this.GetNoteFlatSharpSymbolHeight(interval.Tone1), interval.Tone1.ChromaticChange); int higerNoteSymbolLowestPositionY = this.GetLowestFlatSharpSymbolPositionY(this.GetNoteFlatSharpSymbolHeight(interval.Tone2), interval.Tone2.ChromaticChange); int lowerNoteSymbolPositionY = lowerNoteSymbolLowestPositionY - ToneGraph.GetReferenceToneIndex(interval.Tone1) * (this.DistanceBetweenLines / 2); int higherNoteSymbolPositionY = higerNoteSymbolLowestPositionY - ToneGraph.GetReferenceToneIndex(interval.Tone2) * (this.DistanceBetweenLines / 2); int distanceBetweenSymbols = lowerNoteSymbolPositionY - higherNoteSymbolPositionY - this.GetNoteFlatSharpSymbolHeight(interval.Tone2); return distanceBetweenSymbols <= 0 ? true : false; }
private int GetUpperNotePositionX(Interval interval, int notePositionX) { int flatSharpSymbolWidth = GetNoteFlatSharpSymbolWidth(interval.Tone2); if (interval.GeneralInterval.numeral == 1 || interval.GeneralInterval.numeral == 2) { return notePositionX + flatSharpSymbolWidth + (int)(1.7 * VyukaHN.Properties.Resources.nota.Width); } else { return notePositionX; } }
private void NextExercise() { this.clearAnswerLabels(); this.ChangeBackgroundOfAnswerButtons("#8C8C8C"); IntervalGenerator intervalGenerator = new IntervalGenerator(); ActualInterval = intervalGenerator.GenerateIntervalWithTones(); StaveObjectsPosition sop = new StaveObjectsPosition(226, 30); Tuple<Point, Point, Point>[] notesPosition = sop.DrawInterval(ActualInterval, 240); this.ChangePositionOfNote(notesPosition[0], this.Note1, this.LedgerLine1, this.SharpFlatSymbol1, this.ActualInterval.Tone1); this.ChangePositionOfNote(notesPosition[1], this.Note2, this.LedgerLine2, this.SharpFlatSymbol2, this.ActualInterval.Tone2); }