Пример #1
0
        public static string GetStopName(Stop st)
        {
            string[] res = null;
            switch (st.Type)
            {
            case StopType.Great:
                if ((st.id1 & StopsFactory.UserMIDIFlags) != 0)
                {
                    return(GetStopNameMIDI(st));
                }
                if (GreatTable.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                return(string.Empty);

            case StopType.Swell:
                if ((st.id1 & StopsFactory.UserMIDIFlags) != 0)
                {
                    return(GetStopNameMIDI(st));
                }
                if (SwellTable.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            case StopType.Pedal:
                if ((st.id1 & StopsFactory.UserMIDIFlags) != 0)
                {
                    return(GetStopNameMIDI(st));
                }
                if (PedalTable.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            case StopType.CP:
                if (CPTable.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            case StopType.GreatDAT:
                if (GreatTableDAT.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            case StopType.SwellDAT:
                if (SwellTableDAT.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            case StopType.PedalDAT:
                if (PedalTableDAT.TryGetValue(st.id0 + 1, out res))
                {
                    return(res[st.id1]);
                }
                else
                {
                    return(string.Empty);
                }

            default:
                return(string.Empty);
            }
        }
Пример #2
0
 public static string SeparatorToString(Stop separator)
 {
     return(string.Format("M{0}P{1}", separator.id0 / 100 + 1, separator.id0 % 100 + 1));
 }