//public TimeSignatureContainerItem(string staff, int fractionPosition, TimeMusicXML timeSignature)

        //{
        //}

        //public TimeSignatureContainerItem(double width)
        //{
        //    ItemCanvas.Width = width;
        //    itemWidth = width;
        //}

        public TimeSignatureContainerItem(TimeMusicXML timeSignature)
            : base(AttributeType.time, 1, 0)
        {
            isSymbol = timeSignature.TimeSymbolSpecified;
            GetTime(timeSignature);
            GetStaffLineCoords();
            GetSymbol();
            Update();
        }
 private void GetTime(TimeMusicXML timeSignature)
 {
     if (isSymbol)
     {
         symbolValue = timeSignature.TimeSymbol;
     }
     if (!isSymbol || symbolValue == TimeSymbolMusicXML.normal)
     {
         beatValue     = timeSignature.Items[timeSignature.ItemsElementName.GetValueIndexFromObjectArray(TimeChoiceTypeMusicXML.beats)].ToString();
         beatTimeValue = timeSignature.Items[timeSignature.ItemsElementName.GetValueIndexFromObjectArray(TimeChoiceTypeMusicXML.beattype)].ToString();
     }
 }
Esempio n. 3
0
        private void GenerateTimeSignaturesPerMeasure() //TODO_Later refactor to no cloning, but finding first going back from measure.Number, which provide only clef changes in dictionary
        {
            var          firstPart            = score.Part.FirstOrDefault();
            TimeMusicXML currentTimeSignature = new TimeMusicXML()
            {
                TimeSymbol = TimeSymbolMusicXML.common, TimeSymbolSpecified = true
            };

            foreach (var measure in firstPart.Measure)
            {
                if (measure.Items.OfType <AttributesMusicXML>().FirstOrDefault() != null)
                {
                    var attributes = measure.Items.OfType <AttributesMusicXML>().FirstOrDefault();
                    if (attributes.Time.Count != 0)
                    {
                        var timeSig = attributes.Time[0];
                        currentTimeSignature             = timeSig;
                        currentTimeSignature.PrintObject = Model.Helpers.SimpleTypes.YesNoMusicXML.yes;
                        timeSignatures.Add(measure.Number, currentTimeSignature);
                    }
                    else
                    {
                        TimeMusicXML time = currentTimeSignature.Clone();
                        time.PrintObject = Model.Helpers.SimpleTypes.YesNoMusicXML.no;
                        timeSignatures.Add(measure.Number, time);
                    }
                }
                else
                {
                    TimeMusicXML time = currentTimeSignature.Clone();
                    time.PrintObject = Model.Helpers.SimpleTypes.YesNoMusicXML.no;
                    timeSignatures.Add(measure.Number, time);
                }
            }
            //var test = timeSignatures.Select(i => i).Where(i => i.Value.PrintObject == Model.Helpers.SimpleTypes.YesNoMusicXML.yes);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets Time Signature of selected measureId
        /// </summary>
        /// <param name="measureId">MeasureId token, which is Measure.Number</param>
        /// <returns>Time attributes attached to measureId, PartId is not necessary due to all parts shares the same time signature</returns>
        public TimeMusicXML GetTimeSignature(string measureId)
        {
            TimeMusicXML time = timeSignatures[measureId];

            return(time); //? new Model.MeasureItems.Attributes.TimeMusicXML();
        }