Exemple #1
0
 private void SaveFrame(AudioFrame frame)
 {
     if (_framesList.All(f => f.FrameNumber != frame.FrameNumber))
     {
         _framesList.Add(frame);
     }
 }
Exemple #2
0
        internal void OnSetKey(MarkerCalculator markersData)
        {
            var selectionCenter = _waveFormRect.width * _waveFormSelectionFrac;

            var frame = new AudioFrame();

            frame.FrameNumber        = (int)(SelectedTimePosition() * AudioFramesRate);
            frame.LeftBoundInPixels  = selectionCenter - 5;
            frame.RightBoundInPixels = selectionCenter + 5;


            KeyFrameSet(frame.FrameNumber);

            SaveFrame(frame);
        }
Exemple #3
0
        public AudioFrame GetFrameByCoordinates(float point)
        {
            var frame = new AudioFrame();

            const int SMALL_MARKERS_IN_BIG_ONE   = 10;
            var       distanceBetweenBigsMarkers = GetDistanceBetweenMarkers() * SMALL_MARKERS_IN_BIG_ONE;
            var       frameNumber = (int)(point / distanceBetweenBigsMarkers);
            int       left        = frameNumber * SMALL_MARKERS_IN_BIG_ONE;
            int       right       = left + SMALL_MARKERS_IN_BIG_ONE;

            frame.LeftBoundInPixels  = GetPlaceInPixels(left);
            frame.RightBoundInPixels = GetPlaceInPixels(right);
            frame.FrameNumber        = frameNumber + 1;

            return(frame);
        }