예제 #1
0
        public void SetChunkMode(int position, Mode mode, bool ctrl)
        {
            var index = Montage.Chunks.FindChunkIndex(position);

            if (index == -1)
            {
                return;
            }
            var chunk = Montage.Chunks[index];

            if (chunk.Mode == Mode.Undefined && chunk.Length > 500 && !ctrl)
            {
                var chunk1 = new ChunkDataV4 {
                    StartTime = chunk.StartTime, Length = position - chunk.StartTime, Mode = mode
                };
                var chunk2 = new ChunkDataV4 {
                    StartTime = position, Length = chunk.Length - chunk1.Length, Mode = Mode.Undefined
                };
                Montage.Chunks.RemoveAt(index);
                Montage.Chunks.Insert(index, chunk1);
                Montage.Chunks.Insert(index + 1, chunk2);
            }
            else
            {
                chunk.Mode = mode;
            }
            CorrectBorderBetweenChunksBySound(index - 1);
            CorrectBorderBetweenChunksBySound(index);
        }
예제 #2
0
 public void SetChunkMode(int position, Mode mode, bool ctrl)
 {
     var index = Montage.Chunks.FindChunkIndex(position);
     if (index == -1) return;
     var chunk = Montage.Chunks[index];
     if (chunk.Mode == Mode.Undefined && chunk.Length > 500 && !ctrl)
     {
         var chunk1 = new ChunkDataV4 { StartTime = chunk.StartTime, Length = position - chunk.StartTime, Mode = mode };
         var chunk2 = new ChunkDataV4 { StartTime = position, Length = chunk.Length - chunk1.Length, Mode = Mode.Undefined };
         Montage.Chunks.RemoveAt(index);
         Montage.Chunks.Insert(index, chunk1);
         Montage.Chunks.Insert(index + 1, chunk2);
     }
     else
     {
         chunk.Mode = mode;
     }
     CorrectBorderBetweenChunksBySound(index - 1);
     CorrectBorderBetweenChunksBySound(index);
 }