/
Processor.h
56 lines (46 loc) · 1.8 KB
/
Processor.h
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
/*
* Copyright 2011 Matthew Tytel
*
* dfex 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 3 of the License, or
* (at your option) any later version.
*
* dfex is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with dfex. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PROCESSOR_H
#define PROCESSOR_H
#include <string.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "Setup.h"
#include "Class.h"
#include "Process.h"
#include "rapidxml.hpp"
class Processor : public Object {
public:
const Class *getClass() const { return &cls; }
static Object *newInstance() { return new Processor(); }
static Processor *readProcessor(rapidxml::xml_node<> &);
static Processor *readParameter(rapidxml::xml_node<> &,
const char *, float);
static Processor *createConstant(const char *);
virtual void process(const sample_t* in, sample_t* out, int num);
virtual void postProcess(const sample_t* in, sample_t* out, int num) { }
friend rapidxml::xml_node<> &operator<<(rapidxml::xml_node<> &onode,
const Processor &p) { return p.write(onode); }
friend rapidxml::xml_node<> &operator>>(rapidxml::xml_node<> &inode,
Processor &p) { return p.read(inode); }
protected:
static Class cls;
virtual rapidxml::xml_node<> &read(rapidxml::xml_node<> &);
virtual rapidxml::xml_node<> &write(rapidxml::xml_node<> &) const;
};
#endif