00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef CORRELATION_METER_H
00025 #define CORRELATION_METER_H
00026
00027 #include "Plugin.h"
00028 #include "defines.h"
00029 #include <RingBufferNPT.h>
00030 #include <QObject>
00031
00032 class AudioBus;
00033
00034 struct CorrelationMeterData
00035 {
00036 float r;
00037 float levelLeft;
00038 float levelRight;
00039 };
00040
00041 class CorrelationMeter : public Plugin
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 CorrelationMeter();
00047 ~CorrelationMeter();
00048
00049 int init();
00050 QDomNode get_state(QDomDocument doc);
00051 int set_state(const QDomNode & node );
00052 void process(AudioBus* bus, unsigned long nframes);
00053 QString get_name();
00054
00055 int get_data(float& r, float& direction);
00056
00057 private:
00058 RingBufferNPT<CorrelationMeterData>* m_databuffer;
00059 CorrelationMeterData m_history;
00060 float m_fract;
00061 int m_bufferreadouts;
00062
00063 private slots:
00064 void calculate_fract();
00065
00066
00067 };
00068
00069
00070 #endif
00071