aboutsummaryrefslogtreecommitdiffstats
path: root/fft.h
diff options
context:
space:
mode:
Diffstat (limited to 'fft.h')
-rw-r--r--fft.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/fft.h b/fft.h
new file mode 100644
index 0000000..d81341f
--- /dev/null
+++ b/fft.h
@@ -0,0 +1,40 @@
+#ifndef FFT_H
+#define FFT_H
+
+#include <qwidget.h>
+#include <X11/Xlib.h>
+
+/* ------------------------------------------------------------------------ */
+
+class FFTWindow : public QWidget
+{
+ Q_OBJECT;
+
+public:
+ FFTWindow(QWidget *parent, char *name);
+
+public slots:
+ void new_params(struct SOUNDPARAMS *params);
+ void new_data(void *data);
+ void set_ylog(int linear);
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private:
+ unsigned long fore,back;
+ GC gc;
+ int *logmap;
+ XSegment *segments;
+ short *buffer;
+
+ int afmt,channels,rate;
+ int audio_size, fft_size, lmax;
+ bool ylog;
+
+ void make_logmap();
+ void calculate(unsigned char *data);
+ void drawhist();
+};
+
+#endif