File: enginefilter.h

package info (click to toggle)
mixxx 1.10.1~dfsg0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 65,892 kB
  • sloc: cpp: 141,392; xml: 118,671; ansic: 24,092; sh: 12,876; python: 8,553; makefile: 496; php: 57
file content (65 lines) | stat: -rw-r--r-- 2,237 bytes parent folder | download
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
/***************************************************************************
 *      enginefilter.h - Wrapper for FidLib Filter Library                 *
 *                      ----------------------                             *
 *   copyright      : (C) 2007 by John Sully                               *
 *   email          : jsully@scs.ryerson.ca                                *
 *                                                                         *
 **************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef ENGINEFILTER_H
#define ENGINEFILTER_H

#define MIXXX
#include "engine/engineobject.h"
#include "../lib/fidlib-0.9.9/fidlib.h"
#include "defs.h"

enum filterType{
	FILTER_LOWPASS,
	FILTER_BANDPASS,
	FILTER_HIGHPASS
};

#define PREDEF_HP 1
#define PREDEF_BP 2
#define PREDEF_LP 3

class EngineFilter : public EngineObject
{
public:
    EngineFilter( char *conf, int predefinedType = 0);
    ~EngineFilter();
    void process(const CSAMPLE *pIn, const CSAMPLE *ppOut, const int iBufferSize);
protected:
    const double *coefs;
    double iir;
    double fir;
    double tmp;
#define FILTER_BUF_SIZE 16
    double buf1[FILTER_BUF_SIZE];
	double buf2[FILTER_BUF_SIZE];
private:
    double (*processSample)(void *buf, const double sample);

    FidFilter *ff;
    FidFunc *funcp;
    FidRun *run;
    void *fbuf1;
    void *fbuf2;
};

double processSampleDynamic(void *buf, const double sample);
double processSampleHp(void *buf, const double sample);
double processSampleBp(void *buf, const double sample);
double processSampleLp(void *buf, const double sample);

#endif