示例#1
0
        private void DeletePatternPosition(int position)
        {
            var list = PatternOrderList.ToList();

            list.RemoveAt(position);
            list.Add(0);
            for (var i = 0; i < 256; i++)
            {
                PatternOrderList[i] = list[i];
            }
            SongLength--;
        }
示例#2
0
        public Pattern InsertNewPattern(int position, int size)
        {
            var pat = NewPattern(size);

            Patterns.Add(pat);
            int patId = Patterns.IndexOf(pat);
            var list  = PatternOrderList.ToList();

            list.Insert(position, (byte)patId);
            for (var i = 0; i < 256; i++)
            {
                PatternOrderList[i] = list[i];
            }
            SongLength += 1;
            if (SongLength > 256)
            {
                throw new Exception("You've ran out of song length");
            }
            return(pat);
        }