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

Also skip TimeTrack in some other commands with the flag

This commit is contained in:
Paul Licameli 2021-02-02 14:56:52 -05:00
parent 2842fa7d56
commit 8543d2dd30
2 changed files with 18 additions and 10 deletions

View File

@ -323,6 +323,8 @@ void OnDelete(const CommandContext &context)
auto &window = ProjectWindow::Get( project );
for (auto n : tracks.Any()) {
if (!n->SupportsBasicEditing())
continue;
if (n->GetSelected() || n->IsSyncLockSelected()) {
n->Clear(selectedRegion.t0(), selectedRegion.t1());
}
@ -647,6 +649,9 @@ void OnDuplicate(const CommandContext &context)
auto range = tracks.Selected();
auto last = *range.rbegin();
for (auto n : range) {
if (!n->SupportsBasicEditing())
continue;
// Make copies not for clipboard but for direct addition to the project
auto dest = n->Copy(selectedRegion.t0(),
selectedRegion.t1(), false);
@ -687,12 +692,14 @@ void OnSplitCut(const CommandContext &context)
FinishCopy(n, dest, newClipboard);
},
[&](Track *n) {
dest = n->Copy(selectedRegion.t0(),
selectedRegion.t1());
n->Silence(selectedRegion.t0(),
if (n->SupportsBasicEditing()) {
dest = n->Copy(selectedRegion.t0(),
selectedRegion.t1());
if (dest)
FinishCopy(n, dest, newClipboard);
n->Silence(selectedRegion.t0(),
selectedRegion.t1());
if (dest)
FinishCopy(n, dest, newClipboard);
}
}
);
@ -717,8 +724,9 @@ void OnSplitDelete(const CommandContext &context)
selectedRegion.t1());
},
[&](Track *n) {
n->Silence(selectedRegion.t0(),
selectedRegion.t1());
if (n->SupportsBasicEditing())
n->Silence(selectedRegion.t0(),
selectedRegion.t1());
}
);

View File

@ -483,7 +483,7 @@ void OnSelectSyncLockSel(const CommandContext &context)
auto &tracks = TrackList::Get( project );
bool selected = false;
for (auto t : tracks.Any()
for (auto t : tracks.Any() + &Track::SupportsBasicEditing
+ &Track::IsSyncLockSelected - &Track::IsSelected) {
t->SetSelected(true);
selected = true;
@ -866,7 +866,7 @@ void OnCursorTrackStart(const CommandContext &context)
double kWayOverToRight = std::numeric_limits<double>::max();
auto trackRange = tracks.Selected();
auto trackRange = tracks.Selected() + &Track::SupportsBasicEditing;
if (trackRange.empty())
// This should have been prevented by command manager
return;
@ -892,7 +892,7 @@ void OnCursorTrackEnd(const CommandContext &context)
double kWayOverToLeft = std::numeric_limits<double>::lowest();
auto trackRange = tracks.Selected();
auto trackRange = tracks.Selected() + &Track::SupportsBasicEditing;
if (trackRange.empty())
// This should have been prevented by command manager
return;