Exemplo n.º 1
0
        public WaveformSection(TuneDuration tuneDuration, ITimedPlayback tune, int resolution)
        {
            this.Start = new Even((int)(new FiniteDouble(                    // gotta be even, baby
                                            tuneDuration.StartingPoint()     // this is number of seconds at which the area start
                                            / tune.TotalTime().TotalSeconds) // this is the total number of seconds - so the ratio is correct
                                        .Value() * resolution));

            this.End = this.Start + (int)Math.Min(resolution,                      // how much are we going to cover? max is the number of points available <=> resolution
                                                  resolution / tuneDuration.Zoom); // what is this if resolution == 8000 and zoom == 2, then we cover r/2 == 4000? seems like!
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize with an instance of ITimedPlayback and an explicit zoom level
 /// </summary>
 public TuneDuration(ITimedPlayback tune, double zoom) : this(tune.CurrentTime().TotalSeconds, tune.TotalTime().TotalSeconds, zoom)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initialize with an instance of ITimedPlayback and assumed zoom=1
 /// </summary>
 // ReSharper disable once UnusedMember.Global
 public TuneDuration(ITimedPlayback tune) : this(tune, 1.0)
 {
 }