1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Fix a compilation warning, make some member functions const

This commit is contained in:
Paul-Licameli 2015-04-19 07:27:33 -04:00 committed by Paul Licameli
parent 6810095509
commit 1992b0c7e3
5 changed files with 6 additions and 6 deletions

View File

@ -218,7 +218,7 @@ void NoteTrack::WarpAndTransposeNotes(double t0, double t1,
Alg_iterator iter(mSeq, false);
iter.begin();
Alg_event_ptr event;
while ((event = iter.next()) && event->time < t1) {
while (0 != (event = iter.next()) && event->time < t1) {
if (event->is_note() && event->time >= t0 &&
// Allegro data structure does not restrict channels to 16.
// Since there is not way to select more than 16 channels,

View File

@ -270,7 +270,7 @@ void Track::ReorderList(bool resize)
}
#endif
bool Track::IsSyncLockSelected()
bool Track::IsSyncLockSelected() const
{
#ifdef EXPERIMENTAL_SYNC_LOCK
AudacityProject *p = GetActiveProject();
@ -278,7 +278,7 @@ bool Track::IsSyncLockSelected()
return false;
SyncLockedTracksIterator git(mList);
Track *t = git.First(this);
Track *t = git.First(const_cast<Track*>(this));
if (!t) {
// Not in a sync-locked group.

View File

@ -206,7 +206,7 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
virtual double GetEndTime() const = 0;
// Checks if sync-lock is on and any track in its sync-lock group is selected.
bool IsSyncLockSelected();
bool IsSyncLockSelected() const;
};
struct TrackListNode

View File

@ -1631,7 +1631,7 @@ AUDACITY_DLL_API sampleCount WaveTrack::TimeToLongSamples(double t0) const
return (sampleCount)floor(t0 * mRate + 0.5);
}
double WaveTrack::LongSamplesToTime(sampleCount pos)
double WaveTrack::LongSamplesToTime(sampleCount pos) const
{
return ((double)pos) / mRate;
}

View File

@ -303,7 +303,7 @@ class AUDACITY_DLL_API WaveTrack: public Track {
* @param pos The time number of samples from the start of the track to convert.
* @return The time in seconds.
*/
double LongSamplesToTime(sampleCount pos);
double LongSamplesToTime(sampleCount pos) const;
// Get access to the clips in the tracks. This is used by
// track artists and also by TrackPanel when sliding...it would