libsidplayfp  1.2.1
WaveformCalculator.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2013 Leandro Nini <drfiemost@users.sourceforge.net>
5  * Copyright 2007-2010 Antti Lankila
6  * Copyright 2004 Dag Lem <resid@nimrod.no>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef WAVEFORMCALCULATOR_h
24 #define WAVEFORMCALCULATOR_h
25 
26 #include <map>
27 
28 #include "siddefs-fp.h"
29 #include "array.h"
30 
31 
32 namespace reSIDfp
33 {
34 
35 typedef struct
36 {
37  float bias;
38  float pulsestrength;
39  float topbit;
40  float distance;
41  float stmix;
43 
50 {
51 private:
52  typedef std::map<const CombinedWaveformConfig*, matrix_t> cw_cache_t;
53 
54 private:
55  cw_cache_t CACHE;
56 
57  static const CombinedWaveformConfig config[2][4];
58 
66  short calculateCombinedWaveform(CombinedWaveformConfig config, int waveform, int accumulator) const;
67 
69 
70 public:
71  static WaveformCalculator* getInstance();
72 
79  matrix_t* buildTable(ChipModel model);
80 };
81 
82 } // namespace reSIDfp
83 
84 #endif
Definition: array.h:41
Definition: WaveformCalculator.h:49
matrix_t * buildTable(ChipModel model)
Definition: WaveformCalculator.cpp:55
Definition: WaveformCalculator.h:35