summaryrefslogtreecommitdiff
path: root/servers/audio/effects/eq.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /servers/audio/effects/eq.h
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
Diffstat (limited to 'servers/audio/effects/eq.h')
-rw-r--r--servers/audio/effects/eq.h43
1 files changed, 14 insertions, 29 deletions
diff --git a/servers/audio/effects/eq.h b/servers/audio/effects/eq.h
index 1a568ee213..a6d471cc4a 100644
--- a/servers/audio/effects/eq.h
+++ b/servers/audio/effects/eq.h
@@ -32,18 +32,15 @@
#ifndef EQ_FILTER_H
#define EQ_FILTER_H
-
#include "typedefs.h"
#include "vector.h"
-
/**
@author Juan Linietsky
*/
class EQ {
public:
-
enum Preset {
PRESET_6_BANDS,
@@ -53,21 +50,18 @@ public:
PRESET_31_BANDS
};
-
-
class BandProcess {
- friend class EQ;
- float c1,c2,c3;
+ friend class EQ;
+ float c1, c2, c3;
struct History {
- float a1,a2,a3;
- float b1,b2,b3;
+ float a1, a2, a3;
+ float b1, b2, b3;
} history;
public:
-
- inline void process_one(float & p_data);
+ inline void process_one(float &p_data);
BandProcess();
};
@@ -76,7 +70,7 @@ private:
struct Band {
float freq;
- float c1,c2,c3;
+ float c1, c2, c3;
};
Vector<Band> band;
@@ -86,41 +80,32 @@ private:
void recalculate_band_coefficients();
public:
-
-
void set_mix_rate(float p_mix_rate);
int get_band_count() const;
void set_preset_band_mode(Preset p_preset);
- void set_bands(const Vector<float>& p_bands);
+ void set_bands(const Vector<float> &p_bands);
BandProcess get_band_processor(int p_band) const;
float get_band_frequency(int p_band);
EQ();
~EQ();
-
};
-
/* Inline Function */
-inline void EQ::BandProcess::process_one(float & p_data) {
+inline void EQ::BandProcess::process_one(float &p_data) {
+ history.a1 = p_data;
- history.a1=p_data;
-
- history.b1= c1 * ( history.a1 - history.a3 )
- + c3 * history.b2
- - c2 * history.b3;
+ history.b1 = c1 * (history.a1 - history.a3) + c3 * history.b2 - c2 * history.b3;
p_data = history.b1;
- history.a3=history.a2;
- history.a2=history.a1;
- history.b3=history.b2;
- history.b2=history.b1;
-
+ history.a3 = history.a2;
+ history.a2 = history.a1;
+ history.b3 = history.b2;
+ history.b2 = history.b1;
}
-
#endif