Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        private void GenerateSoundMarkers()
        {
            TexturePen pen = new TexturePen();

            pen.Connect(OneFullWaveForm.MarkersImage);
            pen.BackgroundColor = pen.GetPixelColor(0, 0);
            pen.PenColor        = Color.grey;

            pen.PenThinkness = 5;
            pen.PenColor     = Color.gray;
            MarkerCalculator markersData = OneFullWaveForm.MarkersData;

            for (int i = 0; i < markersData.Count; i++)
            {
                markersData.SetCurrentMarker(i);

                MarkerCalculator.MarkerTypeId markerType = markersData.MarkerType;
                switch (markerType)
                {
                case MarkerCalculator.MarkerTypeId.Start:
                case MarkerCalculator.MarkerTypeId.End:
                    pen.DrawColumn(markersData.PlaceInPixels, 5, Color.white, 100);
                    break;

                case MarkerCalculator.MarkerTypeId.Big:
                    pen.DrawColumn(markersData.PlaceInPixels, 3, Color.gray, 100);
                    break;

                case MarkerCalculator.MarkerTypeId.Middle:
                    pen.DrawColumn(markersData.PlaceInPixels, 1, Color.white, 50);
                    break;

                case MarkerCalculator.MarkerTypeId.Small:
                    pen.DrawColumn(markersData.PlaceInPixels, 1, Color.white, 25);
                    break;

                default:
                    break;
                }
            }


            pen.Apply();
        }