1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-24 16:38:07 +02:00

Comment out unused AudacityProject::OnSplitLabelsToTracks().

This commit is contained in:
v.audacity 2011-11-30 23:56:34 +00:00
parent 1f208ea60d
commit 5c454c5a74
2 changed files with 79 additions and 79 deletions

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

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