Esempio n. 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);
        }
        public void Handle(string token, SheetBuilder builder)
        {
            if (contextActive && token != match_token && token.Contains("="))
            {
                var values = token.Split('=');

                if (values.Length == 2)
                {
                    if (uint.TryParse(values[1], out var result))
                    {
                        builder.AddTempto(result);
                    }

                    contextActive = false;
                }
            }
        }