コード例 #1
0
        public void Handle(XPathNodeIterator it, SheetBuilder builder)
        {
            var beats     = it.Current.SelectSingleNode("time/beats");
            var beat_type = it.Current.SelectSingleNode("time/beat-type");
            var key       = it.Current.SelectSingleNode("clef/sign");

            var parsedKey = (SheetKey)Enum.Parse(typeof(SheetKey), key.Value);

            builder.AddKey(parsedKey);
            builder.AddTimeSignature((uint)beats.ValueAsInt, (uint)beat_type.ValueAsInt);
            builder.AddTempto(120);
        }
コード例 #2
0
        public void Handle(string token, SheetBuilder builder)
        {
            if (contextActive && token != match_token)
            {
                var key = token[0].ToString().ToUpper();
                builder.AddKey((SheetKey)Enum.Parse(typeof(SheetKey), key));

                int up   = token.Count(x => x == '\'');
                int down = token.Count(x => x == ',');

                //builder.AddGlobalNoteOctave(up + down);

                contextActive       = false;
                lookForStartBracket = true;
            }
        }