1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 08:33:36 +02:00

More const qualifications, and mutables, for functions that draw tracks...

... The display related  members that had to become mutable are probably
ones that don't belong in the track classes, ultimately.
This commit is contained in:
Paul Licameli
2016-02-27 12:12:40 -05:00
parent 05f5375e4a
commit 70c1d57591
15 changed files with 98 additions and 93 deletions

View File

@@ -50,7 +50,7 @@ class TimeTrack final : public Track {
double GetStartTime() const override { return 0.0; }
double GetEndTime() const override { return 0.0; }
void Draw(wxDC & dc, const wxRect & r, const ZoomInfo &zoomInfo);
void Draw(wxDC & dc, const wxRect & r, const ZoomInfo &zoomInfo) const;
// XMLTagHandler callback methods for loading and saving
@@ -68,6 +68,7 @@ class TimeTrack final : public Track {
// Access the track's speed envelope
Envelope *GetEnvelope() { return mEnvelope; }
const Envelope *GetEnvelope() const { return mEnvelope; }
//Note: The meaning of this function has changed (December 2012)
//Previously this function did something that was close to the opposite (but not entirely accurate).
@@ -81,7 +82,7 @@ class TimeTrack final : public Track {
* @param t1 The ending time to calculate to
* @return The relative length increase of the chosen segment from the original sound.
*/
double ComputeWarpFactor(double t0, double t1);
double ComputeWarpFactor(double t0, double t1) const;
/** @brief Compute the duration (in seconds at playback) of the specified region of the track.
*
* Takes a region of the time track (specified by the unwarped time points in the project), and
@@ -91,7 +92,7 @@ class TimeTrack final : public Track {
* @param t1 unwarped time to stop calculation at
* @return the warped duration in seconds
*/
double ComputeWarpedLength(double t0, double t1);
double ComputeWarpedLength(double t0, double t1) const;
/** @brief Compute how much unwarped time must have elapsed if length seconds of warped time has
* elapsed
*
@@ -99,7 +100,7 @@ class TimeTrack final : public Track {
* @param length How many seconds of warped time went past.
* @return The end point (in seconds from project start) as unwarped time
*/
double SolveWarpedLength(double t0, double length);
double SolveWarpedLength(double t0, double length) const;
// Get/Set the speed-warping range, as percentage of original speed (e.g. 90%-110%)