Mercurial > hg > flattendynamics
view flattendynamics-ladspa.h @ 1:f21753c504e1
Add gain output port, update rms values
author | Chris Cannam |
---|---|
date | Thu, 17 Jul 2014 13:27:07 +0100 |
parents | 7632b9bf0cff |
children | 6b732542a34c |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ #ifndef FLATTENDYNAMICS_LADSPA_H #define FLATTENDYNAMICS_LADSPA_H #include <ladspa.h> class FlattenDynamics { public: static const LADSPA_Descriptor *getDescriptor(unsigned long index); private: FlattenDynamics(int sampleRate); ~FlattenDynamics(); enum { AudioInputPort = 0, AudioOutputPort = 1, GainOutputPort = 2, PortCount = 3, }; static const char *const portNames[PortCount]; static const LADSPA_PortDescriptor ports[PortCount]; static const LADSPA_PortRangeHint hints[PortCount]; static const LADSPA_Properties properties; static const LADSPA_Descriptor ladspaDescriptor; static LADSPA_Handle instantiate(const LADSPA_Descriptor *, unsigned long); static void connectPort(LADSPA_Handle, unsigned long, LADSPA_Data *); static void activate(LADSPA_Handle); static void run(LADSPA_Handle, unsigned long); static void deactivate(LADSPA_Handle); static void cleanup(LADSPA_Handle); void reset(); void runImpl(unsigned long); float process(float); void updateRMS(float); void updateParameters(); int m_sampleRate; float *m_input; float *m_output; float *m_pgain; float *m_history; int m_histlen; int m_histwrite; int m_histread; double m_sumOfSquares; float m_rms; float m_gain; }; #endif