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 Track &track, 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 249 of file RealtimeEffectManager.h.

Constructor & Destructor Documentation

◆ ProcessingScope() [1/3]

RealtimeEffects::ProcessingScope::ProcessingScope ( )
inline

Definition at line 251 of file RealtimeEffectManager.h.

252 {
253 if (auto pProject = mwProject.lock()) {
254 auto &manager = RealtimeEffectManager::Get(*pProject);
255 mLocks = { &manager };
256 mSuspended = manager.GetSuspended();
257 }
258 }
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 260 of file RealtimeEffectManager.h.

262 : mwProject{ move(wProject) }
263 {
264 if (auto pProject = mwProject.lock())
266 }
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 269 of file RealtimeEffectManager.h.

270 {
271 if (auto pProject = mwProject.lock())
273 }
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 Track track,
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 276 of file RealtimeEffectManager.h.

283 {
284 if (auto pProject = mwProject.lock())
285 return RealtimeEffectManager::Get(*pProject)
286 .Process(mSuspended, track, buffers, scratch, dummy,
287 nBuffers, numSamples);
288 else
289 return 0; // consider them trivially processed
290 }
size_t Process(bool suspended, const Track &track, 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 293 of file RealtimeEffectManager.h.

Referenced by ProcessingScope().

◆ mSuspended

bool RealtimeEffects::ProcessingScope::mSuspended {}
private

Definition at line 295 of file RealtimeEffectManager.h.

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

◆ mwProject

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

Definition at line 294 of file RealtimeEffectManager.h.

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


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