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 (const ChannelGroup &group, float *const *buffers, float *const *scratch, float *dummy, 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 268 of file RealtimeEffectManager.h.

Constructor & Destructor Documentation

◆ ProcessingScope() [1/3]

RealtimeEffects::ProcessingScope::ProcessingScope ( )
inline

Definition at line 270 of file RealtimeEffectManager.h.

271 {
272 if (auto pProject = mwProject.lock()) {
273 auto &manager = RealtimeEffectManager::Get(*pProject);
274 mLocks = { &manager };
275 mSuspended = manager.GetSuspended();
276 }
277 }
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 279 of file RealtimeEffectManager.h.

281 : mwProject{ move(wProject) }
282 {
283 if (auto pProject = mwProject.lock())
285 }
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 288 of file RealtimeEffectManager.h.

289 {
290 if (auto pProject = mwProject.lock())
292 }
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 ( const ChannelGroup group,
float *const *  buffers,
float *const *  scratch,
float *  dummy,
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 295 of file RealtimeEffectManager.h.

302 {
303 if (auto pProject = mwProject.lock())
304 return RealtimeEffectManager::Get(*pProject)
305 .Process(mSuspended, group, buffers, scratch, dummy,
306 nBuffers, numSamples);
307 else
308 return 0; // consider them trivially processed
309 }
size_t Process(bool suspended, const ChannelGroup &group, float *const *buffers, float *const *scratch, float *dummy, 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 312 of file RealtimeEffectManager.h.

Referenced by ProcessingScope().

◆ mSuspended

bool RealtimeEffects::ProcessingScope::mSuspended {}
private

Definition at line 314 of file RealtimeEffectManager.h.

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

◆ mwProject

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

Definition at line 313 of file RealtimeEffectManager.h.

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


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