示例#1
0
        internal void GenerateMeasureSegments(ScorePartwiseMusicXML scoreFile, bool allParts = true, List <string> partIDs = null)
        {
            if (!allParts)
            {
                if (partIDs != null)
                {
                    InitPartIDs(partIDs);
                }
                else
                {
                    Log.LoggIt.Log("List of part ID's was empty. Generated Measure Segments for all parts instead");
                    InitPartIDs(scoreFile.Part.Select(x => x.Id).ToList());
                }
            }
            else
            {
                InitPartIDs(scoreFile.Part.Select(x => x.Id).ToList());
            }

            foreach (var part in scoreFile.Part)
            {
                int stavesCount = part.GetStavesCount();
                foreach (var measure in part.Measure)
                {
                    MeasureSegmentController measureSegmentController = new MeasureSegmentController(measure, part.Id, stavesCount);
                    AddMeasureSegmentController(measureSegmentController, part.Id);
                }
            }
        }
示例#2
0
 public void AddMeasureSegmentController(MeasureSegmentController measureSegment, string partId)
 {
     if (_measureSegments.ContainsKey(partId))
     {
         _measureSegments[partId].Add(measureSegment);
     }
     else
     {
         Log.LoggIt.Log($"Wrong partID while trying to add measureSegmentController to measureSegments Dictionary {partId}",
                        Log.LogType.Warning);
     }
 }