MCPcopy Create free account
hub / github.com/audacity/audacity / OnDeleteLabels

Function OnDeleteLabels

src/menus/LabelMenus.cpp:466–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466void OnDeleteLabels(const CommandContext &context)
467{
468 auto &project = context.project;
469 auto &tracks = TrackList::Get(project);
470 auto &selectedRegion = ViewInfo::Get(project).selectedRegion;
471
472 if (selectedRegion.isPoint())
473 return;
474
475 auto editfunc = [&](Track &track, double t0, double t1) {
476 track.TypeSwitch( [&](Track &t) { t.Clear(t0, t1); } );
477 };
478 EditByLabel(project, tracks, selectedRegion, editfunc);
479
480 selectedRegion.collapseToT0();
481
482 ProjectHistory::Get(project).PushState(
483 /* i18n-hint: (verb) Audacity has just deleted the labeled audio regions*/
484 XO("Deleted labeled audio regions"),
485 /* i18n-hint: (verb)*/
486 XO("Delete Labeled Audio"));
487}
488
489void OnSplitCutLabels(const CommandContext &context)
490{

Callers

nothing calls this directly

Calls 5

GetFunction · 0.85
EditByLabelFunction · 0.85
collapseToT0Method · 0.80
ClearMethod · 0.45
PushStateMethod · 0.45

Tested by

no test coverage detected