comparison devuvuzelator-ladspa.h @ 9:a1539d4e3b08

* Tidy code, start doc
author Chris Cannam
date Sat, 12 Jun 2010 13:08:33 +0100
parents
children
comparison
equal deleted inserted replaced
8:e15ebd222c63 9:a1539d4e3b08
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 #ifndef _DEVUVUZELATOR_LADSPA_H_
4 #define _DEVUVUZELATOR_LADSPA_H_
5
6 #include <ladspa.h>
7
8 #include "median.h"
9
10 class Devuvuzelator
11 {
12 public:
13 static const LADSPA_Descriptor *getDescriptor(unsigned long index);
14
15 private:
16 Devuvuzelator(int sampleRate);
17 ~Devuvuzelator();
18
19 enum {
20 InputPort = 0,
21 OutputPort = 1,
22 LatencyPort = 2,
23 FundamentalPort = 3,
24 BandwidthPort = 4,
25 HarmonicsPort = 5,
26 ReductionPort = 6,
27 PortCount = 7,
28 };
29
30 static const char *const portNames[PortCount];
31 static const LADSPA_PortDescriptor ports[PortCount];
32 static const LADSPA_PortRangeHint hints[PortCount];
33 static const LADSPA_Properties properties;
34 static const LADSPA_Descriptor ladspaDescriptor;
35
36 static LADSPA_Handle instantiate(const LADSPA_Descriptor *, unsigned long);
37 static void connectPort(LADSPA_Handle, unsigned long, LADSPA_Data *);
38 static void activate(LADSPA_Handle);
39 static void run(LADSPA_Handle, unsigned long);
40 static void deactivate(LADSPA_Handle);
41 static void cleanup(LADSPA_Handle);
42
43 void reset();
44 void window(float *);
45 void runImpl(unsigned long);
46 void processFrame();
47 void processSpectralFrame();
48 void updateParameters();
49
50 static void fft(unsigned int n, bool inverse,
51 double *ri, double *ii, double *ro, double *io);
52
53 int m_sampleRate;
54 float *m_input;
55 float *m_output;
56
57 float m_fundamental;
58 float m_bandwidth;
59 float m_harmonics;
60 float m_reduction;
61
62 float *m_platency;
63 float *m_pfundamental;
64 float *m_pbandwidth;
65 float *m_pharmonics;
66 float *m_preduction;
67
68 const int m_fftsize;
69 const int m_winsize;
70 const int m_increment;
71 const float m_filtersecs;
72 int m_fill;
73 int m_read;
74 float *m_buffer;
75 float *m_outacc;
76 double *m_real;
77 double *m_imag;
78 double *m_window;
79 MedianFilter<double> **m_medians;
80 };
81
82 #endif