aboutsummaryrefslogtreecommitdiffstats
path: root/fft.h
blob: d81341f4c3c93fb4ec8d1a5ab584754ad66e7a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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