Example #1
0
        public static double GetDurationMultiplier(this NoteValueAugment augment)
        {
            switch (augment)
            {
            case NoteValueAugment.None:
                return(1.0);

            case NoteValueAugment.Dot:
                return(1.5);

            case NoteValueAugment.TwoDots:
                return(1.75);

            case NoteValueAugment.ThreeDots:
                return(1.875);

            default:
                throw new ArgumentOutOfRangeException(nameof(augment), augment, null);
            }
        }
Example #2
0
        public NoteValue(BaseNoteValue baseValue, NoteValueAugment augment = NoteValueAugment.None, int?tuplet = null)
        {
            if (tuplet != null)
            {
                if (!NoteValue.IsValidTuplet(tuplet.Value))
                {
                    throw new ArgumentOutOfRangeException(nameof(tuplet), "invalid tuplet value");
                }

                if (baseValue >= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(tuplet),
                                                          "tuplet not supported for notes equal or longer than a whole");
                }
            }

            this.Base    = baseValue;
            this.Augment = augment;
            this.Tuplet  = tuplet;
        }
Example #3
0
 public void DrawNoteValueAugment(NoteValueAugment augment, double x, double y)
 => this.InvokeRenderMethod("drawNoteValueAugment", (int)augment, x, y);