More const and override

This commit is contained in:
Paul Licameli 2017-02-22 14:23:35 -05:00
parent 9ddb5bb1f3
commit 81285ee0c1
59 changed files with 193 additions and 165 deletions

View File

@ -642,7 +642,7 @@ private:
friend void InitAudioIO(); friend void InitAudioIO();
TimeTrack *mTimeTrack; const TimeTrack *mTimeTrack;
// For cacheing supported sample rates // For cacheing supported sample rates
static int mCachedPlaybackIndex; static int mCachedPlaybackIndex;

View File

@ -50,7 +50,6 @@ public:
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
// This class only knows reading tags // This class only knows reading tags
// void WriteXML(XMLWriter & WXUNUSED(xmlFile)) /* not override */ { wxASSERT(false); }
private: private:

View File

@ -121,9 +121,9 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
// Note: following affects only the loading of block files when opening a project // Note: following affects only the loading of block files when opening a project
void SetLoadingMaxSamples(size_t max) { mMaxSamples = max; } void SetLoadingMaxSamples(size_t max) { mMaxSamples = max; }
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; } XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) override
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags. { return NULL; }
bool AssignFile(wxFileNameWrapper &filename, const wxString &value, bool check); bool AssignFile(wxFileNameWrapper &filename, const wxString &value, bool check);
// Clean the temp dir. Note that now where we have auto recovery the temp // Clean the temp dir. Note that now where we have auto recovery the temp

View File

@ -331,7 +331,7 @@ float Envelope::ValueOfPixel( int y, int height, bool upper,
/// a given time value: /// a given time value:
/// We have an upper and lower envelope line. /// We have an upper and lower envelope line.
/// Also we may be showing an inner envelope (at 0.5 the range). /// Also we may be showing an inner envelope (at 0.5 the range).
bool Envelope::HandleMouseButtonDown(wxMouseEvent & event, wxRect & r, bool Envelope::HandleMouseButtonDown(const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, const ZoomInfo &zoomInfo,
bool dB, double dBRange, bool dB, double dBRange,
float zoomMin, float zoomMax) float zoomMin, float zoomMax)
@ -476,7 +476,7 @@ void Envelope::MarkDragPointForDeletion()
mEnv[mDragPoint].SetVal(mEnv[iNeighbourPoint].GetVal()); mEnv[mDragPoint].SetVal(mEnv[iNeighbourPoint].GetVal());
} }
void Envelope::MoveDraggedPoint( wxMouseEvent & event, wxRect & r, void Envelope::MoveDraggedPoint( const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax) float zoomMin, float zoomMax)
{ {
@ -511,7 +511,7 @@ void Envelope::MoveDraggedPoint( wxMouseEvent & event, wxRect & r,
} }
bool Envelope::HandleDragging( wxMouseEvent & event, wxRect & r, bool Envelope::HandleDragging( const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax) float zoomMin, float zoomMax)
{ {
@ -559,7 +559,7 @@ void Envelope::Insert(int point, const EnvPoint &p)
} }
// Returns true if parent needs to be redrawn // Returns true if parent needs to be redrawn
bool Envelope::MouseEvent(wxMouseEvent & event, wxRect & r, bool Envelope::MouseEvent(const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax) float zoomMin, float zoomMax)
{ {

View File

@ -43,7 +43,7 @@ public:
double GetVal() const { return mVal; } double GetVal() const { return mVal; }
inline void SetVal(double val); inline void SetVal(double val);
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override
{ {
if (!wxStrcmp(tag, wxT("controlpoint"))) { if (!wxStrcmp(tag, wxT("controlpoint"))) {
while (*attrs) { while (*attrs) {
@ -60,7 +60,7 @@ public:
return false; return false;
} }
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) override
{ {
return NULL; return NULL;
} }
@ -112,13 +112,13 @@ class Envelope final : public XMLTagHandler {
// Event Handlers // Event Handlers
// Each ofthese returns true if parents needs to be redrawn // Each ofthese returns true if parents needs to be redrawn
bool MouseEvent(wxMouseEvent & event, wxRect & r, bool MouseEvent(const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax); float zoomMin, float zoomMax);
bool HandleMouseButtonDown( wxMouseEvent & event, wxRect & r, bool HandleMouseButtonDown( const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax); float zoomMin, float zoomMax);
bool HandleDragging( wxMouseEvent & event, wxRect & r, bool HandleDragging( const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax); float zoomMin, float zoomMax);
bool HandleMouseButtonUp(); bool HandleMouseButtonUp();
@ -200,7 +200,7 @@ private:
float zoomMin, float zoomMax); float zoomMin, float zoomMax);
void BinarySearchForTime( int &Lo, int &Hi, double t ) const; void BinarySearchForTime( int &Lo, int &Hi, double t ) const;
double GetInterpolationStartValueAtPoint( int iPoint ) const; double GetInterpolationStartValueAtPoint( int iPoint ) const;
void MoveDraggedPoint( wxMouseEvent & event, wxRect & r, void MoveDraggedPoint( const wxMouseEvent & event, wxRect & r,
const ZoomInfo &zoomInfo, bool dB, double dBRange, const ZoomInfo &zoomInfo, bool dB, double dBRange,
float zoomMin, float zoomMax); float zoomMin, float zoomMax);

View File

@ -2261,7 +2261,7 @@ XMLTagHandler *LabelTrack::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void LabelTrack::WriteXML(XMLWriter &xmlFile) void LabelTrack::WriteXML(XMLWriter &xmlFile) const
{ {
int len = mLabels.size(); int len = mLabels.size();

View File

@ -147,7 +147,7 @@ class AUDACITY_DLL_API LabelTrack final : public Track
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) override; void WriteXML(XMLWriter &xmlFile) const override;
#if LEGACY_PROJECT_FILE_SUPPORT #if LEGACY_PROJECT_FILE_SUPPORT
bool Load(wxTextFile * in, DirManager * dirManager) override; bool Load(wxTextFile * in, DirManager * dirManager) override;

View File

@ -5121,7 +5121,7 @@ void AudacityProject::OnToggleSpectralSelection()
void AudacityProject::DoNextPeakFrequency(bool up) void AudacityProject::DoNextPeakFrequency(bool up)
{ {
// Find the first selected wave track that is in a spectrogram view. // Find the first selected wave track that is in a spectrogram view.
WaveTrack *pTrack = 0; const WaveTrack *pTrack {};
SelectedTrackListOfKindIterator iter(Track::Wave, GetTracks()); SelectedTrackListOfKindIterator iter(Track::Wave, GetTracks());
for (Track *t = iter.First(); t; t = iter.Next()) { for (Track *t = iter.First(); t; t = iter.Next()) {
WaveTrack *const wt = static_cast<WaveTrack*>(t); WaveTrack *const wt = static_cast<WaveTrack*>(t);

View File

@ -564,7 +564,7 @@ bool NoteTrack::Shift(double t) // t is always seconds
return true; return true;
} }
double NoteTrack::NearestBeatTime(double time, double *beat) double NoteTrack::NearestBeatTime(double time, double *beat) const
{ {
wxASSERT(mSeq); wxASSERT(mSeq);
// Alg_seq knows nothing about offset, so remove offset time // Alg_seq knows nothing about offset, so remove offset time
@ -601,7 +601,7 @@ namespace
} }
} }
Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup) Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup) const
{ {
cleanup.reset(); cleanup.reset();
double offset = GetOffset(); double offset = GetOffset();
@ -615,10 +615,16 @@ Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup)
cleanup.reset( mSeq->copy(start, mSeq->get_dur() - start, false) ); cleanup.reset( mSeq->copy(start, mSeq->get_dur() - start, false) );
auto seq = cleanup.get(); auto seq = cleanup.get();
if (offset > 0) { if (offset > 0) {
// swap cleanup and mSeq so that Shift operates on the NEW copy {
swap(mSeq, cleanup); // Cheat a little
Shift(offset); NoteTrack *pMutable = const_cast< NoteTrack * >(this);
swap(mSeq, cleanup); // undo the swap
// swap cleanup and mSeq so that Shift operates on the NEW copy
swap(pMutable->mSeq, cleanup);
auto cleanup2 = finally( [&] { swap(pMutable->mSeq, cleanup); } );
pMutable->Shift(offset);
}
#ifdef OLD_CODE #ifdef OLD_CODE
// now shift events by offset. This must be done with an integer // now shift events by offset. This must be done with an integer
// number of measures, so first, find the beats-per-measure // number of measures, so first, find the beats-per-measure
@ -720,7 +726,7 @@ Alg_seq *NoteTrack::MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup)
} }
bool NoteTrack::ExportMIDI(const wxString &f) bool NoteTrack::ExportMIDI(const wxString &f) const
{ {
std::unique_ptr<Alg_seq> cleanup; std::unique_ptr<Alg_seq> cleanup;
auto seq = MakeExportableSeq(cleanup); auto seq = MakeExportableSeq(cleanup);
@ -728,7 +734,7 @@ bool NoteTrack::ExportMIDI(const wxString &f)
return rslt; return rslt;
} }
bool NoteTrack::ExportAllegro(const wxString &f) bool NoteTrack::ExportAllegro(const wxString &f) const
{ {
double offset = GetOffset(); double offset = GetOffset();
bool in_seconds; bool in_seconds;
@ -800,7 +806,7 @@ XMLTagHandler *NoteTrack::HandleXMLChild(const wxChar * WXUNUSED(tag))
return NULL; return NULL;
} }
void NoteTrack::WriteXML(XMLWriter &xmlFile) void NoteTrack::WriteXML(XMLWriter &xmlFile) const
{ {
std::ostringstream data; std::ostringstream data;
// Normally, Duplicate is called in pairs -- once to put NoteTrack // Normally, Duplicate is called in pairs -- once to put NoteTrack
@ -818,7 +824,7 @@ void NoteTrack::WriteXML(XMLWriter &xmlFile)
// and perform WriteXML, we may need to restore NoteTracks from binary // and perform WriteXML, we may need to restore NoteTracks from binary
// blobs to regular data structures (with an Alg_seq member). // blobs to regular data structures (with an Alg_seq member).
Track::Holder holder; Track::Holder holder;
NoteTrack *saveme = this; const NoteTrack *saveme = this;
if (!mSeq) { // replace saveme with an (unserialized) duplicate if (!mSeq) { // replace saveme with an (unserialized) duplicate
holder = Duplicate(); holder = Duplicate();
saveme = static_cast<NoteTrack*>(holder.get()); saveme = static_cast<NoteTrack*>(holder.get());

View File

@ -78,9 +78,9 @@ class AUDACITY_DLL_API NoteTrack final : public Track {
int GetVisibleChannels(); int GetVisibleChannels();
Alg_seq *MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup); Alg_seq *MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup) const;
bool ExportMIDI(const wxString &f); bool ExportMIDI(const wxString &f) const;
bool ExportAllegro(const wxString &f); bool ExportAllegro(const wxString &f) const;
/* REQUIRES PORTMIDI */ /* REQUIRES PORTMIDI */
// int GetLastMidiPosition() const { return mLastMidiPosition; } // int GetLastMidiPosition() const { return mLastMidiPosition; }
@ -102,7 +102,7 @@ class AUDACITY_DLL_API NoteTrack final : public Track {
void SetGain(float gain) { mGain = gain; } void SetGain(float gain) { mGain = gain; }
#endif #endif
double NearestBeatTime(double time, double *beat); double NearestBeatTime(double time, double *beat) const;
bool StretchRegion(double b0, double b1, double dur); bool StretchRegion(double b0, double b1, double dur);
int GetBottomNote() const { return mBottomNote; } int GetBottomNote() const { return mBottomNote; }
@ -172,7 +172,7 @@ class AUDACITY_DLL_API NoteTrack final : public Track {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) override; void WriteXML(XMLWriter &xmlFile) const override;
// channels are numbered as integers 0-15, visible channels // channels are numbered as integers 0-15, visible channels
// (mVisibleChannels) is a bit set. Channels are displayed as // (mVisibleChannels) is a bit set. Channels are displayed as

View File

@ -59,7 +59,7 @@ Profiler::~Profiler()
} }
///start the task timer. ///start the task timer.
void Profiler::Begin(char* fileName, int lineNum, char* taskDescription) void Profiler::Begin(const char* fileName, int lineNum, const char* taskDescription)
{ {
mTasksMutex.Lock(); mTasksMutex.Lock();
GetOrCreateTaskProfile(fileName,lineNum)->Begin(fileName,lineNum,taskDescription); GetOrCreateTaskProfile(fileName,lineNum)->Begin(fileName,lineNum,taskDescription);
@ -67,7 +67,7 @@ void Profiler::Begin(char* fileName, int lineNum, char* taskDescription)
} }
///end the task timer. ///end the task timer.
void Profiler::End(char* fileName, int lineNum, char* taskDescription) void Profiler::End(const char* fileName, int lineNum, const char* taskDescription)
{ {
mTasksMutex.Lock(); mTasksMutex.Lock();
TaskProfile* tp; TaskProfile* tp;
@ -87,7 +87,7 @@ Profiler* Profiler::Instance()
} }
///find a taskProfile for the given task, otherwise create ///find a taskProfile for the given task, otherwise create
TaskProfile* Profiler::GetOrCreateTaskProfile(char* fileName, int lineNum) TaskProfile* Profiler::GetOrCreateTaskProfile(const char* fileName, int lineNum)
{ {
for(int i=0;i<(int)mTasks.size();i++) for(int i=0;i<(int)mTasks.size();i++)
{ {
@ -100,7 +100,7 @@ TaskProfile* Profiler::GetOrCreateTaskProfile(char* fileName, int lineNum)
return mTasks.back().get(); return mTasks.back().get();
} }
TaskProfile* Profiler::GetTaskProfileByDescription(char* description) TaskProfile* Profiler::GetTaskProfileByDescription(const char* description)
{ {
for(int i=0;i<(int)mTasks.size();i++) for(int i=0;i<(int)mTasks.size();i++)
{ {
@ -131,7 +131,7 @@ TaskProfile::~TaskProfile()
} }
///start the task timer. ///start the task timer.
void TaskProfile::Begin(char* fileName, int lineNum, char* taskDescription) void TaskProfile::Begin(const char* fileName, int lineNum, const char* taskDescription)
{ {
if(!mFileName) if(!mFileName)
{ {
@ -147,7 +147,7 @@ void TaskProfile::Begin(char* fileName, int lineNum, char* taskDescription)
} }
///end the task timer. ///end the task timer.
void TaskProfile::End(char* WXUNUSED(fileName), int WXUNUSED(lineNum), char* WXUNUSED(taskDescription)) void TaskProfile::End(const char* WXUNUSED(fileName), int WXUNUSED(lineNum), const char* WXUNUSED(taskDescription))
{ {
mCumTime += clock() - mLastTime; mCumTime += clock() - mLastTime;
mNumHits++; mNumHits++;

View File

@ -44,9 +44,9 @@ class Profiler
virtual ~Profiler(); virtual ~Profiler();
///start the task timer. ///start the task timer.
void Begin(char* fileName, int lineNum, char* taskDescription); void Begin(const char* fileName, int lineNum, const char* taskDescription);
///end the task timer. ///end the task timer.
void End(char* fileName, int lineNum, char* taskDescription); void End(const char* fileName, int lineNum, const char* taskDescription);
///Gets the singleton instance ///Gets the singleton instance
static Profiler* Instance(); static Profiler* Instance();
@ -56,8 +56,8 @@ class Profiler
Profiler(){}; Profiler(){};
///find a taskProfile for the given task, otherwise create ///find a taskProfile for the given task, otherwise create
TaskProfile* GetOrCreateTaskProfile(char* fileName, int lineNum); TaskProfile* GetOrCreateTaskProfile(const char* fileName, int lineNum);
TaskProfile* GetTaskProfileByDescription(char* description); TaskProfile* GetTaskProfileByDescription(const char* description);
//List of current Task to do. //List of current Task to do.
std::vector<movable_ptr<TaskProfile>> mTasks; std::vector<movable_ptr<TaskProfile>> mTasks;
@ -73,9 +73,9 @@ class Profiler
virtual ~TaskProfile(); virtual ~TaskProfile();
///start the task timer. ///start the task timer.
void Begin(char* fileName, int lineNum, char* taskDescription); void Begin(const char* fileName, int lineNum, const char* taskDescription);
///end the task timer. ///end the task timer.
void End(char* fileName, int lineNum, char* taskDescription); void End(const char* fileName, int lineNum, const char* taskDescription);
double ComputeAverageRunTime(); double ComputeAverageRunTime();

View File

@ -3511,7 +3511,7 @@ XMLTagHandler *AudacityProject::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void AudacityProject::WriteXMLHeader(XMLWriter &xmlFile) void AudacityProject::WriteXMLHeader(XMLWriter &xmlFile) const
{ {
xmlFile.Write(wxT("<?xml ")); xmlFile.Write(wxT("<?xml "));
xmlFile.Write(wxT("version=\"1.0\" ")); xmlFile.Write(wxT("version=\"1.0\" "));
@ -3570,9 +3570,9 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile)
mTags->WriteXML(xmlFile); mTags->WriteXML(xmlFile);
Track *t; const Track *t;
WaveTrack* pWaveTrack; WaveTrack* pWaveTrack;
TrackListIterator iter(GetTracks()); TrackListConstIterator iter(GetTracks());
t = iter.First(); t = iter.First();
unsigned int ndx = 0; unsigned int ndx = 0;
while (t) { while (t) {
@ -3617,7 +3617,6 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile)
t = iter.Next(); t = iter.Next();
} }
mStrOtherNamesArray.Clear();
if (!mAutoSaving) if (!mAutoSaving)
{ {
@ -3798,6 +3797,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
WriteXMLHeader(saveFile); WriteXMLHeader(saveFile);
WriteXML(saveFile); WriteXML(saveFile);
mStrOtherNamesArray.Clear();
saveFile.Close(); saveFile.Close();
} }
@ -4677,6 +4677,14 @@ ToolsToolBar *AudacityProject::GetToolsToolBar()
NULL); NULL);
} }
const ToolsToolBar *AudacityProject::GetToolsToolBar() const
{
return (ToolsToolBar *)
(mToolManager ?
mToolManager->GetToolBar(ToolsBarID) :
NULL);
}
TranscriptionToolBar *AudacityProject::GetTranscriptionToolBar() TranscriptionToolBar *AudacityProject::GetTranscriptionToolBar()
{ {
return (TranscriptionToolBar *) return (TranscriptionToolBar *)
@ -5080,6 +5088,7 @@ void AudacityProject::AutoSave()
AutoSaveFile buffer; AutoSaveFile buffer;
WriteXMLHeader(buffer); WriteXMLHeader(buffer);
WriteXML(buffer); WriteXML(buffer);
mStrOtherNamesArray.Clear();
wxFFile saveFile; wxFFile saveFile;
saveFile.Open(fn + wxT(".tmp"), wxT("wb")); saveFile.Open(fn + wxT(".tmp"), wxT("wb"));

View File

@ -143,7 +143,8 @@ class ImportXMLTagHandler final : public XMLTagHandler
ImportXMLTagHandler(AudacityProject* pProject) { mProject = pProject; } ImportXMLTagHandler(AudacityProject* pProject) { mProject = pProject; }
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) override { return NULL; } XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) override
{ return NULL; }
// Don't want a WriteXML method because ImportXMLTagHandler is not a WaveTrack. // Don't want a WriteXML method because ImportXMLTagHandler is not a WaveTrack.
// <import> tags are instead written by AudacityProject::WriteXML. // <import> tags are instead written by AudacityProject::WriteXML.
@ -168,6 +169,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
AudioIOStartStreamOptions GetDefaultPlayOptions(); AudioIOStartStreamOptions GetDefaultPlayOptions();
TrackList *GetTracks() { return mTracks.get(); } TrackList *GetTracks() { return mTracks.get(); }
const TrackList *GetTracks() const { return mTracks.get(); }
UndoManager *GetUndoManager() { return mUndoManager.get(); } UndoManager *GetUndoManager() { return mUndoManager.get(); }
sampleFormat GetDefaultFormat() { return mDefaultFormat; } sampleFormat GetDefaultFormat() { return mDefaultFormat; }
@ -261,6 +263,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
wxPanel *GetTopPanel() { return mTopPanel; } wxPanel *GetTopPanel() { return mTopPanel; }
TrackPanel * GetTrackPanel() {return mTrackPanel;} TrackPanel * GetTrackPanel() {return mTrackPanel;}
const TrackPanel * GetTrackPanel() const {return mTrackPanel;}
bool GetIsEmpty(); bool GetIsEmpty();
@ -298,6 +301,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
#include "Menus.h" #include "Menus.h"
CommandManager *GetCommandManager() { return &mCommandManager; } CommandManager *GetCommandManager() { return &mCommandManager; }
const CommandManager *GetCommandManager() const { return &mCommandManager; }
// Keyboard capture // Keyboard capture
static bool HasKeyboardCapture(const wxWindow *handler); static bool HasKeyboardCapture(const wxWindow *handler);
@ -460,6 +464,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
SpectralSelectionBar *GetSpectralSelectionBar(); SpectralSelectionBar *GetSpectralSelectionBar();
#endif #endif
ToolsToolBar *GetToolsToolBar(); ToolsToolBar *GetToolsToolBar();
const ToolsToolBar *GetToolsToolBar() const;
TranscriptionToolBar *GetTranscriptionToolBar(); TranscriptionToolBar *GetTranscriptionToolBar();
Meter *GetPlaybackMeter(); Meter *GetPlaybackMeter();
@ -506,7 +511,7 @@ public:
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) /* not override */; void WriteXML(XMLWriter &xmlFile) /* not override */;
void WriteXMLHeader(XMLWriter &xmlFile); void WriteXMLHeader(XMLWriter &xmlFile) const;
PlayMode mLastPlayMode{ PlayMode::normalPlay }; PlayMode mLastPlayMode{ PlayMode::normalPlay };
ViewInfo mViewInfo; ViewInfo mViewInfo;
@ -543,8 +548,8 @@ public:
void DeleteCurrentAutoSaveFile(); void DeleteCurrentAutoSaveFile();
public: public:
bool IsSoloSimple() { return mSoloPref == wxT("Simple"); } bool IsSoloSimple() const { return mSoloPref == wxT("Simple"); }
bool IsSoloNone() { return mSoloPref == wxT("None"); } bool IsSoloNone() const { return mSoloPref == wxT("None"); }
private: private:

View File

@ -1024,7 +1024,7 @@ XMLTagHandler *Sequence::HandleXMLChild(const wxChar *tag)
} }
// Throws exceptions rather than reporting errors. // Throws exceptions rather than reporting errors.
void Sequence::WriteXML(XMLWriter &xmlFile) void Sequence::WriteXML(XMLWriter &xmlFile) const
{ {
unsigned int b; unsigned int b;
@ -1035,7 +1035,7 @@ void Sequence::WriteXML(XMLWriter &xmlFile)
xmlFile.WriteAttr(wxT("numsamples"), mNumSamples.as_long_long() ); xmlFile.WriteAttr(wxT("numsamples"), mNumSamples.as_long_long() );
for (b = 0; b < mBlock.size(); b++) { for (b = 0; b < mBlock.size(); b++) {
SeqBlock &bb = mBlock[b]; const SeqBlock &bb = mBlock[b];
// See http://bugzilla.audacityteam.org/show_bug.cgi?id=451. // See http://bugzilla.audacityteam.org/show_bug.cgi?id=451.
// Also, don't check against mMaxSamples for AliasBlockFiles, because if you convert sample format, // Also, don't check against mMaxSamples for AliasBlockFiles, because if you convert sample format,

View File

@ -136,7 +136,7 @@ class PROFILE_DLL_API Sequence final : public XMLTagHandler{
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
void HandleXMLEndTag(const wxChar *tag) override; void HandleXMLEndTag(const wxChar *tag) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) /* not override */; void WriteXML(XMLWriter &xmlFile) const /* not override */;
bool GetErrorOpening() { return mErrorOpening; } bool GetErrorOpening() { return mErrorOpening; }

View File

@ -550,7 +550,7 @@ XMLTagHandler *Tags::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void Tags::WriteXML(XMLWriter &xmlFile) void Tags::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("tags")); xmlFile.StartTag(wxT("tags"));

View File

@ -87,7 +87,7 @@ class AUDACITY_DLL_API Tags final : public XMLTagHandler {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) /* not override */; void WriteXML(XMLWriter &xmlFile) const /* not override */;
void AllowEditTitle(bool editTitle); void AllowEditTitle(bool editTitle);
void AllowEditTrackNumber(bool editTrackNumber); void AllowEditTrackNumber(bool editTrackNumber);

View File

@ -206,7 +206,7 @@ XMLTagHandler *TimeTrack::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void TimeTrack::WriteXML(XMLWriter &xmlFile) void TimeTrack::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("timetrack")); xmlFile.StartTag(wxT("timetrack"));

View File

@ -57,7 +57,7 @@ class TimeTrack final : public Track {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
void HandleXMLEndTag(const wxChar *tag) override; void HandleXMLEndTag(const wxChar *tag) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) override; void WriteXML(XMLWriter &xmlFile) const override;
// Lock and unlock the track: you must lock the track before // Lock and unlock the track: you must lock the track before
// doing a copy and paste between projects. // doing a copy and paste between projects.

View File

@ -106,7 +106,7 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
// This just returns a constant and can be overriden by subclasses // This just returns a constant and can be overriden by subclasses
// to specify a different height for the case that the track is minimized. // to specify a different height for the case that the track is minimized.
virtual int GetMinimizedHeight() const; virtual int GetMinimizedHeight() const;
int GetActualHeight() { return mHeight; }; int GetActualHeight() const { return mHeight; }
int GetIndex() const; int GetIndex() const;
void SetIndex(int index); void SetIndex(int index);
@ -124,7 +124,7 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
bool GetMinimized() const; bool GetMinimized() const;
void SetMinimized(bool isMinimized); void SetMinimized(bool isMinimized);
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
float GetVirtualTrackPercentage() { return mPerY;} float GetVirtualTrackPercentage() const { return mPerY;}
void SetVirtualTrackPercentage(float val) { mPerY = val;} void SetVirtualTrackPercentage(float val) { mPerY = val;}
bool GetVirtualStereo() { return mVirtualStereo;} bool GetVirtualStereo() { return mVirtualStereo;}
void SetVirtualStereo(bool vStereo) { mVirtualStereo = vStereo;} void SetVirtualStereo(bool vStereo) { mVirtualStereo = vStereo;}
@ -234,7 +234,7 @@ class AUDACITY_DLL_API Track /* not final */ : public XMLTagHandler
virtual int GetKind() const { return None; } virtual int GetKind() const { return None; }
// XMLTagHandler callback methods -- NEW virtual for writing // XMLTagHandler callback methods -- NEW virtual for writing
virtual void WriteXML(XMLWriter &xmlFile) = 0; virtual void WriteXML(XMLWriter &xmlFile) const = 0;
// Returns true if an error was encountered while trying to // Returns true if an error was encountered while trying to
// open the track from XML // open the track from XML
@ -544,7 +544,7 @@ class AUDACITY_DLL_API TrackFactory
public: public:
// These methods are defined in WaveTrack.cpp, NoteTrack.cpp, // These methods are defined in WaveTrack.cpp, NoteTrack.cpp,
// LabelTrack.cpp, and TimeTrack.cpp respectively // LabelTrack.cpp, and TimeTrack.cpp respectively
std::unique_ptr<WaveTrack> DuplicateWaveTrack(WaveTrack &orig); std::unique_ptr<WaveTrack> DuplicateWaveTrack(const WaveTrack &orig);
std::unique_ptr<WaveTrack> NewWaveTrack(sampleFormat format = (sampleFormat)0, std::unique_ptr<WaveTrack> NewWaveTrack(sampleFormat format = (sampleFormat)0,
double rate = 0); double rate = 0);
std::unique_ptr<LabelTrack> NewLabelTrack(); std::unique_ptr<LabelTrack> NewLabelTrack();

View File

@ -1363,7 +1363,7 @@ bool TrackPanel::SetCursorByActivity( )
return false; return false;
} }
bool TrackPanel::SetCursorForCutline(WaveTrack * track, wxRect &rect, const wxMouseEvent &event) bool TrackPanel::SetCursorForCutline(WaveTrack * track, const wxRect &rect, const wxMouseEvent &event)
{ {
if (IsOverCutline(track, rect, event)) { if (IsOverCutline(track, rect, event)) {
bool unsafe = IsUnsafe(); bool unsafe = IsUnsafe();
@ -1550,7 +1550,7 @@ void TrackPanel::HandleCenterFrequencyClick
// we hover over, most notably when hovering over the selction boundaries. // we hover over, most notably when hovering over the selction boundaries.
// Determine and set the cursor and tip accordingly. // Determine and set the cursor and tip accordingly.
void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t, void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t,
const wxMouseEvent & event, wxRect &rect, bool bMultiToolMode, const wxMouseEvent & event, const wxRect &rect, bool bMultiToolMode,
wxString &tip, const wxCursor ** ppCursor ) wxString &tip, const wxCursor ** ppCursor )
{ {
// Do not set the default cursor here and re-set later, that causes // Do not set the default cursor here and re-set later, that causes
@ -6234,7 +6234,7 @@ namespace {
} }
} }
bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect, wxMouseEvent &event) bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, const wxRect &rect, wxMouseEvent &event)
{ {
// FIXME: Disable this and return true when CutLines aren't showing? // FIXME: Disable this and return true when CutLines aren't showing?
// (Don't use gPrefs-> for the fix as registry access is slow). // (Don't use gPrefs-> for the fix as registry access is slow).
@ -6355,7 +6355,7 @@ bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect,
return false; return false;
} }
bool TrackPanel::IsOverCutline(WaveTrack * track, wxRect &rect, const wxMouseEvent &event) bool TrackPanel::IsOverCutline(WaveTrack * track, const wxRect &rect, const wxMouseEvent &event)
{ {
for (auto loc: track->GetCachedLocations()) for (auto loc: track->GetCachedLocations())
{ {
@ -6381,7 +6381,7 @@ bool TrackPanel::IsOverCutline(WaveTrack * track, wxRect &rect, const wxMouseEve
/// Event has happened on a track and it has been determined to be a label track. /// Event has happened on a track and it has been determined to be a label track.
bool TrackPanel::HandleLabelTrackClick(LabelTrack * lTrack, wxRect &rect, wxMouseEvent & event) bool TrackPanel::HandleLabelTrackClick(LabelTrack * lTrack, const wxRect &rect, wxMouseEvent & event)
{ {
if (!event.ButtonDown()) if (!event.ButtonDown())
return false; return false;
@ -6708,7 +6708,7 @@ int TrackPanel::DetermineToolToUse( ToolsToolBar * pTtb, const wxMouseEvent & ev
#ifdef USE_MIDI #ifdef USE_MIDI
bool TrackPanel::HitTestStretch(Track *track, wxRect &rect, const wxMouseEvent & event) bool TrackPanel::HitTestStretch(Track *track, const wxRect &rect, const wxMouseEvent & event)
{ {
// later, we may want a different policy, but for now, stretch is // later, we may want a different policy, but for now, stretch is
// selected when the cursor is near the center of the track and // selected when the cursor is near the center of the track and
@ -6732,7 +6732,7 @@ bool TrackPanel::HitTestStretch(Track *track, wxRect &rect, const wxMouseEvent &
/// method that tells us if the mouse event landed on an /// method that tells us if the mouse event landed on an
/// envelope boundary. /// envelope boundary.
bool TrackPanel::HitTestEnvelope(Track *track, wxRect &rect, const wxMouseEvent & event) bool TrackPanel::HitTestEnvelope(Track *track, const wxRect &rect, const wxMouseEvent & event)
{ {
wxASSERT(track); wxASSERT(track);
if( track->GetKind() != Track::Wave ) if( track->GetKind() != Track::Wave )
@ -6800,7 +6800,7 @@ bool TrackPanel::HitTestEnvelope(Track *track, wxRect &rect, const wxMouseEvent
/// method that tells us if the mouse event landed on an /// method that tells us if the mouse event landed on an
/// editable sample /// editable sample
bool TrackPanel::HitTestSamples(Track *track, wxRect &rect, const wxMouseEvent & event) bool TrackPanel::HitTestSamples(Track *track, const wxRect &rect, const wxMouseEvent & event)
{ {
wxASSERT(track); wxASSERT(track);
if( track->GetKind() != Track::Wave ) if( track->GetKind() != Track::Wave )
@ -6851,7 +6851,7 @@ bool TrackPanel::HitTestSamples(Track *track, wxRect &rect, const wxMouseEvent &
/// method that tells us if the mouse event landed on a /// method that tells us if the mouse event landed on a
/// time-slider that allows us to time shift the sequence. /// time-slider that allows us to time shift the sequence.
bool TrackPanel::HitTestSlide(Track * WXUNUSED(track), wxRect &rect, const wxMouseEvent & event) bool TrackPanel::HitTestSlide(Track * WXUNUSED(track), const wxRect &rect, const wxMouseEvent & event)
{ {
// Perhaps we should delegate this to TrackArtist as only TrackArtist // Perhaps we should delegate this to TrackArtist as only TrackArtist
// knows what the real sizes are?? // knows what the real sizes are??
@ -7339,7 +7339,7 @@ void TrackPanel::UpdateVRuler(Track *t)
UpdateVRulerSize(); UpdateVRulerSize();
} }
void TrackPanel::UpdateTrackVRuler(Track *t) void TrackPanel::UpdateTrackVRuler(const Track *t)
{ {
wxASSERT(t); wxASSERT(t);
if (!t) if (!t)
@ -7351,7 +7351,7 @@ void TrackPanel::UpdateTrackVRuler(Track *t)
t->GetHeight() - (kTopMargin + kBottomMargin)); t->GetHeight() - (kTopMargin + kBottomMargin));
mTrackArtist->UpdateVRuler(t, rect); mTrackArtist->UpdateVRuler(t, rect);
Track *l = t->GetLink(); const Track *l = t->GetLink();
if (l) if (l)
{ {
rect.height = l->GetHeight() - (kTopMargin + kBottomMargin); rect.height = l->GetHeight() - (kTopMargin + kBottomMargin);

View File

@ -224,7 +224,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
virtual void UpdateVRulers(); virtual void UpdateVRulers();
virtual void UpdateVRuler(Track *t); virtual void UpdateVRuler(Track *t);
virtual void UpdateTrackVRuler(Track *t); virtual void UpdateTrackVRuler(const Track *t);
virtual void UpdateVRulerSize(); virtual void UpdateVRulerSize();
// Returns the time corresponding to the pixel column one past the track area // Returns the time corresponding to the pixel column one past the track area
@ -247,20 +247,20 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
virtual bool IsAudioActive(); virtual bool IsAudioActive();
virtual bool IsUnsafe(); virtual bool IsUnsafe();
virtual bool HandleLabelTrackClick(LabelTrack * lTrack, wxRect &rect, wxMouseEvent & event); virtual bool HandleLabelTrackClick(LabelTrack * lTrack, const wxRect &rect, wxMouseEvent & event);
virtual void HandleGlyphDragRelease(LabelTrack * lTrack, wxMouseEvent & event); virtual void HandleGlyphDragRelease(LabelTrack * lTrack, wxMouseEvent & event);
virtual void HandleTextDragRelease(LabelTrack * lTrack, wxMouseEvent & event); virtual void HandleTextDragRelease(LabelTrack * lTrack, wxMouseEvent & event);
virtual bool HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &rect, wxMouseEvent &event); virtual bool HandleTrackLocationMouseEvent(WaveTrack * track, const wxRect &rect, wxMouseEvent &event);
virtual bool IsOverCutline(WaveTrack * track, wxRect &rect, const wxMouseEvent &event); virtual bool IsOverCutline(WaveTrack * track, const wxRect &rect, const wxMouseEvent &event);
virtual void HandleTrackSpecificMouseEvent(wxMouseEvent & event); virtual void HandleTrackSpecificMouseEvent(wxMouseEvent & event);
virtual void ScrollDuringDrag(); virtual void ScrollDuringDrag();
// Working out where to dispatch the event to. // Working out where to dispatch the event to.
virtual int DetermineToolToUse( ToolsToolBar * pTtb, const wxMouseEvent & event); virtual int DetermineToolToUse( ToolsToolBar * pTtb, const wxMouseEvent & event);
virtual bool HitTestEnvelope(Track *track, wxRect &rect, const wxMouseEvent & event); virtual bool HitTestEnvelope(Track *track, const wxRect &rect, const wxMouseEvent & event);
virtual bool HitTestSamples(Track *track, wxRect &rect, const wxMouseEvent & event); virtual bool HitTestSamples(Track *track, const wxRect &rect, const wxMouseEvent & event);
virtual bool HitTestSlide(Track *track, wxRect &rect, const wxMouseEvent & event); virtual bool HitTestSlide(Track *track, const wxRect &rect, const wxMouseEvent & event);
#ifdef USE_MIDI #ifdef USE_MIDI
// data for NoteTrack interactive stretch operations: // data for NoteTrack interactive stretch operations:
// Stretching applies to a selected region after quantizing the // Stretching applies to a selected region after quantizing the
@ -285,7 +285,7 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
double mStretchSel1; // initial sel1 (left) quantized to nearest beat double mStretchSel1; // initial sel1 (left) quantized to nearest beat
double mStretchLeftBeats; // how many beats from left to cursor double mStretchLeftBeats; // how many beats from left to cursor
double mStretchRightBeats; // how many beats from cursor to right double mStretchRightBeats; // how many beats from cursor to right
virtual bool HitTestStretch(Track *track, wxRect &rect, const wxMouseEvent & event); virtual bool HitTestStretch(Track *track, const wxRect &rect, const wxMouseEvent & event);
virtual void Stretch(int mouseXCoordinate, int trackLeftEdge, Track *pTrack); virtual void Stretch(int mouseXCoordinate, int trackLeftEdge, Track *pTrack);
#endif #endif
@ -332,12 +332,12 @@ protected:
// AS: Cursor handling // AS: Cursor handling
virtual bool SetCursorByActivity( ); virtual bool SetCursorByActivity( );
virtual bool SetCursorForCutline(WaveTrack * track, wxRect &rect, const wxMouseEvent &event); virtual bool SetCursorForCutline(WaveTrack * track, const wxRect &rect, const wxMouseEvent &event);
virtual void SetCursorAndTipWhenInLabel( Track * t, const wxMouseEvent &event, wxString &tip ); virtual void SetCursorAndTipWhenInLabel( Track * t, const wxMouseEvent &event, wxString &tip );
virtual void SetCursorAndTipWhenInVResizeArea( bool blinked, wxString &tip ); virtual void SetCursorAndTipWhenInVResizeArea( bool blinked, wxString &tip );
virtual void SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT, const wxMouseEvent & event, wxString &tip ); virtual void SetCursorAndTipWhenInLabelTrack( LabelTrack * pLT, const wxMouseEvent & event, wxString &tip );
virtual void SetCursorAndTipWhenSelectTool virtual void SetCursorAndTipWhenSelectTool
( Track * t, const wxMouseEvent & event, wxRect &rect, bool bMultiToolMode, wxString &tip, const wxCursor ** ppCursor ); ( Track * t, const wxMouseEvent & event, const wxRect &rect, bool bMultiToolMode, wxString &tip, const wxCursor ** ppCursor );
virtual void SetCursorAndTipByTool( int tool, const wxMouseEvent & event, wxString &tip ); virtual void SetCursorAndTipByTool( int tool, const wxMouseEvent & event, wxString &tip );
public: public:
@ -540,6 +540,7 @@ protected:
TrackInfo mTrackInfo; TrackInfo mTrackInfo;
public: public:
TrackInfo *GetTrackInfo() { return &mTrackInfo; } TrackInfo *GetTrackInfo() { return &mTrackInfo; }
const TrackInfo *GetTrackInfo() const { return &mTrackInfo; }
protected: protected:
TrackPanelListener *mListener; TrackPanelListener *mListener;

View File

@ -161,7 +161,7 @@ void ViewInfo::SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth, do
beforeWidth / zoom)); beforeWidth / zoom));
} }
void ViewInfo::WriteXMLAttributes(XMLWriter &xmlFile) void ViewInfo::WriteXMLAttributes(XMLWriter &xmlFile) const
{ {
selectedRegion.WriteXMLAttributes(xmlFile, wxT("sel0"), wxT("sel1")); selectedRegion.WriteXMLAttributes(xmlFile, wxT("sel0"), wxT("sel1"));
xmlFile.WriteAttr(wxT("vpos"), vpos); xmlFile.WriteAttr(wxT("vpos"), vpos);

View File

@ -185,7 +185,7 @@ public:
// various other drawing code can use the exact same value. // various other drawing code can use the exact same value.
double mRecentStreamTime; double mRecentStreamTime;
void WriteXMLAttributes(XMLWriter &xmlFile); void WriteXMLAttributes(XMLWriter &xmlFile) const;
bool ReadXMLAttribute(const wxChar *attr, const wxChar *value); bool ReadXMLAttribute(const wxChar *attr, const wxChar *value);
// Receive track panel timer notifications // Receive track panel timer notifications

View File

@ -1452,7 +1452,7 @@ XMLTagHandler *WaveClip::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void WaveClip::WriteXML(XMLWriter &xmlFile) void WaveClip::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("waveclip")); xmlFile.StartTag(wxT("waveclip"));
xmlFile.WriteAttr(wxT("offset"), mOffset, 8); xmlFile.WriteAttr(wxT("offset"), mOffset, 8);

View File

@ -366,7 +366,7 @@ public:
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
void HandleXMLEndTag(const wxChar *tag) override; void HandleXMLEndTag(const wxChar *tag) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) /* not override */; void WriteXML(XMLWriter &xmlFile) const /* not override */;
// Cache of values to colour pixels of Spectrogram - used by TrackArtist // Cache of values to colour pixels of Spectrogram - used by TrackArtist
mutable std::unique_ptr<SpecPxCache> mSpecPxCache; mutable std::unique_ptr<SpecPxCache> mSpecPxCache;

View File

@ -63,7 +63,7 @@ using std::max;
bool WaveTrack::mMonoAsVirtualStereo; bool WaveTrack::mMonoAsVirtualStereo;
#endif #endif
WaveTrack::Holder TrackFactory::DuplicateWaveTrack(WaveTrack &orig) WaveTrack::Holder TrackFactory::DuplicateWaveTrack(const WaveTrack &orig)
{ {
return std::unique_ptr<WaveTrack> return std::unique_ptr<WaveTrack>
{ static_cast<WaveTrack*>(orig.Duplicate().release()) }; { static_cast<WaveTrack*>(orig.Duplicate().release()) };
@ -507,7 +507,7 @@ bool WaveTrack::ConvertToSampleFormat(sampleFormat format)
return true; return true;
} }
bool WaveTrack::IsEmpty(double t0, double t1) bool WaveTrack::IsEmpty(double t0, double t1) const
{ {
//printf("Searching for overlap in %.6f...%.6f\n", t0, t1); //printf("Searching for overlap in %.6f...%.6f\n", t0, t1);
for (const auto &clip : mClips) for (const auto &clip : mClips)
@ -1592,7 +1592,7 @@ bool WaveTrack::AppendCoded(const wxString &fName, sampleCount start,
} }
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.
unsigned int WaveTrack::GetODFlags() unsigned int WaveTrack::GetODFlags() const
{ {
unsigned int ret = 0; unsigned int ret = 0;
for (const auto &clip : mClips) for (const auto &clip : mClips)
@ -1789,7 +1789,7 @@ XMLTagHandler *WaveTrack::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void WaveTrack::WriteXML(XMLWriter &xmlFile) void WaveTrack::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("wavetrack")); xmlFile.StartTag(wxT("wavetrack"));
if (mAutoSaveIdent) if (mAutoSaveIdent)
@ -1958,7 +1958,7 @@ bool WaveTrack::GetMinMax(float *min, float *max,
return result; return result;
} }
bool WaveTrack::GetRMS(float *rms, double t0, double t1) bool WaveTrack::GetRMS(float *rms, double t0, double t1) const
{ {
*rms = float(0.0); *rms = float(0.0);

View File

@ -149,7 +149,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
void SetVirtualState(bool state, bool half=false); void SetVirtualState(bool state, bool half=false);
#endif #endif
sampleFormat GetSampleFormat() { return mFormat; } sampleFormat GetSampleFormat() const { return mFormat; }
bool ConvertToSampleFormat(sampleFormat format); bool ConvertToSampleFormat(sampleFormat format);
const SpectrogramSettings &GetSpectrogramSettings() const; const SpectrogramSettings &GetSpectrogramSettings() const;
@ -201,7 +201,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
* @return true if no clips in the track overlap the specified time range, * @return true if no clips in the track overlap the specified time range,
* false otherwise. * false otherwise.
*/ */
bool IsEmpty(double t0, double t1); bool IsEmpty(double t0, double t1) const;
/** @brief Append the sample data to the WaveTrack. You must call Flush() /** @brief Append the sample data to the WaveTrack. You must call Flush()
* after the last Append. * after the last Append.
@ -227,7 +227,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
size_t len, int channel, int decodeType); size_t len, int channel, int decodeType);
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.
unsigned int GetODFlags(); unsigned int GetODFlags() const;
///Invalidates all clips' wavecaches. Careful, This may not be threadsafe. ///Invalidates all clips' wavecaches. Careful, This may not be threadsafe.
void ClearWaveCaches(); void ClearWaveCaches();
@ -253,7 +253,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
double t0) const; double t0) const;
bool GetMinMax(float *min, float *max, bool GetMinMax(float *min, float *max,
double t0, double t1) const; double t0, double t1) const;
bool GetRMS(float *rms, double t0, double t1); bool GetRMS(float *rms, double t0, double t1) const;
// //
// MM: We now have more than one sequence and envelope per track, so // MM: We now have more than one sequence and envelope per track, so
@ -288,7 +288,7 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override; bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
void HandleXMLEndTag(const wxChar *tag) override; void HandleXMLEndTag(const wxChar *tag) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override; XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile) override; void WriteXML(XMLWriter &xmlFile) const override;
// Returns true if an error occurred while reading from XML // Returns true if an error occurred while reading from XML
bool GetErrorOpening() override; bool GetErrorOpening() override;

View File

@ -1359,9 +1359,11 @@ wxString CommandManager::GetCategoryFromName(const wxString &name)
return entry->labelTop; return entry->labelTop;
} }
wxString CommandManager::GetKeyFromName(const wxString &name) wxString CommandManager::GetKeyFromName(const wxString &name) const
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry =
// May create a NULL entry
const_cast<CommandManager*>(this)->mCommandNameHash[name];
if (!entry) if (!entry)
return wxT(""); return wxT("");
@ -1426,7 +1428,7 @@ XMLTagHandler *CommandManager::HandleXMLChild(const wxChar * WXUNUSED(tag))
return this; return this;
} }
void CommandManager::WriteXML(XMLWriter &xmlFile) void CommandManager::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("audacitykeyboard")); xmlFile.StartTag(wxT("audacitykeyboard"));
xmlFile.WriteAttr(wxT("audacityversion"), AUDACITY_VERSION_STRING); xmlFile.WriteAttr(wxT("audacityversion"), AUDACITY_VERSION_STRING);

View File

@ -241,7 +241,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
wxString GetLabelFromName(const wxString &name); wxString GetLabelFromName(const wxString &name);
wxString GetPrefixedLabelFromName(const wxString &name); wxString GetPrefixedLabelFromName(const wxString &name);
wxString GetCategoryFromName(const wxString &name); wxString GetCategoryFromName(const wxString &name);
wxString GetKeyFromName(const wxString &name); wxString GetKeyFromName(const wxString &name) const;
wxString GetDefaultKeyFromName(const wxString &name); wxString GetDefaultKeyFromName(const wxString &name);
bool GetEnabled(const wxString &name); bool GetEnabled(const wxString &name);
@ -254,7 +254,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
// Loading/Saving // Loading/Saving
// //
void WriteXML(XMLWriter &xmlFile) /* not override */; void WriteXML(XMLWriter &xmlFile) const /* not override */;
protected: protected:

View File

@ -34,8 +34,8 @@ class CompareAudioCommand final : public CommandImplementation
{ {
private: private:
double mT0, mT1; double mT0, mT1;
WaveTrack *mTrack0; const WaveTrack *mTrack0;
WaveTrack *mTrack1; const WaveTrack *mTrack1;
// Update member variables with project selection data (and validate) // Update member variables with project selection data (and validate)
bool GetSelection(AudacityProject &proj); bool GetSelection(AudacityProject &proj);

View File

@ -1999,7 +1999,8 @@ bool Effect::TrackGroupProgress(int whichGroup, double frac, const wxString &msg
return (updateResult != eProgressSuccess); return (updateResult != eProgressSuccess);
} }
void Effect::GetSamples(WaveTrack *track, sampleCount *start, sampleCount *len) void Effect::GetSamples(
const WaveTrack *track, sampleCount *start, sampleCount *len)
{ {
double trackStart = track->GetStartTime(); double trackStart = track->GetStartTime();
double trackEnd = track->GetEndTime(); double trackEnd = track->GetEndTime();

View File

@ -324,7 +324,8 @@ protected:
int GetNumWaveGroups() { return mNumGroups; } int GetNumWaveGroups() { return mNumGroups; }
// Calculates the start time and selection length in samples // Calculates the start time and selection length in samples
void GetSamples(WaveTrack *track, sampleCount *start, sampleCount *len); void GetSamples(
const WaveTrack *track, sampleCount *start, sampleCount *len);
void SetTimeWarper(std::unique_ptr<TimeWarper> &&warper); void SetTimeWarper(std::unique_ptr<TimeWarper> &&warper);
TimeWarper *GetTimeWarper(); TimeWarper *GetTimeWarper();

View File

@ -2071,7 +2071,7 @@ XMLTagHandler *EffectEqualization::HandleXMLChild(const wxChar *tag)
// //
// Write all of the curves to the XML file // Write all of the curves to the XML file
// //
void EffectEqualization::WriteXML(XMLWriter &xmlFile) void EffectEqualization::WriteXML(XMLWriter &xmlFile) const
{ {
// Start our heirarchy // Start our heirarchy
xmlFile.StartTag( wxT( "equalizationeffect" ) ); xmlFile.StartTag( wxT( "equalizationeffect" ) );

View File

@ -152,9 +152,9 @@ private:
bool GetDefaultFileName(wxFileName &fileName); bool GetDefaultFileName(wxFileName &fileName);
// XMLTagHandler callback methods for loading and saving // XMLTagHandler callback methods for loading and saving
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag); XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXML(XMLWriter &xmlFile); void WriteXML(XMLWriter &xmlFile) const;
void UpdateCurves(); void UpdateCurves();
void UpdateDraw(); void UpdateDraw();

View File

@ -333,7 +333,7 @@ bool EffectNormalize::TransferDataFromWindow()
// EffectNormalize implementation // EffectNormalize implementation
void EffectNormalize::AnalyseTrack(WaveTrack * track, const wxString &msg) void EffectNormalize::AnalyseTrack(const WaveTrack * track, const wxString &msg)
{ {
if(mGain) { if(mGain) {
// Since we need complete summary data, we need to block until the OD tasks are done for this track // Since we need complete summary data, we need to block until the OD tasks are done for this track
@ -361,7 +361,7 @@ void EffectNormalize::AnalyseTrack(WaveTrack * track, const wxString &msg)
//AnalyseDC() takes a track, transforms it to bunch of buffer-blocks, //AnalyseDC() takes a track, transforms it to bunch of buffer-blocks,
//and executes AnalyzeData on it... //and executes AnalyzeData on it...
// sets mOffset // sets mOffset
bool EffectNormalize::AnalyseDC(WaveTrack * track, const wxString &msg) bool EffectNormalize::AnalyseDC(const WaveTrack * track, const wxString &msg)
{ {
bool rc = true; bool rc = true;

View File

@ -57,9 +57,9 @@ private:
// EffectNormalize implementation // EffectNormalize implementation
bool ProcessOne(WaveTrack * t, const wxString &msg); bool ProcessOne(WaveTrack * t, const wxString &msg);
void AnalyseTrack(WaveTrack * track, const wxString &msg); void AnalyseTrack(const WaveTrack * track, const wxString &msg);
void AnalyzeData(float *buffer, size_t len); void AnalyzeData(float *buffer, size_t len);
bool AnalyseDC(WaveTrack * track, const wxString &msg); bool AnalyseDC(const WaveTrack * track, const wxString &msg);
void ProcessData(float *buffer, size_t len); void ProcessData(float *buffer, size_t len);
void OnUpdateUI(wxCommandEvent & evt); void OnUpdateUI(wxCommandEvent & evt);

View File

@ -45,7 +45,7 @@ public:
protected: protected:
// Generator implementation // Generator implementation
bool GenerateTrack(WaveTrack *tmp, const WaveTrack &track, int ntrack); bool GenerateTrack(WaveTrack *tmp, const WaveTrack &track, int ntrack) override;
private: private:
NumericTextCtrl *mDurationT; NumericTextCtrl *mDurationT;

View File

@ -535,7 +535,7 @@ bool EffectTruncSilence::DoRemoval
bool EffectTruncSilence::Analyze(RegionList& silenceList, bool EffectTruncSilence::Analyze(RegionList& silenceList,
RegionList& trackSilences, RegionList& trackSilences,
WaveTrack* wt, const WaveTrack *wt,
sampleCount* silentFrame, sampleCount* silentFrame,
sampleCount* index, sampleCount* index,
int whichTrack, int whichTrack,

View File

@ -63,7 +63,7 @@ public:
// amount of input for previewing. // amount of input for previewing.
bool Analyze(RegionList &silenceList, bool Analyze(RegionList &silenceList,
RegionList &trackSilences, RegionList &trackSilences,
WaveTrack* wt, const WaveTrack *wt,
sampleCount* silentFrame, sampleCount* silentFrame,
sampleCount* index, sampleCount* index,
int whichTrack, int whichTrack,

View File

@ -78,7 +78,7 @@ protected:
private: private:
bool ProcessOne(WaveTrack * t, bool ProcessOne(WaveTrack * t,
sampleCount start, sampleCount end); sampleCount start, sampleCount end);
bool ProcessPass(); bool ProcessPass() override;
}; };
#endif #endif

View File

@ -827,7 +827,7 @@ XMLTagHandler *FFmpegPresets::HandleXMLChild(const wxChar *tag)
return NULL; return NULL;
} }
void FFmpegPresets::WriteXMLHeader(XMLWriter &xmlFile) void FFmpegPresets::WriteXMLHeader(XMLWriter &xmlFile) const
{ {
xmlFile.Write(wxT("<?xml ")); xmlFile.Write(wxT("<?xml "));
xmlFile.Write(wxT("version=\"1.0\" ")); xmlFile.Write(wxT("version=\"1.0\" "));
@ -846,14 +846,14 @@ void FFmpegPresets::WriteXMLHeader(XMLWriter &xmlFile)
xmlFile.Write(wxT(">\n")); xmlFile.Write(wxT(">\n"));
} }
void FFmpegPresets::WriteXML(XMLWriter &xmlFile) void FFmpegPresets::WriteXML(XMLWriter &xmlFile) const
{ {
xmlFile.StartTag(wxT("ffmpeg_presets")); xmlFile.StartTag(wxT("ffmpeg_presets"));
xmlFile.WriteAttr(wxT("version"),wxT("1.0")); xmlFile.WriteAttr(wxT("version"),wxT("1.0"));
FFmpegPresetMap::iterator iter; FFmpegPresetMap::const_iterator iter;
for (iter = mPresets.begin(); iter != mPresets.end(); ++iter) for (iter = mPresets.begin(); iter != mPresets.end(); ++iter)
{ {
FFmpegPreset *preset = &iter->second; auto preset = &iter->second;
xmlFile.StartTag(wxT("preset")); xmlFile.StartTag(wxT("preset"));
xmlFile.WriteAttr(wxT("name"),preset->mPresetName); xmlFile.WriteAttr(wxT("name"),preset->mPresetName);
for (long i = FEFirstID + 1; i < FELastID; i++) for (long i = FEFirstID + 1; i < FELastID; i++)

View File

@ -333,10 +333,10 @@ public:
void ImportPresets(wxString &filename); void ImportPresets(wxString &filename);
void ExportPresets(wxString &filename); void ExportPresets(wxString &filename);
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag); XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
void WriteXMLHeader(XMLWriter &xmlFile); void WriteXMLHeader(XMLWriter &xmlFile) const;
void WriteXML(XMLWriter &xmlFile); void WriteXML(XMLWriter &xmlFile) const;
private: private:

View File

@ -203,7 +203,7 @@ public:
bool InitCodecs(); bool InitCodecs();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
///! Imports audio ///! Imports audio
@ -240,7 +240,7 @@ public:
///! Called by Import.cpp ///! Called by Import.cpp
///\return number of readable streams in the file ///\return number of readable streams in the file
wxInt32 GetStreamCount() wxInt32 GetStreamCount() override
{ {
return mNumStreams; return mNumStreams;
} }
@ -255,7 +255,7 @@ public:
///! Called by Import.cpp ///! Called by Import.cpp
///\param StreamID - index of the stream in mStreamInfo and mScs arrays ///\param StreamID - index of the stream in mStreamInfo and mScs arrays
///\param Use - true if this stream should be imported, false otherwise ///\param Use - true if this stream should be imported, false otherwise
void SetStreamUsage(wxInt32 StreamID, bool Use) void SetStreamUsage(wxInt32 StreamID, bool Use) override
{ {
if (StreamID < mNumStreams) if (StreamID < mNumStreams)
mScs->get()[StreamID]->m_use = Use; mScs->get()[StreamID]->m_use = Use;

View File

@ -152,12 +152,12 @@ public:
bool Init(); bool Init();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
int Import(TrackFactory *trackFactory, TrackHolders &outTracks, int Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
wxInt32 GetStreamCount(){ return 1; } wxInt32 GetStreamCount() override { return 1; }
const wxArrayString &GetStreamInfo() override const wxArrayString &GetStreamInfo() override
{ {
@ -165,7 +165,8 @@ public:
return empty; return empty;
} }
void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)){} void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)) override
{}
private: private:
sampleFormat mFormat; sampleFormat mFormat;

View File

@ -169,12 +169,12 @@ public:
///\return true if successful, false otherwise ///\return true if successful, false otherwise
bool Init(); bool Init();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
///! Called by Import.cpp ///! Called by Import.cpp
///\return number of readable audio streams in the file ///\return number of readable audio streams in the file
wxInt32 GetStreamCount(); wxInt32 GetStreamCount() override;
///! Called by Import.cpp ///! Called by Import.cpp
///\return array of strings - descriptions of the streams ///\return array of strings - descriptions of the streams
@ -183,7 +183,7 @@ public:
///! Called by Import.cpp ///! Called by Import.cpp
///\param index - index of the stream in mStreamInfo and mStreams arrays ///\param index - index of the stream in mStreamInfo and mStreams arrays
///\param use - true if this stream should be imported, false otherwise ///\param use - true if this stream should be imported, false otherwise
void SetStreamUsage(wxInt32 index, bool use); void SetStreamUsage(wxInt32 index, bool use) override;
///! Imports audio ///! Imports audio
///\return import status (see Import.cpp) ///\return import status (see Import.cpp)

View File

@ -123,12 +123,12 @@ public:
LOFImportFileHandle(const wxString & name, std::unique_ptr<wxTextFile> &&file); LOFImportFileHandle(const wxString & name, std::unique_ptr<wxTextFile> &&file);
~LOFImportFileHandle(); ~LOFImportFileHandle();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
int Import(TrackFactory *trackFactory, TrackHolders &outTracks, int Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
wxInt32 GetStreamCount(){ return 1; } wxInt32 GetStreamCount() override { return 1; }
const wxArrayString &GetStreamInfo() override const wxArrayString &GetStreamInfo() override
{ {
@ -136,7 +136,8 @@ public:
return empty; return empty;
} }
void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)){} void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)) override
{}
private: private:
// Takes a line of text in lof file and interprets it and opens files // Takes a line of text in lof file and interprets it and opens files

View File

@ -131,12 +131,12 @@ public:
~MP3ImportFileHandle(); ~MP3ImportFileHandle();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
int Import(TrackFactory *trackFactory, TrackHolders &outTracks, int Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
wxInt32 GetStreamCount(){ return 1; } wxInt32 GetStreamCount() override { return 1; }
const wxArrayString &GetStreamInfo() override const wxArrayString &GetStreamInfo() override
{ {
@ -144,7 +144,8 @@ public:
return empty; return empty;
} }
void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)){} void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)) override
{}
private: private:
void ImportID3(Tags *tags); void ImportID3(Tags *tags);

View File

@ -122,12 +122,12 @@ public:
} }
~OggImportFileHandle(); ~OggImportFileHandle();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
int Import(TrackFactory *trackFactory, TrackHolders &outTracks, int Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
wxInt32 GetStreamCount() wxInt32 GetStreamCount() override
{ {
if (mVorbisFile) if (mVorbisFile)
return mVorbisFile->links; return mVorbisFile->links;
@ -140,7 +140,7 @@ public:
return mStreamInfo; return mStreamInfo;
} }
void SetStreamUsage(wxInt32 StreamID, bool Use) void SetStreamUsage(wxInt32 StreamID, bool Use) override
{ {
if (mVorbisFile) if (mVorbisFile)
{ {

View File

@ -92,12 +92,12 @@ public:
PCMImportFileHandle(wxString name, SFFile &&file, SF_INFO info); PCMImportFileHandle(wxString name, SFFile &&file, SF_INFO info);
~PCMImportFileHandle(); ~PCMImportFileHandle();
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
int Import(TrackFactory *trackFactory, TrackHolders &outTracks, int Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
wxInt32 GetStreamCount(){ return 1; } wxInt32 GetStreamCount() override { return 1; }
const wxArrayString &GetStreamInfo() override const wxArrayString &GetStreamInfo() override
{ {
@ -105,7 +105,8 @@ public:
return empty; return empty;
} }
void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)){} void SetStreamUsage(wxInt32 WXUNUSED(StreamID), bool WXUNUSED(Use)) override
{}
private: private:
SFFile mFile; SFFile mFile;

View File

@ -139,10 +139,10 @@ class QTImportFileHandle final : public ImportFileHandle
} }
} }
wxString GetFileDescription(); wxString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
wxInt32 GetStreamCount() wxInt32 GetStreamCount() override
{ {
return 1; return 1;
} }
@ -153,7 +153,7 @@ class QTImportFileHandle final : public ImportFileHandle
return empty; return empty;
} }
void SetStreamUsage(wxInt32 StreamID, bool Use) void SetStreamUsage(wxInt32 StreamID, bool Use) override
{ {
} }

View File

@ -525,7 +525,7 @@ bool ODManager::HasLoadedODFlag()
} }
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void ODManager::FillTipForWaveTrack( WaveTrack * t, wxString &tip ) void ODManager::FillTipForWaveTrack( const WaveTrack * t, wxString &tip )
{ {
mQueuesMutex.Lock(); mQueuesMutex.Lock();
for(unsigned int i=0;i<mQueues.size();i++) for(unsigned int i=0;i<mQueues.size();i++)

View File

@ -98,7 +98,7 @@ class ODManager final
static bool IsInstanceCreated(); static bool IsInstanceCreated();
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void FillTipForWaveTrack( WaveTrack * t, wxString &tip ); void FillTipForWaveTrack( const WaveTrack * t, wxString &tip );
///Gets the total percent complete for all tasks combined. ///Gets the total percent complete for all tasks combined.
float GetOverallPercentComplete(); float GetOverallPercentComplete();

View File

@ -76,7 +76,7 @@ void ODWaveTrackTaskQueue::MergeWaveTrack(WaveTrack* track)
} }
///returns true if the argument is in the WaveTrack list. ///returns true if the argument is in the WaveTrack list.
bool ODWaveTrackTaskQueue::ContainsWaveTrack(WaveTrack* track) bool ODWaveTrackTaskQueue::ContainsWaveTrack(const WaveTrack* track)
{ {
mTracksMutex.Lock(); mTracksMutex.Lock();
for(unsigned int i=0;i<mTracks.size();i++) for(unsigned int i=0;i<mTracks.size();i++)
@ -326,7 +326,7 @@ ODTask* ODWaveTrackTaskQueue::GetFrontTask()
} }
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void ODWaveTrackTaskQueue::FillTipForWaveTrack( WaveTrack * t, wxString &tip ) void ODWaveTrackTaskQueue::FillTipForWaveTrack( const WaveTrack * t, wxString &tip )
{ {
if(ContainsWaveTrack(t) && GetNumTasks()) if(ContainsWaveTrack(t) && GetNumTasks())
{ {

View File

@ -63,7 +63,7 @@ class ODWaveTrackTaskQueue final
//returns true if the agrument is in the WaveTrack list. //returns true if the agrument is in the WaveTrack list.
bool ContainsWaveTrack(WaveTrack* track); bool ContainsWaveTrack(const WaveTrack* track);
//returns the wavetrack at position x. //returns the wavetrack at position x.
WaveTrack* GetWaveTrack(size_t x); WaveTrack* GetWaveTrack(size_t x);
@ -93,7 +93,7 @@ class ODWaveTrackTaskQueue final
ODTask* GetTask(size_t x); ODTask* GetTask(size_t x);
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void FillTipForWaveTrack( WaveTrack * t, wxString &tip ); void FillTipForWaveTrack( const WaveTrack * t, wxString &tip );
protected: protected:

View File

@ -1183,7 +1183,7 @@ void ControlToolBar::SetupCutPreviewTracks(double WXUNUSED(playStart), double cu
AudacityProject *p = GetActiveProject(); AudacityProject *p = GetActiveProject();
if (p) { if (p) {
// Find first selected track (stereo or mono) and duplicate it // Find first selected track (stereo or mono) and duplicate it
Track *track1 = NULL, *track2 = NULL; const Track *track1 = NULL, *track2 = NULL;
TrackListIterator it(p->GetTracks()); TrackListIterator it(p->GetTracks());
for (Track *t = it.First(); t; t = it.Next()) for (Track *t = it.First(); t; t = it.Next())
{ {

View File

@ -205,7 +205,7 @@ void ToolsToolBar::Populate()
/// Gets the currently active tool /// Gets the currently active tool
/// In Multi-mode this might not return the multi-tool itself /// In Multi-mode this might not return the multi-tool itself
/// since the active tool may be changed by what you hover over. /// since the active tool may be changed by what you hover over.
int ToolsToolBar::GetCurrentTool() int ToolsToolBar::GetCurrentTool() const
{ {
return mCurrentTool; return mCurrentTool;
} }
@ -247,7 +247,7 @@ void ToolsToolBar::SetCurrentTool(int tool, bool show)
} }
} }
bool ToolsToolBar::IsDown(int tool) bool ToolsToolBar::IsDown(int tool) const
{ {
return mTool[tool]->IsDown(); return mTool[tool]->IsDown();
} }
@ -263,7 +263,7 @@ int ToolsToolBar::GetDownTool()
return firstTool; // Should never happen return firstTool; // Should never happen
} }
const wxChar * ToolsToolBar::GetMessageForTool( int ToolNumber ) const wxChar * ToolsToolBar::GetMessageForTool( int ToolNumber ) const
{ {
wxASSERT( ToolNumber >= 0 ); wxASSERT( ToolNumber >= 0 );
wxASSERT( ToolNumber < numTools ); wxASSERT( ToolNumber < numTools );

View File

@ -58,11 +58,11 @@ class ToolsToolBar final : public ToolBar {
void SetCurrentTool(int tool, bool show); void SetCurrentTool(int tool, bool show);
//These interrogate the state of the buttons or controls. //These interrogate the state of the buttons or controls.
int GetCurrentTool(); int GetCurrentTool() const;
bool IsDown(int tool); bool IsDown(int tool) const;
int GetDownTool(); int GetDownTool();
const wxChar * GetMessageForTool( int ToolNumber ); const wxChar * GetMessageForTool( int ToolNumber ) const;
void Populate(); void Populate();
void Repaint(wxDC * WXUNUSED(dc)) override {}; void Repaint(wxDC * WXUNUSED(dc)) override {};