1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

just some cleanups on FIXMEs and unused method parameters

This commit is contained in:
v.audacity 2013-08-31 05:57:48 +00:00
parent 884dfaa652
commit cc876ce7be
11 changed files with 18 additions and 103 deletions

View File

@ -737,7 +737,7 @@ void AudacityApp::OnMacOpenFile(wxCommandEvent & event)
while (ofqueue.GetCount()) { while (ofqueue.GetCount()) {
wxString name(ofqueue[0]); wxString name(ofqueue[0]);
ofqueue.RemoveAt(0); ofqueue.RemoveAt(0);
MRUOpen(name); // FIXME: Check the return result? wxASSERT(MRUOpen(name)); // FIXME: Check the return result? Meantime, assert it so failure shows in debug build.
} }
} }
#endif //__WXMAC__ #endif //__WXMAC__

View File

@ -856,7 +856,8 @@ wxFileName DirManager::MakeBlockFileName()
}else break; }else break;
} }
} }
// FIXME: Might we get here without midkey having been set? // FIXME: Might we get here without midkey having been set?
// Seemed like a possible problem in these changes in .aup directory hierarchy.
BalanceFileAdd(midkey); BalanceFileAdd(midkey);
return ret; return ret;
} }

View File

@ -4170,85 +4170,6 @@ void AudacityProject::OnSplitNew()
RedrawProject(); RedrawProject();
} }
//void AudacityProject::OnSplitLabelsToTracks()
//{
// TrackListIterator iter(mTracks);
//
// Track *n = iter.First();
// Track *srcRight = 0;
// Track *srcLeft = 0;
// bool stereo = false;
// LabelTrack *label = 0;
//
// while(n) {
// if(n->GetSelected()) {
// if(n->GetKind() == Track::Wave) {
// if(n->GetLinked() == true) {
// stereo = true;
// srcLeft = n;
// srcRight = iter.Next();
// }
// else {
// srcRight = n;
// stereo = false;
// }
// }
// else if(n->GetKind() == Track::Label)
// label = (LabelTrack*)n; // cast necessary to call LabelTrack specific methods
// }
// n = iter.Next();
// }
//
// wxASSERT(label); // per Vigilant Sentry report on possible null deref, FIXME: Report error or validate?
// for(int i = 0; i < label->GetNumLabels(); i++) {
// wxString name = label->GetLabel(i)->title;
// double begin = label->GetLabel(i)->t;
// double end;
//
// // if on the last label, extend to the end of the wavetrack
// if(i == label->GetNumLabels() - 1) {
// if(stereo)
// end = wxMax(srcLeft->GetEndTime(), srcRight->GetEndTime());
// else
// end = srcLeft->GetEndTime();
// }
// else
// end = label->GetLabel(i+1)->t;
//
// Track *destLeft = 0;
// Track *destRight = 0;
//
// srcLeft->Copy(begin, end, &destLeft);
// if (destLeft) {
// destLeft->Init(*srcLeft);
// destLeft->SetOffset(wxMax(begin, srcLeft->GetOffset()));
// destLeft->SetName(name);
//
// mTracks->Add(destLeft);
// }
//
// if(stereo) {
// srcRight->Copy(begin, end, &destRight);
// if (destRight) {
// destRight->Init(*srcRight);
// destRight->SetOffset(wxMax(begin, srcRight->GetOffset()));
// destRight->SetName(name);
//
// mTracks->Add(destRight);
// }
// else if(destLeft)
// // account for possibility of a non-aligned linked track, which could
// // cause the left channel to be eligible for creating a new track,
// // but not the right.
// destLeft->SetLinked(false);
// }
// }
//
// PushState(_("Split at labels"), _("Split at Labels"));
//
// RedrawProject();
//}
void AudacityProject::OnSelectAll() void AudacityProject::OnSelectAll()
{ {
TrackListIterator iter(mTracks); TrackListIterator iter(mTracks);

View File

@ -225,7 +225,6 @@ void OnSilence();
void OnSplit(); void OnSplit();
void OnSplitNew(); void OnSplitNew();
// void OnSplitLabelsToTracks();
void OnJoin(); void OnJoin();
void OnDisjoin(); void OnDisjoin();
void OnDuplicate(); void OnDuplicate();

View File

@ -2394,8 +2394,7 @@ void AudacityProject::OpenFile(wxString fileName, bool addtohistory)
} }
} }
//FIXME: //v Surely we could be smarter about this, //FIXME: //v Surely we could be smarter about this, like checking much earlier that this is a .aup file.
// like checking much earlier that this is a .aup file.
if (temp.Mid(0, 6) != wxT("<?xml ")) { if (temp.Mid(0, 6) != wxT("<?xml ")) {
// If it's not XML, try opening it as any other form of audio // If it's not XML, try opening it as any other form of audio
Import(fileName); Import(fileName);

View File

@ -490,8 +490,8 @@ bool Sequence::Paste(sampleCount s, const Sequence *src)
if (addedLen == 0 || srcNumBlocks == 0) if (addedLen == 0 || srcNumBlocks == 0)
return true; return true;
unsigned int b = FindBlock(s); int b = FindBlock(s);
unsigned int numBlocks = mBlock->GetCount(); size_t numBlocks = mBlock->GetCount();
if (numBlocks == 0 || if (numBlocks == 0 ||
(s == mNumSamples && mBlock->Item(numBlocks-1)->f->GetLength() >= mMinSamples)) { (s == mNumSamples && mBlock->Item(numBlocks-1)->f->GetLength() >= mMinSamples)) {
@ -505,7 +505,6 @@ bool Sequence::Paste(sampleCount s, const Sequence *src)
return ConsistencyCheck(wxT("Paste branch one")); return ConsistencyCheck(wxT("Paste branch one"));
} }
// FIXME: "b" is unsigned, so it's pointless to check that it's >= 0.
if (b >= 0 && b < numBlocks if (b >= 0 && b < numBlocks
&& ((mBlock->Item(b)->f->GetLength() + addedLen) < mMaxSamples)) { && ((mBlock->Item(b)->f->GetLength() + addedLen) < mMaxSamples)) {
// Special case: we can fit all of the new samples inside of // Special case: we can fit all of the new samples inside of

View File

@ -356,16 +356,14 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler
friend class Track; friend class Track;
friend class TrackListIterator; friend class TrackListIterator;
/// Add this Track or all children of this TrackGroup /// Add this Track or all children of this TrackList.
// FIXME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13.
void Add(Track * t); void Add(Track * t);
void AddToHead(Track * t); void AddToHead(Track * t);
/// Replace first track with second track /// Replace first track with second track
void Replace(Track * t, Track * with, bool deletetrack = false); void Replace(Track * t, Track * with, bool deletetrack = false);
/// Remove this Track or all children of this TrackGroup /// Remove this Track or all children of this TrackList.
// FIXME: What does that comment mean by "TrackGroup"? There was no such class at tag Audacity_1_3_13.
void Remove(Track * t, bool deletetrack = false); void Remove(Track * t, bool deletetrack = false);
/// Make the list empty /// Make the list empty

View File

@ -5176,7 +5176,7 @@ void TrackPanel::OnMouseEvent(wxMouseEvent & event)
bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, wxMouseEvent &event) bool TrackPanel::HandleTrackLocationMouseEvent(WaveTrack * track, wxRect &r, 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 gPerfs-> for the fix as registry access is slow). // (Don't use gPrefs-> for the fix as registry access is slow).
if (mMouseCapture == WasOverCutLine) if (mMouseCapture == WasOverCutLine)
{ {

View File

@ -94,7 +94,7 @@ void CloseContrastDialog()
float ContrastDialog::GetDB() float ContrastDialog::GetDB()
{ {
// FIXME: what if more than one track? // FIXME: what if more than one track?
float rms = float(0.0); float rms = float(0.0);
AudacityProject *p = GetActiveProject(); AudacityProject *p = GetActiveProject();

View File

@ -225,8 +225,7 @@ WaveTrack* ODWaveTrackTaskQueue::GetWaveTrack(size_t x)
{ {
WaveTrack* ret = NULL; WaveTrack* ret = NULL;
mTracksMutex.Lock(); mTracksMutex.Lock();
// FIXME: x is unsigned so there's no point in checking that it's >= 0. if (x < mTracks.size())
if(x>=0&&x<mTracks.size())
ret = mTracks[x]; ret = mTracks[x];
mTracksMutex.Unlock(); mTracksMutex.Unlock();
return ret; return ret;
@ -257,8 +256,7 @@ ODTask* ODWaveTrackTaskQueue::GetTask(size_t x)
{ {
ODTask* ret = NULL; ODTask* ret = NULL;
mTasksMutex.Lock(); mTasksMutex.Lock();
// FIXME: x is unsigned so there's no point in checking that it's >= 0. if (x < mTasks.size())
if(x>=0&&x<mTasks.size())
ret = mTasks[x]; ret = mTasks[x];
mTasksMutex.Unlock(); mTasksMutex.Unlock();
return ret; return ret;

View File

@ -1482,7 +1482,7 @@ TimeTextCtrlAx::~TimeTextCtrlAx()
// or > 0 (the action for a child). // or > 0 (the action for a child).
// Return wxACC_NOT_SUPPORTED if there is no default action for this // Return wxACC_NOT_SUPPORTED if there is no default action for this
// window (e.g. an edit control). // window (e.g. an edit control).
wxAccStatus TimeTextCtrlAx::DoDefaultAction(int childId) wxAccStatus TimeTextCtrlAx::DoDefaultAction(int WXUNUSED(childId))
{ {
return wxACC_NOT_SUPPORTED; return wxACC_NOT_SUPPORTED;
} }
@ -1516,7 +1516,7 @@ wxAccStatus TimeTextCtrlAx::GetChildCount(int *childCount)
// object, not what the object does as a result. For example, a // object, not what the object does as a result. For example, a
// toolbar button that prints a document has a default action of // toolbar button that prints a document has a default action of
// "Press" rather than "Prints the current document." // "Press" rather than "Prints the current document."
wxAccStatus TimeTextCtrlAx::GetDefaultAction(int childId, wxString *actionName) wxAccStatus TimeTextCtrlAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName)
{ {
actionName->Clear(); actionName->Clear();
@ -1524,7 +1524,7 @@ wxAccStatus TimeTextCtrlAx::GetDefaultAction(int childId, wxString *actionName)
} }
// Returns the description for this object or a child. // Returns the description for this object or a child.
wxAccStatus TimeTextCtrlAx::GetDescription(int childId, wxString *description) wxAccStatus TimeTextCtrlAx::GetDescription(int WXUNUSED(childId), wxString *description)
{ {
description->Clear(); description->Clear();
@ -1544,7 +1544,7 @@ wxAccStatus TimeTextCtrlAx::GetFocus(int *childId, wxAccessible **child)
} }
// Returns help text for this object or a child, similar to tooltip text. // Returns help text for this object or a child, similar to tooltip text.
wxAccStatus TimeTextCtrlAx::GetHelpText(int childId, wxString *helpText) wxAccStatus TimeTextCtrlAx::GetHelpText(int WXUNUSED(childId), wxString *helpText)
{ {
// removed help text, as on balance it's more of an irritation than useful // removed help text, as on balance it's more of an irritation than useful
#if 0 // was #if wxUSE_TOOLTIPS #if 0 // was #if wxUSE_TOOLTIPS
@ -1563,7 +1563,7 @@ wxAccStatus TimeTextCtrlAx::GetHelpText(int childId, wxString *helpText)
// Returns the keyboard shortcut for this object or child. // Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K // Return e.g. ALT+K
wxAccStatus TimeTextCtrlAx::GetKeyboardShortcut(int childId, wxString *shortcut) wxAccStatus TimeTextCtrlAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut)
{ {
shortcut->Clear(); shortcut->Clear();
@ -1668,7 +1668,7 @@ wxAccStatus TimeTextCtrlAx::GetName(int childId, wxString *name)
} }
// Returns a role constant. // Returns a role constant.
wxAccStatus TimeTextCtrlAx::GetRole(int childId, wxAccRole *role) wxAccStatus TimeTextCtrlAx::GetRole(int WXUNUSED(childId), wxAccRole *role)
{ {
*role = wxROLE_SYSTEM_STATICTEXT; *role = wxROLE_SYSTEM_STATICTEXT;
return wxACC_OK; return wxACC_OK;