Public Member Functions | List of all members
MainController::KillStateHandler Class Reference

Handles the voice killing when a longer task is about to start. More...

Inherits Handler.

Public Member Functions

bool handleKillState ()
 Call this in the processBlock method and it will check whether voice starts are allowed. More...
 
bool isAudioRunning () const noexcept
 Replacement for allVoicesKilled. More...
 
bool isSuspendableThread () const noexcept
 Returns true if the current thread can be safely suspended by a call to Thread::sleep(). More...
 
bool killVoicesAndCall (Processor *p, const ProcessorFunction &functionToExecuteWhenKilled, TargetThread targetThread)
 Give this method a lambda and a processor and it will call it as soon as all voices are killed. More...
 
void setSampleLoadingThreadId (void *newId)
 This can be set by the Internal Preloader. More...
 
bool voiceStartIsDisabled () const
 Returns false if there is a pending action somewhere that prevents clickless voice rendering. More...
 

Detailed Description

Handles the voice killing when a longer task is about to start.

Member Function Documentation

bool handleKillState ( )

Call this in the processBlock method and it will check whether voice starts are allowed.

It checks if anything is pending and if yes, voiceStartIsDisabled() will return true for the callback.

bool isAudioRunning ( ) const
noexcept

Replacement for allVoicesKilled.

Checks if the audio is running.

bool isSuspendableThread ( ) const
noexcept

Returns true if the current thread can be safely suspended by a call to Thread::sleep().

This will return true only for the sample loading thread and the scripting thread.

bool killVoicesAndCall ( Processor p,
const ProcessorFunction functionToExecuteWhenKilled,
TargetThread  targetThread 
)

Give this method a lambda and a processor and it will call it as soon as all voices are killed.

If the voices are already killed, it will synchronously call the function if this function is called from the given targetThread. If not, it will kill all functions and execute the function on the specified thread.

It will check whether the processor was deleted before calling the function.

void setSampleLoadingThreadId ( void *  newId)

This can be set by the Internal Preloader.

bool voiceStartIsDisabled ( ) const

Returns false if there is a pending action somewhere that prevents clickless voice rendering.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.