コード例 #1
0
        public WaveformDimensions(TuneDuration coverageArea, double canvasWidth,
                                  double leftPadding, double rightPadding, double zoomedInLeftPadding, double zoomedInRightPadding) : this()
        {
            var safeCanvasWidth = new FiniteDouble(canvasWidth);
            var safeZoom        = Math.Max(1d, new FiniteDouble(coverageArea.Zoom, 1.0));

            this.LeftPadding = safeZoom > 1
                ? zoomedInLeftPadding
                : leftPadding;
            this.RightPadding = safeZoom > 1
                ? zoomedInRightPadding
                : rightPadding;
            this.RenderedWidth = Math.Max(0, (safeCanvasWidth - this.LeftPadding - this.RightPadding));
            this.CompleteWidth = this.RenderedWidth * safeZoom;
            this.StartsAtPx    = coverageArea.HiddenBefore(this.CompleteWidth);
        }
コード例 #2
0
 public WaveformDimensions(TuneDuration coverageArea, double canvasWidth)
     : this(coverageArea, canvasWidth,
            new FiniteDouble(canvasWidth) * LeftSideMarginPercentDefault,
            new FiniteDouble(canvasWidth) * RightSideMarginPercentDefault)
 {
 }
コード例 #3
0
 public WaveformDimensions(TuneDuration coverageArea, double canvasWidth,
                           double leftPadding, double rightPadding) :
     this(coverageArea, canvasWidth, leftPadding, rightPadding, ZoomedInLeftMarginPxDefault, ZoomedInRightMarginPxDefault)
 {
 }
コード例 #4
0
 public bool Equals(TuneDuration other)
 {
     return(this.Start.Equals(other.Start) && this.End.Equals(other.End) && this.Duration().Equals(other.Duration()));
 }