Exemplo n.º 1
0
        /// <summary>
        /// Inserts a ClefDef at the given index (which must be greater than 0).
        /// <para>If a ClefDef is defined directly before a rest, the resulting SmallClef will be placed before the
        /// following Chord or the bar's end barline.
        /// </para>
        /// <para>If the index is equal to or greater than the number of objects in the voiceDef, the ClefDef will be
        /// placed before the final barline.
        /// </para>
        /// <para>
        /// When changing clefs more than once in the same VoiceDef, it is easier to get the indices right if
        /// they are added backwards.
        /// </para>
        /// </summary>
        /// <param name="index">Must be greater than 0</param>
        /// <param name="clefType">One of the following strings: "t", "t1", "t2", "t3", "b", "b1", "b2", "b3"</param>
        public void InsertClefDef(int index, string clefType)
        {
            #region check args
            M.Assert(index > 0, "Cannot insert a clef before the first chord or rest in the bar!");

            if (String.Equals(clefType, "t") == false &&
                String.Equals(clefType, "t1") == false &&
                String.Equals(clefType, "t2") == false &&
                String.Equals(clefType, "t3") == false &&
                String.Equals(clefType, "b") == false &&
                String.Equals(clefType, "b1") == false &&
                String.Equals(clefType, "b2") == false &&
                String.Equals(clefType, "b3") == false)
            {
                M.Assert(false, "Unknown clef type.");
            }
            #endregion

            ClefDef clefDef = new ClefDef(clefType, 0);
            _Insert(index, clefDef);
        }
Exemplo n.º 2
0
        public object Clone()
        {
            ClefDef deepClone = new ClefDef(_clefType, MsPositionReFirstUD);

            return(deepClone);
        }