Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
RealtimeEffects::SuspensionScope Class Reference

Brackets one suspension of processing in the main thread. More...

#include <RealtimeEffectManager.h>

Collaboration diagram for RealtimeEffects::SuspensionScope:
[legend]

Public Member Functions

 SuspensionScope ()
 
 SuspensionScope (InitializationScope &, std::weak_ptr< AudacityProject > wProject)
 Require a prior InitializationScope to ensure correct nesting. More...
 
 SuspensionScope (SuspensionScope &&other)=default
 
SuspensionScopeoperator= (SuspensionScope &&other)=default
 
 ~SuspensionScope ()
 

Private Attributes

std::weak_ptr< AudacityProjectmwProject
 

Detailed Description

Brackets one suspension of processing in the main thread.

Definition at line 205 of file RealtimeEffectManager.h.

Constructor & Destructor Documentation

◆ SuspensionScope() [1/3]

RealtimeEffects::SuspensionScope::SuspensionScope ( )
inline

Definition at line 207 of file RealtimeEffectManager.h.

207{}

◆ SuspensionScope() [2/3]

RealtimeEffects::SuspensionScope::SuspensionScope ( InitializationScope ,
std::weak_ptr< AudacityProject wProject 
)
inlineexplicit

Require a prior InitializationScope to ensure correct nesting.

Definition at line 209 of file RealtimeEffectManager.h.

211 : mwProject{ move(wProject) }
212 {
213 if (auto pProject = mwProject.lock()) {
214 auto &manager = RealtimeEffectManager::Get(*pProject);
215 if (!manager.GetSuspended())
216 manager.Suspend();
217 else
218 mwProject.reset();
219 }
220 }
static const AttachedProjectObjects::RegisteredFactory manager
static RealtimeEffectManager & Get(AudacityProject &project)
std::weak_ptr< AudacityProject > mwProject

References RealtimeEffectManager::Get(), manager, and mwProject.

Here is the call graph for this function:

◆ SuspensionScope() [3/3]

RealtimeEffects::SuspensionScope::SuspensionScope ( SuspensionScope &&  other)
default

◆ ~SuspensionScope()

RealtimeEffects::SuspensionScope::~SuspensionScope ( )
inline

Definition at line 223 of file RealtimeEffectManager.h.

224 {
225 if (auto pProject = mwProject.lock())
227 }

References RealtimeEffectManager::Get(), mwProject, and RealtimeEffectManager::Resume().

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

SuspensionScope & RealtimeEffects::SuspensionScope::operator= ( SuspensionScope &&  other)
default

Member Data Documentation

◆ mwProject

std::weak_ptr<AudacityProject> RealtimeEffects::SuspensionScope::mwProject
private

Definition at line 230 of file RealtimeEffectManager.h.

Referenced by SuspensionScope(), and ~SuspensionScope().


The documentation for this class was generated from the following file: