summaryrefslogtreecommitdiffstats
path: root/noatun/modules/winskin/guiSpectrumAnalyser.h
blob: e2dd3431f9b596f24cbc9ff9ea6caf049d7ec04d (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
  a GUI for a spectrum analyser
  Copyright (C) 1998  Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */



#ifndef _GUISPECTRUMANALYSER_H
#define _GUISPECTRUMANALYSER_H

#include <math.h>

#include "winSkinVis.h"
#include "waWidget.h"
#include "waColor.h"


#define MAX_MODE 1

enum visualizationMode {MODE_DISABLED = 0, MODE_ANALYSER = 1};
enum analyserMode {MODE_NORMAL = 0, MODE_FIRE = 1, MODE_VERTICAL_LINES = 2};

class GuiSpectrumAnalyser : public WaWidget  {
    Q_OBJECT

  public:
    GuiSpectrumAnalyser();
    ~GuiSpectrumAnalyser();

    void mousePressEvent(TQMouseEvent * mouseEvent);

  public slots:
    void pauseVisualization();
    void resumeVisualization();

  private slots:
    void pixmapChange();
    void updatePeaks();

    void setVisualizationMode(int);
    void setAnalyserMode(int);

  private:
    void paintEvent(TQPaintEvent *);

    TQPopupMenu *contextMenu;   
    TQPopupMenu *visualizationMenu;
    TQPopupMenu *analyserMenu;

    void freshenAnalyserCache();

    int visualization_mode;
    int analyser_mode;

    TQPixmap *analyserCache;
    WinSkinVis *winSkinVis;
};
#endif