00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FILTER_H
00024 #define FILTER_H
00025
00026 namespace reSIDfp
00027 {
00028
00037 class Filter
00038 {
00039 private:
00043 bool enabled;
00044
00048 char filt;
00049
00050 protected:
00051
00055 double clockFrequency;
00056
00060 int fc;
00061
00065 int res;
00066
00070 int vol;
00071
00075 bool filt1, filt2, filt3, filtE;
00076
00080 bool voice3off;
00081
00085 bool hp, bp, lp;
00086
00087 protected:
00091 virtual void updatedCenterFrequency() = 0;
00092
00096 virtual void updatedResonance() = 0;
00097
00101 virtual void updatedMixing() = 0;
00102
00103 public:
00104 Filter() :
00105 enabled(true),
00106 filt(0),
00107 clockFrequency(0.),
00108 fc(0),
00109 res(0),
00110 vol(0),
00111 filt1(false),
00112 filt2(false),
00113 filt3(false),
00114 filtE(false),
00115 voice3off(false),
00116 hp(false),
00117 bp(false),
00118 lp(false) {}
00119
00120 virtual ~Filter() {}
00121
00130 virtual int clock(int v1, int v2, int v3) = 0;
00131
00137 void enable(bool enable);
00138
00139 void setClockFrequency(double clock);
00140
00144 void reset();
00145
00151 void writeFC_LO(unsigned char fc_lo);
00152
00158 void writeFC_HI(unsigned char fc_hi);
00159
00165 void writeRES_FILT(unsigned char res_filt);
00166
00172 void writeMODE_VOL(unsigned char mode_vol);
00173
00174 virtual void input(int input) = 0;
00175 };
00176
00177 }
00178
00179 #endif