/// <summary>
 /// Upades/draws beams between notes if any.
 /// </summary>
 /// <param name="measureSegment">Selected measureSegment</param>
 /// <param name="durationTable">Reference durationTable</param>
 private void RedrawBeams(MeasureSegmentController measureSegment, Dictionary <int, double> durationTable)
 {
     if (measureSegment.BeamsController != null)
     {
         measureSegment.BeamsController.Draw(durationTable);
         if (measureSegment.BeamsController.BeamsVisuals != null)
         {
             measureSegment.AddBeams(measureSegment.BeamsController.BeamsVisuals);
         }
     }
 }
        public void GenerateContent()
        {
            foreach (var measureId in _measuresList)
            {
                MeasureDrawing measureCanvas = new MeasureDrawing(measureId, _partId, _staffDistance, _stavesCount);
                ScorePartwisePartMeasureMusicXML measureSerializable = ViewModel.ViewModelLocator.Instance.Main.CurrentSelectedScore.Part[_partId.GetPartIdIndex()].MeasuresByNumber[measureId];

                Canvas.SetTop(measureCanvas.BaseObjectVisual, 0);
                Canvas.SetLeft(measureCanvas.BaseObjectVisual, _partProperties.Coords[measureId].X);
                PartSegmentCanvas.Children.Add(measureCanvas.BaseObjectVisual);

                MeasureSegmentController measureSegment = new MeasureSegmentController(measureSerializable, _partId, _stavesCount);
                _partMeasures.Add(measureSegment);

                Canvas.SetTop(measureSegment.GetMeasureCanvas(), 0);
                Canvas.SetLeft(measureSegment.GetMeasureCanvas(), _partProperties.Coords[measureId].X);
                PartSegmentCanvas.Children.Add(measureSegment.GetMeasureCanvas());
            }
        }
예제 #3
0
 internal void AddNextMeasure(MeasureSegmentController measureSegmentController)
 {
     CurrentPanel.Children.Add(new MeasureVisualTest(measureSegmentController));
     Console.WriteLine("added measure: " + measureSegmentController.MeasureId);
 }
 public MeasureVisualTest(MeasureSegmentController measureSegment)
 {
     this.measureSegment = measureSegment;
     SetProperties();
 }