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);
        }
 public WaveformDimensions(TuneDuration coverageArea, double canvasWidth)
     : this(coverageArea, canvasWidth,
            new FiniteDouble(canvasWidth) * LeftSideMarginPercentDefault,
            new FiniteDouble(canvasWidth) * RightSideMarginPercentDefault)
 {
 }
 public WaveformDimensions(TuneDuration coverageArea, double canvasWidth,
                           double leftPadding, double rightPadding) :
     this(coverageArea, canvasWidth, leftPadding, rightPadding, ZoomedInLeftMarginPxDefault, ZoomedInRightMarginPxDefault)
 {
 }
 public bool Equals(TuneDuration other)
 {
     return(this.Start.Equals(other.Start) && this.End.Equals(other.End) && this.Duration().Equals(other.Duration()));
 }