libsidplayfp  0.3.5
SidFilter.h
1 /***************************************************************************
2  SidFilter.cpp - filter type decoding support
3  -------------------
4  begin : Sun Mar 11 2001
5  copyright : (C) 2001 by Simon White
6  email : s_a_white@email.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "sidplayfp/sidtypes.h"
19 
20 class iniParser;
21 
22 class SID_EXTERN SidFilter
23 {
24 protected:
25  enum { FILTER_RESID=1, FILTER_RESIDFP=2 };
26  int m_status;
27  const char *m_errorString;
28  sid_filter_t m_filter;
29  sid_filterfp_t m_filterfp;
30 
31 protected:
32  bool parsePoint(const char* str, long &a, long &b);
33  void readType1 (iniParser *ini);
34  void readType2 (iniParser *ini);
35  void readType3 (iniParser *ini);
36 
37 public:
38  SidFilter ();
39  ~SidFilter () {};
40 
41  void read (const char *filename);
42  void calcType2 (double fs, double fm, double ft);
43  void read (const char *filename, const char* section);
44  const char* error (void) { return m_errorString; }
45  const sid_filter_t* provide () const;
46  const sid_filterfp_t* providefp () const;
47 
48  operator bool () { return m_status!=0; }
49  const SidFilter& operator= (const SidFilter &filter);
50  const sid_filter_t &operator= (const sid_filter_t &filter);
51  const sid_filter_t *operator= (const sid_filter_t *filter);
52  const sid_filterfp_t &operator= (const sid_filterfp_t &filter);
53  const sid_filterfp_t *operator= (const sid_filterfp_t *filter);
54 };