[0f6817]: kwave / filter.h Maximize Restore History

Download this file

filter.h    126 lines (101 with data), 2.6 kB

  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include <qlayout.h>
#include <qtooltip.h>
#include <qdir.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qbutton.h>
#include <qcombo.h>
#include <qdialog.h>
#include <qbttngrp.h>
#include <qchkbox.h>
#include <qradiobt.h>
#include "slider.h"
#include "gsl_fft.h"
#include "fftview.h"
#include "curvewidget.h"
#include <krestrictedline.h>
#include <kintegerline.h>
#include <kmsgbox.h>
//*****************************************************************************
class Filter
{
public:
Filter ();
~Filter ();
int resize (int);
void save (QString *);
void load (QString *);
int rate;
int num; //number of taps
int fir; //boolean if filter is fir or iir
double *mult; //array of coefficients, used according to
int *offset; //array of delay times in samples
};
//*****************************************************************************
class FilterDialog : public QDialog
{
Q_OBJECT
public:
FilterDialog (QWidget *parent=0,int =48000);
~FilterDialog ();
void refreshView ();
public slots:
void setTaps (const char *);
void setOffset (const char *);
void setMult (int);
void refresh ();
void loadFilter ();
void saveFilter ();
struct Filter *getFilter();
protected:
void resizeEvent (QResizeEvent *);
void getNTaps (int);
private:
int w,h;
Filter filter;
int oldnum;
QLabel *taplabel;
KIntegerLine *taps;
QLabel **label;
KwaveSlider **mult;
KIntegerLine **offset;
QPushButton *load,*save;
QLabel *iirlabel,firlabel;
QButtonGroup *bg;
QRadioButton *fir,*iir;
QPushButton *ok,*cancel;
QPushButton *dofilter;
FFTWidget *filterwidget;
FFTWidget *phasewidget;
ScaleWidget *ampx,*ampy;
ScaleWidget *phasex,*phasey;
CornerPatchWidget *phasecorner;
CornerPatchWidget *ampcorner;
};
//*****************************************************************************
class MovingFilterDialog : public QDialog
{
Q_OBJECT
public:
MovingFilterDialog (QWidget *parent=0,int num=1);
~MovingFilterDialog ();
QList<CPoint> *getPoints ();
int getType ();
int getState ();
int getTap();
int getLow(); //for getting lower bound and
int getHigh(); //higher bound
public slots:
void toggleState();
void checkTap(const char *);
protected:
void resizeEvent (QResizeEvent *);
private:
int num;
QCheckBox *usecurve;
KRestrictedLine *low,*high;
KIntegerLine *tap;
QLabel *lowlabel,*highlabel;
QPushButton *ok,*cancel;
CurveWidget *curve;
};