Free Electron
ext/evaluate/Function.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #include "evaluate.pmh"
8 //#include "solve/solve.h"
9 
10 #ifndef __evaluate_Function_h__
11 #define __evaluate_Function_h__
12 
13 namespace fe
14 {
15 namespace ext
16 {
17 
18 class FE_DL_EXPORT Multiply : virtual public RealFunction
19 {
20  public:
21  Multiply(void) {}
22  ~Multiply(void) {}
23 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
24 };
25 
26 class FE_DL_EXPORT Add : virtual public RealFunction
27 {
28  public:
29  Add(void) {}
30  ~Add(void) {}
31 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
32 };
33 
34 class FE_DL_EXPORT Subtract : virtual public RealFunction
35 {
36  public:
37  Subtract(void) {}
38  ~Subtract(void) {}
39 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
40 };
41 
42 class FE_DL_EXPORT Divide : virtual public RealFunction
43 {
44  public:
45  Divide(void) {}
46  ~Divide(void) {}
47 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
48 };
49 
50 class FE_DL_EXPORT AbsoluteValue : virtual public RealFunction
51 {
52  public:
53  AbsoluteValue(void) {}
54  ~AbsoluteValue(void) {}
55 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
56 };
57 
58 class FE_DL_EXPORT AsSmooth :
59  public AccessorSet,
60  public Initialize<AsSmooth>
61 {
62  public:
63  void initialize(void)
64  {
65  add(value, FE_SPEC("eval:value", "node return value"));
66  add(dummy, FE_SPEC("eval:dummy", "dummy"));
67  }
68  Accessor<t_eval_real> value;
69  Accessor<int> dummy;
70 };
71 
72 class FE_DL_EXPORT Smooth :
73  virtual public FunctionI,
74  public Initialize<Smooth>
75 
76 {
77  public:
78  Smooth(void)
79  {
80  }
81  ~Smooth(void) {}
82 
83  void initialize(void);
84 
85 virtual bool compile(sp<RecordGroup> a_rg, Record &a_return, t_stdvector<WeakRecord> &a_argv, t_stdstring &a_msg);
86 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
87 virtual sp<Aggregate> &returnType(void) { return m_aggregate; }
88 
89  t_eval_real m_smoothed;
90  sp<AsSmooth> m_asSmooth;
91  sp<Aggregate> m_aggregate;
92  bool m_valid;
93 };
94 
95 class FE_DL_EXPORT Compressor : virtual public RealFunction
96 {
97  public:
98  Compressor(void)
99  {
100  m_gain = 1.0;
101  }
102  ~Compressor(void) {}
103 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
104  t_eval_real m_gain;
105 };
106 
107 class FE_DL_EXPORT SoftClipper : virtual public RealFunction
108 {
109  public:
110  SoftClipper(void)
111  {
112  }
113  ~SoftClipper(void) {}
114 virtual void eval(Record &a_return, t_stdvector<WeakRecord> &a_argv);
115 };
116 
117 
118 #if 0
119  this->factories()["print"] = &(PrintVal::create);
120  this->factories()["histogram"] = &(Histogram::create);
121  this->factories()["signal_scale"] = &(SignalScale::create);
122  this->factories()["hard_clip"] = &(HardClipper::create);
123  this->factories()["soft_clip"] = &(SoftClipper::create);
124  this->factories()["antijolt"] = &(AntiJolt::create);
125  this->factories()["antijolt2"] = &(AntiJolt2::create);
126  this->factories()["antivibe"] = &(AntiVibe::create);
127  this->factories()["spring"] = &(Spring::create);
128  this->factories()["relative"] = &(RelativeGain::create);
129  this->factories()["compressor"] = &(Compressor::create);
130  this->factories()["scoop"] = &(Scoop::create);
131  this->factories()["tighten"] = &(TightenCenter::create);
132  this->factories()["drag"] = &(BaseDrag::create);
133  this->factories()["bumpstop"] = &(BumpStop::create);
134  this->factories()["power"] = &(Power::create);
135  this->factories()["linkage"] = &(Linkage::create);
136  this->factories()["limiter"] = &(Limiter::create);
137  this->factories()["jerk"] = &(Jerk::create);
138  this->factories()["oscillator"] = &(Oscillator::create);
139  this->factories()["split"] = &(Split::create);
140  this->factories()["safety"] = &(Safety::create);
141  this->factories()["anti_drag"] = &(AntiDrag::create);
142  this->factories()["enhance"] = &(Enhance::create);
143  this->factories()["abs"] = &(AbsFun::create);
144  this->factories()["min"] = &(MinFun::create);
145  this->factories()["max"] = &(MaxFun::create);
146  this->factories()["if"] = &(IfFun::create);
147  this->factories()["LT"] = &(LessThan::create);
148  this->factories()["blend"] = &(BlendFun::create);
149  this->factories()["crossover"] = &(CrossoverFun::create);
150  this->factories()["up"] = &(Up::create);
151  this->factories()["dn"] = &(Dn::create);
152  this->factories()["ctr"] = &(Center::create);
153  this->factories()["save_channel"] = &(SaveChannel::create);
154  this->factories()["load_channel"] = &(LoadChannel::create);
155 #endif
156 
157 
158 } /* namespace ext */
159 } /* namespace fe */
160 
161 #endif /* __evaluate_Function_h__ */
kernel
Definition: namespace.dox:3