Skip to content

Commit

Permalink
const-correctness fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Nov 8, 2023
1 parent 7e7179e commit 35f25dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void SmoothedBufferValue<FloatType, ValueSmoothingTypes>::setParameterHandle (st
}

template <typename FloatType, typename ValueSmoothingTypes>
void SmoothedBufferValue<FloatType, ValueSmoothingTypes>::setParameterHandle ([[maybe_unused]] FloatParameter* handle)
void SmoothedBufferValue<FloatType, ValueSmoothingTypes>::setParameterHandle ([[maybe_unused]] const FloatParameter* handle)
{
parameterHandle = nullptr;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SmoothedBufferValue
*
* @param handle A parameter handle to use for smoothing
*/
void setParameterHandle (FloatParameter* handle);
void setParameterHandle (const FloatParameter* handle);

/** Prepare the smoother to process samples with a given sample rate and block size. */
void prepare (double sampleRate, int samplesPerBlock);
Expand Down Expand Up @@ -102,7 +102,7 @@ class SmoothedBufferValue

std::atomic<float>* parameterHandle = nullptr;

FloatParameter* modulatableParameterHandle = nullptr;
const FloatParameter* modulatableParameterHandle = nullptr;

double sampleRate = 48000.0;
double rampLengthInSeconds = 0.05;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<std::is_same_
}

template <typename SampleType, typename DelayInterpType>
bool BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<std::is_same_v<DelayInterpType, std::nullptr_t>>>::processBlockIn (const BufferView<SampleType>& block, bool onOffParam)
bool BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<std::is_same_v<DelayInterpType, std::nullptr_t>>>::processBlockIn (const BufferView<const SampleType>& block, bool onOffParam)
{
if (! onOffParam && ! prevOnOffParam)
{
Expand Down Expand Up @@ -115,7 +115,7 @@ void BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<! std::is_sam
}

template <typename SampleType, typename DelayInterpType>
bool BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<! std::is_same_v<DelayInterpType, std::nullptr_t>>>::processBlockIn (const BufferView<SampleType>& block, bool onOffParam)
bool BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<! std::is_same_v<DelayInterpType, std::nullptr_t>>>::processBlockIn (const BufferView<const SampleType>& block, bool onOffParam)
{
enum class DelayOp
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<std::is_same
* If it returns false, you can safely skip all other
* processing.
*/
bool processBlockIn (const BufferView<SampleType>& buffer, bool onOffParam);
bool processBlockIn (const BufferView<const SampleType>& buffer, bool onOffParam);

/**
* Call this at the end of your processBlock().
Expand Down Expand Up @@ -101,7 +101,7 @@ class BypassProcessor<SampleType, DelayInterpType, std::enable_if_t<! std::is_sa
* If it returns false, you can safely skip all other
* processing.
*/
bool processBlockIn (const BufferView<SampleType>& buffer, bool onOffParam);
bool processBlockIn (const BufferView<const SampleType>& buffer, bool onOffParam);

/**
* Call this at the end of your processBlock().
Expand Down

0 comments on commit 35f25dc

Please sign in to comment.