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

Method Stop

src/ProjectAudioManager.cpp:501–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501void ProjectAudioManager::Stop(bool stopStream /* = true*/)
502{
503 AudacityProject *project = &mProject;
504 auto &projectAudioManager = *this;
505 bool canStop = projectAudioManager.CanStopAudioStream();
506
507 if ( !canStop )
508 return;
509
510 if(project) {
511 // Let scrubbing code do some appearance change
512 auto &scrubber = Scrubber::Get( *project );
513 scrubber.StopScrubbing();
514 }
515
516 auto gAudioIO = AudioIO::Get();
517
518 auto cleanup = finally( [&]{
519 projectAudioManager.SetStopping( false );
520 } );
521
522 if (stopStream && gAudioIO->IsBusy()) {
523 // flag that we are stopping
524 projectAudioManager.SetStopping( true );
525 // Allow UI to update for that
526 while( wxTheApp->ProcessIdle() )
527 ;
528 }
529
530 if(stopStream)
531 gAudioIO->StopStream();
532
533 projectAudioManager.SetLooping( false );
534 projectAudioManager.SetCutting( false );
535
536 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
537 gAudioIO->AILADisable();
538 #endif
539
540 projectAudioManager.SetPausedOff();
541 //Make sure you tell gAudioIO to unpause
542 gAudioIO->SetPaused( false );
543
544 // So that we continue monitoring after playing or recording.
545 // also clean the MeterQueues
546 if( project ) {
547 auto &projectAudioIO = ProjectAudioIO::Get( *project );
548 auto meter = projectAudioIO.GetPlaybackMeter();
549 if( meter ) {
550 meter->Clear();
551 }
552
553 meter = projectAudioIO.GetCaptureMeter();
554 if( meter ) {
555 meter->Clear();
556 }
557 }
558}

Callers 15

HideSplashScreenMethod · 0.45
OnKeyDownMethod · 0.45
OnOKMethod · 0.45
RunWaitDialogMethod · 0.45
PlayPlayRegionAndWaitMethod · 0.45
RecordAndWaitMethod · 0.45
DoStopPlayingMethod · 0.45
CancelMethod · 0.45
StartQPPlayMethod · 0.45
ClearPlayRegionMethod · 0.45
OnCloseWindowMethod · 0.45

Calls 10

GetFunction · 0.85
finallyFunction · 0.85
CanStopAudioStreamMethod · 0.80
StopScrubbingMethod · 0.80
IsBusyMethod · 0.80
StopStreamMethod · 0.80
AILADisableMethod · 0.80
SetPausedOffMethod · 0.80
SetPausedMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected