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

Brackets one block of processing in one thread. More...

#include <RealtimeEffectManager.h>

Collaboration diagram for RealtimeEffects::ProcessingScope:
[legend]

Public Member Functions

 ProcessingScope ()
 
 ProcessingScope (InitializationScope &, std::weak_ptr< AudacityProject > wProject)
 Require a prior InializationScope to ensure correct nesting. More...
 
 ProcessingScope (ProcessingScope &&other)=default
 
ProcessingScopeoperator= (ProcessingScope &&other)=default
 
 ~ProcessingScope ()
 
size_t Process (Track &track, float *const *buffers, float *const *scratch, unsigned nBuffers, size_t numSamples)
 

Private Attributes

RealtimeEffectManager::AllListsLock mLocks
 
std::weak_ptr< AudacityProjectmwProject
 
bool mSuspended {}
 

Detailed Description

Brackets one block of processing in one thread.

Definition at line 239 of file RealtimeEffectManager.h.

Constructor & Destructor Documentation

◆ ProcessingScope() [1/3]

RealtimeEffects::ProcessingScope::ProcessingScope ( )
inline

Definition at line 241 of file RealtimeEffectManager.h.

242 {
243 if (auto pProject = mwProject.lock()) {
244 auto &manager = RealtimeEffectManager::Get(*pProject);
245 mLocks = { &manager };
246 mSuspended = manager.GetSuspended();
247 }
248 }
static const AttachedProjectObjects::RegisteredFactory manager
static RealtimeEffectManager & Get(AudacityProject &project)
std::weak_ptr< AudacityProject > mwProject
RealtimeEffectManager::AllListsLock mLocks

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

Here is the call graph for this function:

◆ ProcessingScope() [2/3]

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

Require a prior InializationScope to ensure correct nesting.

Definition at line 250 of file RealtimeEffectManager.h.

252 : mwProject{ move(wProject) }
253 {
254 if (auto pProject = mwProject.lock())
256 }
void ProcessStart(bool suspended)

References RealtimeEffectManager::Get(), mSuspended, mwProject, and RealtimeEffectManager::ProcessStart().

Here is the call graph for this function:

◆ ProcessingScope() [3/3]

RealtimeEffects::ProcessingScope::ProcessingScope ( ProcessingScope &&  other)
default

◆ ~ProcessingScope()

RealtimeEffects::ProcessingScope::~ProcessingScope ( )
inline

Definition at line 259 of file RealtimeEffectManager.h.

260 {
261 if (auto pProject = mwProject.lock())
263 }
void ProcessEnd(bool suspended) noexcept

References RealtimeEffectManager::Get(), mSuspended, mwProject, and RealtimeEffectManager::ProcessEnd().

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

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

◆ Process()

size_t RealtimeEffects::ProcessingScope::Process ( Track track,
float *const *  buffers,
float *const *  scratch,
unsigned  nBuffers,
size_t  numSamples 
)
inline
Returns
how many samples to discard for latency
Parameters
nBuffershow many buffers; equal number of scratches
numSampleslength of each buffer

Definition at line 266 of file RealtimeEffectManager.h.

272 {
273 if (auto pProject = mwProject.lock())
274 return RealtimeEffectManager::Get(*pProject)
275 .Process(mSuspended, track, buffers, scratch,
276 nBuffers, numSamples);
277 else
278 return 0; // consider them trivially processed
279 }
size_t Process(bool suspended, Track &track, float *const *buffers, float *const *scratch, unsigned nBuffers, size_t numSamples)

References RealtimeEffectManager::Get(), mSuspended, mwProject, and RealtimeEffectManager::Process().

Here is the call graph for this function:

Member Data Documentation

◆ mLocks

RealtimeEffectManager::AllListsLock RealtimeEffects::ProcessingScope::mLocks
private

Definition at line 282 of file RealtimeEffectManager.h.

Referenced by ProcessingScope().

◆ mSuspended

bool RealtimeEffects::ProcessingScope::mSuspended {}
private

Definition at line 284 of file RealtimeEffectManager.h.

Referenced by Process(), ProcessingScope(), and ~ProcessingScope().

◆ mwProject

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

Definition at line 283 of file RealtimeEffectManager.h.

Referenced by Process(), ProcessingScope(), and ~ProcessingScope().


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