Sound Bakery  v0.1.0
Open-source audio middleware for games
Loading...
Searching...
No Matches
effect.h
1#pragma once
2
3#include "sound_bakery/core/core_include.h"
4
5namespace sbk::engine
6{
7 class SB_CLASS effect_parameter_description final
8 {
9 REGISTER_REFLECTION(effect_parameter_description)
10
11 public:
13
15
16 sc_dsp_parameter m_parameter;
17 };
18
22 class SB_CLASS effect_description final : public sbk::core::database_object
23 {
24 REGISTER_REFLECTION(effect_description, database_object)
25
26 public:
27 effect_description() : sbk::core::database_object(), m_config() { set_dsp_type(SC_DSP_TYPE_LOWPASS); }
28
29 void set_dsp_type(sc_dsp_type type)
30 {
31 m_parameterDescriptions.clear();
32
33 m_config = sc_dsp_config_init(type);
34
35 for (int i = 0; i < m_config.vtable->numParams; ++i)
36 {
37 m_parameterDescriptions.emplace_back(m_config.vtable->params[i]);
38 }
39 }
40
41 [[nodiscard]] std::vector<effect_parameter_description> get_parameters() const
42 {
43 return m_parameterDescriptions;
44 }
45 [[nodiscard]] const sc_dsp_config* get_config() const { return &m_config; }
46 [[nodiscard]] sc_dsp_type get_dsp_type() const { return m_config.type; }
47
48 private:
49 sc_dsp_config m_config;
50 std::vector<effect_parameter_description> m_parameterDescriptions;
51 };
52} // namespace sbk::engine
Base object type for any object that can exist in the editor/database. Holds an ID and name.
Definition database_object.h:12
Wraps a sc_dsp_config.
Definition effect.h:23
Defines a database object with a changeable property.
Definition parameter.h:18
sc_dsp_config SC_API sc_dsp_config_init(sc_dsp_type type)
Returns a valid sc_dsp_config object for the DSP type.
Definition sound_chef.c:1019
Definition sound_chef_common.h:167
Definition sound_chef_dsp.h:34