Esempio n. 1
0
        public bool MarkPitch(int pitchValue, McPitch.PitchTypes pitchType)
        {
            if ((pitchValue < McPitch.PitchMin) || (pitchValue > McPitch.PitchMax))
            {
                return(false);
            }
            if (!((pitchType != McPitch.PitchTypes.Enabled) || this.CanAppendNewPitch))
            {
                return(false);
            }
            McPitch pitch = this._pitches[pitchValue];

            McPitch.PitchTypes disabled = McPitch.PitchTypes.Disabled;
            if (pitch != null)
            {
                disabled = pitch.PitchType;
            }
            if ((disabled != pitchType) && this.IsViald)
            {
                this._pitches[pitchValue] = (pitchType != McPitch.PitchTypes.Disabled) ? McPitch.FromNaturalPitchValue(this, pitchValue, pitchType) : null;
                int num       = (this.ParentMeasure.ClefType == McMeasure.ClefTypes.L2G) ? 0x2c : 0x17;
                int?nullable  = null;
                int?nullable2 = null;
                for (int i = McPitch.PitchMin; i <= McPitch.PitchMax; i++)
                {
                    if (this._pitches[i] != null)
                    {
                        if (!nullable.HasValue)
                        {
                            nullable = new int?(i);
                        }
                        nullable2 = new int?(i);
                    }
                }
                int?nullable3 = nullable2;
                this.HighestPitchValue = nullable3.HasValue ? nullable3.GetValueOrDefault() : num;
                nullable3             = nullable;
                this.LowestPitchValue = nullable3.HasValue ? nullable3.GetValueOrDefault() : num;
                if (this.IsViald)
                {
                    if (((disabled == McPitch.PitchTypes.Temporary) && (pitchType == McPitch.PitchTypes.Disabled)) || ((disabled == McPitch.PitchTypes.Disabled) && (pitchType == McPitch.PitchTypes.Temporary)))
                    {
                        McUtility.AppendRedrawingMeasure(this.ParentMeasure);
                    }
                    else
                    {
                        McUtility.MarkModified(this.ParentMeasure);
                    }
                }
            }
            return(true);
        }
Esempio n. 2
0
 public static void Clear()
 {
     if (_hoveringNotePack != null)
     {
         _hoveringNotePack.IsHovering = false;
     }
     if (_hoveringMeasure != null)
     {
         _hoveringMeasure.IsHovering = false;
         McUtility.AppendRedrawingMeasure(_hoveringMeasure);
     }
     _hoveringInsertNotePackIndex = -1;
     _hoveringInsertPitchValue    = 0;
     _hoveringNotePack            = null;
     _hoveringMeasure             = null;
 }