File: filter.h

package info (click to toggle)
ams 1.8.7-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,880 kB
  • ctags: 2,171
  • sloc: cpp: 17,793; makefile: 433; sh: 101
file content (48 lines) | stat: -rw-r--r-- 1,332 bytes parent folder | download | duplicates (3)
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
#ifndef FILTER_H
#define FILTER_H

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <qwidget.h>
#include <qstring.h>
#include <qlabel.h>
#include <qsizepolicy.h>
#include <qsize.h>
#include <qtimer.h>
#include "synthdata.h"

#define FILTER_MINIMUM_WIDTH        100
#define FILTER_MINIMUM_HEIGHT        50

class Filter : public QWidget
{
  Q_OBJECT

  private:
    SynthData *synthdata;
    QTimer *qtimer;
    float *cutoffRef, *resonanceRef, *risingRef, *fallingRef, *hwidthRef, *smoothnessRef;

  protected:
    virtual void paintEvent(QPaintEvent *);
    virtual void resizeEvent (QResizeEvent* );            
    
  public:
    Filter(float *p_cutoffRef, float *p_resonanceRef, float *p_risingRef, float *p_fallingRef,
           float *p_hwidthRef, float *p_smoothnessRef, 
           QWidget* parent=0, const char *name=0, SynthData *p_synthdata=0);
    ~Filter();
    virtual QSize sizeHint() const;
    virtual QSizePolicy sizePolicy() const;
    float logfilt(float logf, float cutoff, float resonance, float rising, float falling,
               float hwidth, float smoothness);
    float filt(float f, float cutoff, float resonance, float rising, float falling,
               float hwidth, float smoothness);

  public slots: 
    void updateFilter(int value);
    void repaintFilter();
};
  
#endif