Pass the buffer size to effects
This commit is contained in:
parent
1f91bf0f66
commit
0360dfa3b6
6 changed files with 31 additions and 0 deletions
|
|
@ -138,6 +138,9 @@ void EffectBus::setSamplesPerBlock(int samplesPerBlock) noexcept
|
||||||
{
|
{
|
||||||
_inputs.resize(samplesPerBlock);
|
_inputs.resize(samplesPerBlock);
|
||||||
_outputs.resize(samplesPerBlock);
|
_outputs.resize(samplesPerBlock);
|
||||||
|
|
||||||
|
for (const auto& effectPtr : _effects)
|
||||||
|
effectPtr->setSamplesPerBlock(samplesPerBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sfz
|
} // namespace sfz
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void setSampleRate(double sampleRate) = 0;
|
virtual void setSampleRate(double sampleRate) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the maximum number of frames to render at a time. The actual
|
||||||
|
* value can be lower but should never be higher.
|
||||||
|
*/
|
||||||
|
virtual void setSamplesPerBlock(int samplesPerBlock) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Reset the state to initial.
|
@brief Reset the state to initial.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,11 @@ namespace fx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lofi::setSamplesPerBlock(int samplesPerBlock)
|
||||||
|
{
|
||||||
|
(void)samplesPerBlock;
|
||||||
|
}
|
||||||
|
|
||||||
void Lofi::clear()
|
void Lofi::clear()
|
||||||
{
|
{
|
||||||
for (unsigned c = 0; c < EffectChannels; ++c) {
|
for (unsigned c = 0; c < EffectChannels; ++c) {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,12 @@ namespace fx {
|
||||||
*/
|
*/
|
||||||
void setSampleRate(double sampleRate) override;
|
void setSampleRate(double sampleRate) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the maximum number of frames to render at a time. The actual
|
||||||
|
* value can be lower but should never be higher.
|
||||||
|
*/
|
||||||
|
void setSamplesPerBlock(int samplesPerBlock) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reset the state to initial.
|
* @brief Reset the state to initial.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ namespace fx {
|
||||||
(void)sampleRate;
|
(void)sampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Nothing::setSamplesPerBlock(int samplesPerBlock)
|
||||||
|
{
|
||||||
|
(void)samplesPerBlock;
|
||||||
|
}
|
||||||
|
|
||||||
void Nothing::clear()
|
void Nothing::clear()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@ namespace fx {
|
||||||
*/
|
*/
|
||||||
void setSampleRate(double sampleRate) override;
|
void setSampleRate(double sampleRate) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the maximum number of frames to render at a time. The actual
|
||||||
|
* value can be lower but should never be higher.
|
||||||
|
*/
|
||||||
|
void setSamplesPerBlock(int samplesPerBlock) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reset the state to initial.
|
* @brief Reset the state to initial.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue