1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 06:40:08 +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

View File

@ -4113,84 +4113,84 @@ void AudacityProject::OnSplitNew()
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, FIX-ME: 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::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, FIX-ME: 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()
{

View File

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