Skip to content

Commit

Permalink
chore(integration): Set filter parameters descriptor functions to const.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Mar 26, 2024
1 parent b6b7df5 commit a639404
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 100 deletions.
10 changes: 5 additions & 5 deletions include/SparkyStudios/Audio/Amplitude/Sound/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @return The maximum number of filter parameters.
*/
virtual AmUInt32 GetParamCount();
[[nodiscard]] virtual AmUInt32 GetParamCount() const;

/**
* @brief Get the name of the parameter at the given index.
Expand All @@ -58,7 +58,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @return The name of the parameter at the given index.
*/
virtual AmString GetParamName(AmUInt32 index);
[[nodiscard]] virtual AmString GetParamName(AmUInt32 index) const;

/**
* @brief Get the type of the parameter at the given index.
Expand All @@ -67,7 +67,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @return The type of the parameter at the given index.
*/
virtual AmUInt32 GetParamType(AmUInt32 index);
[[nodiscard]] virtual AmUInt32 GetParamType(AmUInt32 index) const;

/**
* @brief Get the maximum allowed value of the parameter at the given index.
Expand All @@ -76,7 +76,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @return The maximum allowed value of the parameter at the given index.
*/
virtual AmReal32 GetParamMax(AmUInt32 index);
[[nodiscard]] virtual AmReal32 GetParamMax(AmUInt32 index) const;

/**
* @brief Get the minimum allowed value of the parameter at the given index.
Expand All @@ -85,7 +85,7 @@ namespace SparkyStudios::Audio::Amplitude
*
* @return The minimum allowed value of the parameter at the given index.
*/
virtual AmReal32 GetParamMin(AmUInt32 index);
[[nodiscard]] virtual AmReal32 GetParamMin(AmUInt32 index) const;

/**
* @brief Creates a new instance of the filter.
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,27 @@ namespace SparkyStudios::Audio::Amplitude
Filter::Register(this);
}

AmUInt32 Filter::GetParamCount()
AmUInt32 Filter::GetParamCount() const
{
return 1;
}

AmString Filter::GetParamName(AmUInt32 index)
AmString Filter::GetParamName(AmUInt32 index) const
{
return "Wet";
}

AmUInt32 Filter::GetParamType(AmUInt32 index)
AmUInt32 Filter::GetParamType(AmUInt32 index) const
{
return Filter::PARAM_FLOAT;
}

AmReal32 Filter::GetParamMax(AmUInt32 index)
AmReal32 Filter::GetParamMax(AmUInt32 index) const
{
return 1.0f;
}

AmReal32 Filter::GetParamMin(AmUInt32 index)
AmReal32 Filter::GetParamMin(AmUInt32 index) const
{
return 0.0f;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/BassBoostFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@ namespace SparkyStudios::Audio::Amplitude
return AM_ERROR_NO_ERROR;
}

AmUInt32 BassBoostFilter::GetParamCount()
AmUInt32 BassBoostFilter::GetParamCount() const
{
return ATTRIBUTE_LAST;
}

AmString BassBoostFilter::GetParamName(AmUInt32 index)
AmString BassBoostFilter::GetParamName(AmUInt32 index) const
{
if (index == ATTRIBUTE_BOOST)
return "Boost";

return "Wet";
}

AmUInt32 BassBoostFilter::GetParamType(AmUInt32 index)
AmUInt32 BassBoostFilter::GetParamType(AmUInt32 index) const
{
return PARAM_FLOAT;
}

AmReal32 BassBoostFilter::GetParamMax(AmUInt32 index)
AmReal32 BassBoostFilter::GetParamMax(AmUInt32 index) const
{
if (index == ATTRIBUTE_BOOST)
return 10.0f;

return 1.0f;
}

AmReal32 BassBoostFilter::GetParamMin(AmUInt32 index)
AmReal32 BassBoostFilter::GetParamMin(AmUInt32 index) const
{
return 0.0f;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/BassBoostFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ namespace SparkyStudios::Audio::Amplitude

AmResult Init(AmReal32 boost);

AmUInt32 GetParamCount() override;
[[nodiscard]] AmUInt32 GetParamCount() const override;

AmString GetParamName(AmUInt32 index) override;
[[nodiscard]] AmString GetParamName(AmUInt32 index) const override;

AmUInt32 GetParamType(AmUInt32 index) override;
[[nodiscard]] AmUInt32 GetParamType(AmUInt32 index) const override;

AmReal32 GetParamMax(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMax(AmUInt32 index) const override;

AmReal32 GetParamMin(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMin(AmUInt32 index) const override;

FilterInstance* CreateInstance() override;

Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/BiquadResonantFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ namespace SparkyStudios::Audio::Amplitude
return Init(TYPE_HIGH_SHELF, frequency, s, gain);
}

AmUInt32 BiquadResonantFilter::GetParamCount()
AmUInt32 BiquadResonantFilter::GetParamCount() const
{
return ATTRIBUTE_LAST;
}

AmString BiquadResonantFilter::GetParamName(AmUInt32 index)
AmString BiquadResonantFilter::GetParamName(AmUInt32 index) const
{
if (index >= ATTRIBUTE_LAST)
return "";
Expand All @@ -96,15 +96,15 @@ namespace SparkyStudios::Audio::Amplitude
return names[index];
}

AmUInt32 BiquadResonantFilter::GetParamType(AmUInt32 index)
AmUInt32 BiquadResonantFilter::GetParamType(AmUInt32 index) const
{
if (index == ATTRIBUTE_TYPE)
return PARAM_INT;

return PARAM_FLOAT;
}

AmReal32 BiquadResonantFilter::GetParamMax(AmUInt32 index)
AmReal32 BiquadResonantFilter::GetParamMax(AmUInt32 index) const
{
switch (index)
{
Expand All @@ -123,7 +123,7 @@ namespace SparkyStudios::Audio::Amplitude
}
}

AmReal32 BiquadResonantFilter::GetParamMin(AmUInt32 index)
AmReal32 BiquadResonantFilter::GetParamMin(AmUInt32 index) const
{
switch (index)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/BiquadResonantFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ namespace SparkyStudios::Audio::Amplitude

AmResult InitHighShelf(AmReal32 frequency, AmReal32 s, AmReal32 gain);

AmUInt32 GetParamCount() override;
[[nodiscard]] AmUInt32 GetParamCount() const override;

AmString GetParamName(AmUInt32 index) override;
[[nodiscard]] AmString GetParamName(AmUInt32 index) const override;

AmUInt32 GetParamType(AmUInt32 index) override;
[[nodiscard]] AmUInt32 GetParamType(AmUInt32 index) const override;

AmReal32 GetParamMax(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMax(AmUInt32 index) const override;

AmReal32 GetParamMin(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMin(AmUInt32 index) const override;

FilterInstance* CreateInstance() override;

Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/DelayFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ namespace SparkyStudios::Audio::Amplitude
return AM_ERROR_NO_ERROR;
}

AmUInt32 DelayFilter::GetParamCount()
AmUInt32 DelayFilter::GetParamCount() const
{
return ATTRIBUTE_LAST;
}

AmString DelayFilter::GetParamName(AmUInt32 index)
AmString DelayFilter::GetParamName(AmUInt32 index) const
{
if (index >= ATTRIBUTE_LAST)
return "";
Expand All @@ -52,20 +52,20 @@ namespace SparkyStudios::Audio::Amplitude
return names[index];
}

AmUInt32 DelayFilter::GetParamType(AmUInt32 index)
AmUInt32 DelayFilter::GetParamType(AmUInt32 index) const
{
if (index == ATTRIBUTE_DELAY_START)
return PARAM_BOOL;

return PARAM_FLOAT;
}

AmReal32 DelayFilter::GetParamMax(AmUInt32 index)
AmReal32 DelayFilter::GetParamMax(AmUInt32 index) const
{
return 1.0f;
}

AmReal32 DelayFilter::GetParamMin(AmUInt32 index)
AmReal32 DelayFilter::GetParamMin(AmUInt32 index) const
{
return 0.0f;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/DelayFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ namespace SparkyStudios::Audio::Amplitude

AmResult Init(AmReal32 delay, AmReal32 decay = 0.7f, AmReal32 delayStart = 0.0f);

AmUInt32 GetParamCount() override;
[[nodiscard]] AmUInt32 GetParamCount() const override;

AmString GetParamName(AmUInt32 index) override;
[[nodiscard]] AmString GetParamName(AmUInt32 index) const override;

AmUInt32 GetParamType(AmUInt32 index) override;
[[nodiscard]] AmUInt32 GetParamType(AmUInt32 index) const override;

AmReal32 GetParamMax(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMax(AmUInt32 index) const override;

AmReal32 GetParamMin(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMin(AmUInt32 index) const override;

FilterInstance* CreateInstance() override;

Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/EqualizerFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ namespace SparkyStudios::Audio::Amplitude
return AM_ERROR_NO_ERROR;
}

AmUInt32 EqualizerFilter::GetParamCount()
AmUInt32 EqualizerFilter::GetParamCount() const
{
return ATTRIBUTE_LAST;
}

AmString EqualizerFilter::GetParamName(AmUInt32 index)
AmString EqualizerFilter::GetParamName(AmUInt32 index) const
{
switch (index)
{
Expand All @@ -105,20 +105,20 @@ namespace SparkyStudios::Audio::Amplitude
}
}

AmUInt32 EqualizerFilter::GetParamType(AmUInt32 index)
AmUInt32 EqualizerFilter::GetParamType(AmUInt32 index) const
{
return PARAM_FLOAT;
}

AmReal32 EqualizerFilter::GetParamMax(AmUInt32 index)
AmReal32 EqualizerFilter::GetParamMax(AmUInt32 index) const
{
if (index == ATTRIBUTE_WET)
return 1.0f;

return 4.0f;
}

AmReal32 EqualizerFilter::GetParamMin(AmUInt32 index)
AmReal32 EqualizerFilter::GetParamMin(AmUInt32 index) const
{
return 0.0f;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/EqualizerFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ namespace SparkyStudios::Audio::Amplitude
AmReal32 volume7 = 0.0f,
AmReal32 volume8 = 0.0f);

AmUInt32 GetParamCount() override;
[[nodiscard]] AmUInt32 GetParamCount() const override;

AmString GetParamName(AmUInt32 index) override;
[[nodiscard]] AmString GetParamName(AmUInt32 index) const override;

AmUInt32 GetParamType(AmUInt32 index) override;
[[nodiscard]] AmUInt32 GetParamType(AmUInt32 index) const override;

AmReal32 GetParamMax(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMax(AmUInt32 index) const override;

AmReal32 GetParamMin(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMin(AmUInt32 index) const override;

FilterInstance* CreateInstance() override;

Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/FlangerFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ namespace SparkyStudios::Audio::Amplitude
return AM_ERROR_NO_ERROR;
}

AmUInt32 FlangerFilter::GetParamCount()
AmUInt32 FlangerFilter::GetParamCount() const
{
return ATTRIBUTE_LAST;
}

AmString FlangerFilter::GetParamName(AmUInt32 index)
AmString FlangerFilter::GetParamName(AmUInt32 index) const
{
if (index >= ATTRIBUTE_LAST)
return "";
Expand All @@ -50,12 +50,12 @@ namespace SparkyStudios::Audio::Amplitude
return names[index];
}

AmUInt32 FlangerFilter::GetParamType(AmUInt32 index)
AmUInt32 FlangerFilter::GetParamType(AmUInt32 index) const
{
return PARAM_FLOAT;
}

AmReal32 FlangerFilter::GetParamMax(AmUInt32 index)
AmReal32 FlangerFilter::GetParamMax(AmUInt32 index) const
{
if (index == ATTRIBUTE_DELAY)
return 0.1f;
Expand All @@ -66,7 +66,7 @@ namespace SparkyStudios::Audio::Amplitude
return 1.0f;
}

AmReal32 FlangerFilter::GetParamMin(AmUInt32 index)
AmReal32 FlangerFilter::GetParamMin(AmUInt32 index) const
{
if (index == ATTRIBUTE_WET)
return 0.0f;
Expand Down
10 changes: 5 additions & 5 deletions src/Sound/Filters/FlangerFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ namespace SparkyStudios::Audio::Amplitude

AmResult Init(AmReal32 delay, AmReal32 frequency);

AmUInt32 GetParamCount() override;
[[nodiscard]] AmUInt32 GetParamCount() const override;

AmString GetParamName(AmUInt32 index) override;
[[nodiscard]] AmString GetParamName(AmUInt32 index) const override;

AmUInt32 GetParamType(AmUInt32 index) override;
[[nodiscard]] AmUInt32 GetParamType(AmUInt32 index) const override;

AmReal32 GetParamMax(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMax(AmUInt32 index) const override;

AmReal32 GetParamMin(AmUInt32 index) override;
[[nodiscard]] AmReal32 GetParamMin(AmUInt32 index) const override;

FilterInstance* CreateInstance() override;

Expand Down
Loading

0 comments on commit a639404

Please sign in to comment.