Example #1
0
        public static bool TryReadStaffType(Scanner scanner, ILogger logger, out LiteralNode <StaffType> staffTypeNode)
        {
            StaffType staffType;

            switch (scanner.ReadToLineEnd().Trim().ToLowerInvariant())
            {
            case "guitar":
            case "acoustic guitar":
                staffType = StaffType.Guitar; break;

            case "steel":
            case "steel guitar":
                staffType = StaffType.SteelGuitar; break;

            case "nylon":
            case "nylon guitar":
            case "classical":
            case "classical guitar":
                staffType = StaffType.NylonGuitar; break;

            case "electric guitar":
                staffType = StaffType.ElectricGuitar; break;

            case "bass":
                staffType = StaffType.Bass; break;

            case "acoustic bass":
                staffType = StaffType.AcousticBass; break;

            case "electric bass":
                staffType = StaffType.ElectricBass; break;

            case "ukulele":
            case "uku":
                staffType = StaffType.Ukulele; break;

            case "mandolin":
                staffType = StaffType.Mandolin; break;

            case "vocal":
                staffType = StaffType.Vocal; break;

            default:
                staffTypeNode = null;
                return(false);
            }

            staffTypeNode = new LiteralNode <StaffType>(staffType, scanner.LastReadRange);
            return(true);
        }