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

Method PlayCurrentRegion

src/ProjectAudioManager.cpp:471–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471void ProjectAudioManager::PlayCurrentRegion(bool newDefault /* = false */,
472 bool cutpreview /* = false */)
473{
474 auto &projectAudioManager = *this;
475 bool canStop = projectAudioManager.CanStopAudioStream();
476
477 if ( !canStop )
478 return;
479
480 AudacityProject *p = &mProject;
481
482 {
483
484 const auto &playRegion = ViewInfo::Get( *p ).playRegion;
485
486 if (newDefault)
487 cutpreview = false;
488 auto options = ProjectAudioIO::GetDefaultOptions(*p, newDefault);
489 if (cutpreview)
490 options.envelope = nullptr;
491 auto mode =
492 cutpreview ? PlayMode::cutPreviewPlay
493 : newDefault ? PlayMode::loopedPlay
494 : PlayMode::normalPlay;
495 PlayPlayRegion(SelectedRegion(playRegion.GetStart(), playRegion.GetEnd()),
496 options,
497 mode);
498 }
499}
500
501void ProjectAudioManager::Stop(bool stopStream /* = true*/)
502{

Callers 3

OnKeyEventMethod · 0.80
PlayDefaultMethod · 0.80

Calls 3

GetFunction · 0.85
CanStopAudioStreamMethod · 0.80
SelectedRegionClass · 0.70

Tested by

no test coverage detected