Ejemplo n.º 1
0
        static List <GenericToken <MusicToken> > GetChordTok(GenericToken <MusicToken> chord, ref int key, int durms, ref StringBuilder song)
        {
            if (!chord.isValid || ((chord.type != MusicToken.Chord) && (chord.type != MusicToken.ChordScale)))
            {
                return(new List <GenericToken <MusicToken> >());
            }
            ChordTokens ct = ChordTokens.None;

            if (Enum.TryParse <ChordTokens>(chord.data, true, out ct))
            {
                var gtc = new GenericToken <ChordTokens>(ct, ct.ToString());
                return(GetChordToks(gtc, ref key, durms, ref song));
            }

            throw new Exception("Unknown chord: " + chord.ToString() + ", please implement this chord.");
        }