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 258 of file RealtimeEffectManager.h.

Constructor & Destructor Documentation

◆ ProcessingScope() [1/3]

RealtimeEffects::ProcessingScope::ProcessingScope ( )
inline

Definition at line 260 of file RealtimeEffectManager.h.

261 {
262 if (auto pProject = mwProject.lock()) {
263 auto &manager = RealtimeEffectManager::Get(*pProject);
264 mLocks = { &manager };
265 mSuspended = manager.GetSuspended();
266 }
267 }
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 269 of file RealtimeEffectManager.h.

271 : mwProject{ move(wProject) }
272 {
273 if (auto pProject = mwProject.lock())
275 }
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 278 of file RealtimeEffectManager.h.

279 {
280 if (auto pProject = mwProject.lock())
282 }
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 285 of file RealtimeEffectManager.h.

292 {
293 if (auto pProject = mwProject.lock())
294 return RealtimeEffectManager::Get(*pProject)
295 .Process(mSuspended, group, buffers, scratch, dummy,
296 nBuffers, numSamples);
297 else
298 return 0; // consider them trivially processed
299 }
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 302 of file RealtimeEffectManager.h.

Referenced by ProcessingScope().

◆ mSuspended

bool RealtimeEffects::ProcessingScope::mSuspended {}
private

Definition at line 304 of file RealtimeEffectManager.h.

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

◆ mwProject

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

Definition at line 303 of file RealtimeEffectManager.h.

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


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