| 469 | } |
| 470 | |
| 471 | void 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 | |
| 501 | void ProjectAudioManager::Stop(bool stopStream /* = true*/) |
| 502 | { |
no test coverage detected